mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
8c249a12e8
commit
a6ced105ee
1
addons/novehicleclanlogo/$PBOPREFIX$
Normal file
1
addons/novehicleclanlogo/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\novehicleclanlogo
|
18
addons/novehicleclanlogo/CfgEventHandlers.hpp
Normal file
18
addons/novehicleclanlogo/CfgEventHandlers.hpp
Normal 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));
|
||||
};
|
||||
};
|
4
addons/novehicleclanlogo/README.md
Normal file
4
addons/novehicleclanlogo/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
novehicleclanlogo
|
||||
=============
|
||||
|
||||
Prevents clan logo from being displayed on vehicles controlled by players.
|
1
addons/novehicleclanlogo/XEH_PREP.hpp
Normal file
1
addons/novehicleclanlogo/XEH_PREP.hpp
Normal file
@ -0,0 +1 @@
|
||||
PREP(removeClanLogo);
|
14
addons/novehicleclanlogo/XEH_postInit.sqf
Normal file
14
addons/novehicleclanlogo/XEH_postInit.sqf
Normal 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;
|
11
addons/novehicleclanlogo/XEH_preInit.sqf
Normal file
11
addons/novehicleclanlogo/XEH_preInit.sqf
Normal 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;
|
3
addons/novehicleclanlogo/XEH_preStart.sqf
Normal file
3
addons/novehicleclanlogo/XEH_preStart.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "XEH_PREP.hpp"
|
17
addons/novehicleclanlogo/config.cpp
Normal file
17
addons/novehicleclanlogo/config.cpp
Normal 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"
|
26
addons/novehicleclanlogo/functions/fnc_removeClanLogo.sqf
Normal file
26
addons/novehicleclanlogo/functions/fnc_removeClanLogo.sqf
Normal 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
|
1
addons/novehicleclanlogo/functions/script_component.hpp
Normal file
1
addons/novehicleclanlogo/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\novehicleclanlogo\script_component.hpp"
|
11
addons/novehicleclanlogo/initSettings.sqf
Normal file
11
addons/novehicleclanlogo/initSettings.sqf
Normal 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;
|
16
addons/novehicleclanlogo/script_component.hpp
Normal file
16
addons/novehicleclanlogo/script_component.hpp
Normal 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"
|
13
addons/novehicleclanlogo/stringtable.xml
Normal file
13
addons/novehicleclanlogo/stringtable.xml
Normal 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>
|
18
docs/wiki/feature/novehicleclanlogo.md
Normal file
18
docs/wiki/feature/novehicleclanlogo.md
Normal 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.
|
Loading…
Reference in New Issue
Block a user