Add No vehicle clan logo component (#9018)

* Add novehicleclanlogo component

* Documentation

* Update README.md

* Use selection name from vehicle config
This commit is contained in:
Filip Maciejewski 2022-09-01 19:44:38 +02:00 committed by GitHub
parent 8c249a12e8
commit a6ced105ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 154 additions and 0 deletions

View File

@ -0,0 +1 @@
z\ace\addons\novehicleclanlogo

View File

@ -0,0 +1,18 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};

View File

@ -0,0 +1,4 @@
novehicleclanlogo
=============
Prevents clan logo from being displayed on vehicles controlled by players.

View File

@ -0,0 +1 @@
PREP(removeClanLogo);

View File

@ -0,0 +1,14 @@
#include "script_component.hpp"
// clan logos are not used in singleplayer
if (!isMultiplayer) exitWith {};
["CBA_settingsInitialized", {
TRACE_1("settingsInit eh",GVAR(enabled));
if (isServer && {GVAR(enabled)}) then {
["LandVehicle", "initPost", LINKFUNC(removeClanLogo), true, [], true] call CBA_fnc_addClassEventHandler;
["Air", "initPost", LINKFUNC(removeClanLogo), true, [], true] call CBA_fnc_addClassEventHandler;
["Ship", "initPost", LINKFUNC(removeClanLogo), true, [], true] call CBA_fnc_addClassEventHandler;
};
}] call CBA_fnc_addEventHandler;

View File

@ -0,0 +1,11 @@
#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
ADDON = true;

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

View File

@ -0,0 +1,17 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);
authors[] = {"veteran29"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"

View File

@ -0,0 +1,26 @@
#include "script_component.hpp"
/*
* Author: veteran29
* Replaces the vehicle clan logo with an empty texture.
*
* Arguments:
* 0: Vehicle <OBJECT>
*
* Return Value:
* None
*
* Example:
* [vehicle player] call ace_novehicleclanlogo_fnc_removeClanLogo
*
* Public: Yes
*/
params ["_vehicle"];
private _selectionClan = getText (configOf _vehicle >> "selectionClan");
if !(_selectionClan in selectionNames _vehicle) exitWith {
TRACE_2("vehicle does not have 'selectionClan' selection",_vehicle,_selectionLogo);
};
TRACE_1("replacing clan logo with empty texture",_vehicle);
_vehicle setObjectTextureGlobal [_selectionClan, "#(argb,1,1,1)color(0,0,0,0)"] // return

View File

@ -0,0 +1 @@
#include "\z\ace\addons\novehicleclanlogo\script_component.hpp"

View File

@ -0,0 +1,11 @@
private _category = [ELSTRING(common,ACEKeybindCategoryVehicles), LSTRING(DisplayName)],;
[
QGVAR(enabled), "CHECKBOX",
[LELSTRING(common,Enabled), LSTRING(Enabled_Tooltip)],
_category,
false,
true,
{},
true
] call CBA_fnc_addSetting;

View File

@ -0,0 +1,16 @@
#define COMPONENT novehicleclanlogo
#define COMPONENT_BEAUTIFIED No Vehicle Clan Logo
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
#ifdef DEBUG_ENABLED_NOVEHICLECLANLOGO
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_NOVEHICLECLANLOGO
#define DEBUG_SETTINGS DEBUG_ENABLED_NOVEHICLECLANLOGO
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Novehicleclanlogo">
<Key ID="STR_ACE_Novehicleclanlogo_DisplayName">
<English>Remove clan logo from vehicles</English>
<Polish>Usuń logo klanu z pojazdów</Polish>
</Key>
<Key ID="STR_ACE_Novehicleclanlogo_Enabled_Tooltip">
<English>Prevents clan logo from being displayed on vehicles controlled by players.</English>
<Polish>Zapobiega wyświetlaniu logo klanu na pojazdach kontrolowanych przez graczy.</Polish>
</Key>
</Package>
</Project>

View File

@ -0,0 +1,18 @@
---
layout: wiki
title: No vehicle clan logo
component: novehicleclanlogo
description: Removes clan logo from vehicles.
group: feature
category: realism
parent: wiki
mod: ace
version:
major: 3
minor: 15
patch: 1
---
## 1. Overview
Prevents clan logo from vehicles controlled by players. Can be toggled in ACE Vehicles settings category.