mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Split UI configs, Removed Vignette, Initial work on selective UI
This commit is contained in:
parent
7b88280988
commit
dfca7b2f44
@ -1 +1 @@
|
||||
z\ace\Addons\ui
|
||||
z\ace\addons\ui
|
37
addons/ui/ACE_Settings.hpp
Normal file
37
addons/ui/ACE_Settings.hpp
Normal file
@ -0,0 +1,37 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(weaponInfo) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(WeaponInfo);
|
||||
};
|
||||
class GVAR(weaponName) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(WeaponName);
|
||||
};
|
||||
/*class GVAR(ammoCount) { // Disabled in config by ace_reload
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(AmmoCount);
|
||||
};*/
|
||||
class GVAR(magCount) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(MagCount);
|
||||
};
|
||||
class GVAR(grenadeName) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(GrenadeName);
|
||||
};
|
||||
class GVAR(grenadeCount) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(GrenadeCount);
|
||||
};
|
||||
class GVAR(zeroing) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(Zeroing);
|
||||
};
|
||||
};
|
11
addons/ui/CfgEventHandlers.hpp
Normal file
11
addons/ui/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
||||
};
|
||||
};
|
58
addons/ui/CfgVehicles.hpp
Normal file
58
addons/ui/CfgVehicles.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class ACE_ModuleUI: ACE_Module {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
category = "ACE";
|
||||
displayName = CSTRING(ModuleDisplayName);
|
||||
function = QFUNC(moduleInit);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
//icon = QUOTE(PATHTOF(UI\Icon_Module_UI_ca.paa));
|
||||
class Arguments {
|
||||
class weaponInfo {
|
||||
displayName = CSTRING(WeaponInfo);
|
||||
description = CSTRING(WeaponInfoDesc);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class weaponName {
|
||||
displayName = CSTRING(WeaponName);
|
||||
description = CSTRING(WeaponNameDesc);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
/*class ammoCount { // Disabled in config by ace_reload
|
||||
displayName = CSTRING(AmmoCount);
|
||||
description = CSTRING(AmmoCountDesc);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};*/
|
||||
class magCount {
|
||||
displayName = CSTRING(MagCount);
|
||||
description = CSTRING(MagCountDesc);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class grenadeName {
|
||||
displayName = CSTRING(GrenadeName);
|
||||
description = CSTRING(GrenadeNameDesc);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class grenadeCount {
|
||||
displayName = CSTRING(GrenadeCount);
|
||||
description = CSTRING(GrenadeCountDesc);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class zeroing {
|
||||
displayName = CSTRING(Zeroing);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = CSTRING(ModuleDescription);
|
||||
};
|
||||
};
|
||||
};
|
@ -1,9 +1,10 @@
|
||||
ace_ui
|
||||
=======
|
||||
|
||||
Changes the chat contrast on the map to allow easier reading
|
||||
Changes the chat contrast on the map to allow easier reading, removes vignette and provides settings to toggle different UI elements unavailable in Vanilla.
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [Jonpas] (https://github.com/jonpas)
|
||||
|
15
addons/ui/RscChat.hpp
Normal file
15
addons/ui/RscChat.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
class RscText;
|
||||
class RscDisplayChat {
|
||||
class controls {
|
||||
delete Line;
|
||||
delete Background;
|
||||
class CA_Background: RscText {
|
||||
colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class RscChatListDefault {
|
||||
colorBackground[] = {0,0,0,0.5}; // Make the chat background darker
|
||||
colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter
|
||||
};
|
4
addons/ui/RscVignette.hpp
Normal file
4
addons/ui/RscVignette.hpp
Normal file
@ -0,0 +1,4 @@
|
||||
class RscPicture;
|
||||
class RscVignette: RscPicture {
|
||||
colorText[] = {0, 0, 0, 0}; // Hide Vignette
|
||||
};
|
63
addons/ui/XEH_clientInit.sqf
Normal file
63
addons/ui/XEH_clientInit.sqf
Normal file
@ -0,0 +1,63 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Exit on Headless
|
||||
if !(hasInterface) exitWith {};
|
||||
|
||||
["SettingsInitialized", {
|
||||
// On load and entering/exiting a vehicle
|
||||
["infoDisplayChanged", {
|
||||
LOG("UI infoDisplayChanged");
|
||||
|
||||
private ["_elements", "_display"];
|
||||
|
||||
// All elements with their show/hide, IDD and IDC
|
||||
_elements = [
|
||||
[GVAR(weaponInfo), 300, 2302],
|
||||
[GVAR(weaponName), 300, 118],
|
||||
//[GVAR(ammoCount), 300, 184], // Disabled in config by ace_reload
|
||||
[GVAR(magCount), 300, 185],
|
||||
[GVAR(grenadeName), 300, 152],
|
||||
[GVAR(grenadeCount), 300, 151],
|
||||
[GVAR(zeroing), 300, 168]
|
||||
];
|
||||
|
||||
disableSerialization;
|
||||
{
|
||||
_display = _x;
|
||||
{
|
||||
EXPLODE_3_PVT(_x,_show,_idd,_idc);
|
||||
|
||||
//_idd = 300; //debug
|
||||
//_idc = 122; //debug
|
||||
if (_idd == ctrlIDD _display) then {
|
||||
_show = if (_show) then {0} else {1};
|
||||
|
||||
(_display displayCtrl _idc) ctrlSetFade _show;
|
||||
(_display displayCtrl _idc) ctrlCommit 0;
|
||||
};
|
||||
} forEach _elements;
|
||||
} forEach (uiNamespace getVariable "IGUI_displays"); // Those displays can be present several times for some reason
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
|
||||
/*
|
||||
RscUnitInfo = 300
|
||||
--------
|
||||
Alt = 122 (UNKNOWN)
|
||||
Ammo = 119 (UNKNOWN)
|
||||
AmmoCount = 184 (Ammo Count)
|
||||
MagCount = 185 (Magazine Count)
|
||||
CA_TextFlares = 151 (Grenade Count)
|
||||
CA_TextFlaresMode = 152 (Grenade Name)
|
||||
CA_Zeroing = 168 (Zeroing)
|
||||
Weapon = 118 (Weapon Name)
|
||||
WeaponInfoControlsGroupLeft = 2302 (entire Weapon Info without Zeroing and Stance)
|
||||
WeaponInfoControlsGroupRight = 2303 (UNKNOWN)
|
||||
|
||||
|
||||
RscStanceInfo = 303
|
||||
-------
|
||||
StanceIndicator = 188 (UNKNOWN)
|
||||
*/
|
7
addons/ui/XEH_preInit.sqf
Normal file
7
addons/ui/XEH_preInit.sqf
Normal file
@ -0,0 +1,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(moduleInit);
|
||||
|
||||
ADDON = true;
|
@ -6,25 +6,15 @@ class CfgPatches {
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"VKing"};
|
||||
authorUrl = "https://github.com/ACEMod/";
|
||||
author[] = {"VKing", "Jonpas"};
|
||||
authorUrl = "https://github.com/acemod/ACE3";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
class RscText;
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "ACE_Settings.hpp"
|
||||
|
||||
class RscDisplayChat {
|
||||
class controls {
|
||||
delete Line;
|
||||
delete Background;
|
||||
class CA_Background: RscText {
|
||||
colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class RscChatListDefault {
|
||||
colorBackground[] = {0,0,0,0.5}; // Make the chat background darker
|
||||
colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter
|
||||
};
|
||||
#include "RscChat.hpp"
|
||||
#include "RscVignette.hpp"
|
||||
|
29
addons/ui/functions/fnc_moduleInit.sqf
Normal file
29
addons/ui/functions/fnc_moduleInit.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Initializes the UI module.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Module Logic <LOGIC>
|
||||
* 1: Units <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(isServer) exitWith {};
|
||||
|
||||
PARAMS_3(_logic,_units,_activated);
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(weaponInfo), "weaponInfo"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(weaponName), "weaponName"] call EFUNC(common,readSettingFromModule);
|
||||
//[_logic, QGVAR(ammoCount), "ammoCount"] call EFUNC(common,readSettingFromModule); // Disabled in config by ace_reload
|
||||
[_logic, QGVAR(magCount), "magCount"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(grenadeName), "grenadeName"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(grenadeCount), "grenadeCount"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(zeroing), "zeroing"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
diag_log text "[ACE]: UI Module Initialized.";
|
50
addons/ui/stringtable.xml
Normal file
50
addons/ui/stringtable.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="UI">
|
||||
<Key ID="STR_ACE_UI_WeaponInfo">
|
||||
<English>Weapon Info</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_WeaponInfoDesc">
|
||||
<English>Entire weapon info interface (weapon name, firing mode, magazine info, ammo count, magazine count, grenade count) except zeroing.</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_WeaponName">
|
||||
<English>Weapon Name</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_AmmoCountDesc">
|
||||
<English>Requires enabled Weapon Info</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_AmmoCount">
|
||||
<English>Ammo Count</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_AmmoCountDesc">
|
||||
<English>Requires enabled Weapon Info</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_MagCount">
|
||||
<English>Magazine Count</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_MagCountDesc">
|
||||
<English>Requires enabled Weapon Info</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_GrenadeName">
|
||||
<English>Grenade Name</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_GrenadeNameDesc">
|
||||
<English>Requires enabled Weapon Info</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_GrenadeCount">
|
||||
<English>Grenade Count</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_GrenadeCountDesc">
|
||||
<English>Requires enabled Weapon Info</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_Zeroing">
|
||||
<English>Zeroing</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_ModuleDisplayName">
|
||||
<English>User Interface</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UI_ModuleDescription">
|
||||
<English>This module allows hiding of specific user interface parts.</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user