Skip to content

Commit

Permalink
CBA Restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
diwako committed Feb 18, 2019
1 parent cb248ef commit d3b1766
Show file tree
Hide file tree
Showing 108 changed files with 3,610 additions and 1,593 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@

*.biprivatekey

hemtt\.exe
keys/
releases/
tools/
*.pbo
1 change: 1 addition & 0 deletions addons/main/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\diwako_dui\addons\main
45 changes: 15 additions & 30 deletions mod/color_style.hpp → addons/main/CfgColorStyles.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
class diwako_dui_colors
{
class standard
{
class diwako_dui_colors {
class standard {
name = "Standard";

white = "#FFFFFF";
red = "#E60000";
green = "#00E600";
blue = "#005CFF";
yellow = "#E6E600";
tracked = "#EE42F4";
};

class ace:standard
{
class ace:standard {
name = "ACE 3";

white = "#FFFFFF";
Expand All @@ -23,8 +19,7 @@ class diwako_dui_colors
yellow = "#FFFFAB";
};

class sthud:standard
{
class sthud:standard {
name = "STUI";

white = "#FFFFFF";
Expand All @@ -34,8 +29,7 @@ class diwako_dui_colors
yellow = "#D9D900";
};

class wargame:standard
{
class wargame:standard {
name = "Wargame";

white = "#FEFFFF";
Expand All @@ -45,8 +39,7 @@ class diwako_dui_colors
yellow = "#DC9845";
};

class wargame2:standard
{
class wargame2:standard {
name = "Wargame (Military Green)";

white = "#9CB595";
Expand All @@ -56,8 +49,7 @@ class diwako_dui_colors
yellow = "#DC9845";
};

class protanopia:standard
{
class protanopia:standard {
name = "Protanopia";

white = "#FFFFFF";
Expand All @@ -67,8 +59,7 @@ class diwako_dui_colors
yellow = "#D9D934";
};

class protanomaly:standard
{
class protanomaly:standard {
name = "Protanomaly";

white = "#FFFFFF";
Expand All @@ -78,8 +69,7 @@ class diwako_dui_colors
yellow = "#D9D91B";
};

class deuteranopia:standard
{
class deuteranopia:standard {
name = "Deuteranopia";

white = "#FFFFFF";
Expand All @@ -89,8 +79,7 @@ class diwako_dui_colors
yellow = "#D9D941";
};

class deuteranomaly:standard
{
class deuteranomaly:standard {
name = "Deuteranomaly";

white = "#FFFFFF";
Expand All @@ -100,8 +89,7 @@ class diwako_dui_colors
yellow = "#D9D91F";
};

class tritanopia:standard
{
class tritanopia:standard {
name = "Tritanopia";

white = "#FFFFFF";
Expand All @@ -111,8 +99,7 @@ class diwako_dui_colors
yellow = "#D95E67";
};

class tritanomaly:standard
{
class tritanomaly:standard {
name = "Tritanomaly";

white = "#FFFFFF";
Expand All @@ -122,8 +109,7 @@ class diwako_dui_colors
yellow = "#D99F28";
};

class achromatopsia:standard
{
class achromatopsia:standard {
name = "Achromatopsia";

white = "#FFFFFF";
Expand All @@ -133,8 +119,7 @@ class diwako_dui_colors
yellow = "#C0C0C0";
};

class achromatomaly:standard
{
class achromatomaly:standard {
name = "Achromatomaly";

white = "#FFFFFF";
Expand All @@ -143,4 +128,4 @@ class diwako_dui_colors
blue = "#40409C";
yellow = "#CBCB69";
};
};
};
15 changes: 15 additions & 0 deletions addons/main/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
30 changes: 15 additions & 15 deletions mod/icon_style.hpp → addons/main/CfgIconStyles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,33 @@ class diwako_dui_icon_style
rank_colonel = "a3\ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa";

buddy = "a3\ui_f_curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa";
buddy_compass = "diwako_dui\UI\icon_styles\standard\buddy_compass";
buddy_compass = QPATHTO_T(UI\icon_styles\standard\buddy_compass);
};

class terry:standard
{
name = "Just The Tip";

sql = "diwako_dui\UI\icon_styles\terry\iconManLeader_ca.paa";
medic = "diwako_dui\UI\icon_styles\terry\iconManMedic_ca.paa";
auto_rifleman = "diwako_dui\UI\icon_styles\terry\iconManMG_ca.paa";
at_gunner = "diwako_dui\UI\icon_styles\terry\iconManAT_ca.paa";
engineer = "diwako_dui\UI\icon_styles\terry\iconManEngineer_ca.paa";
explosive_specialist = "diwako_dui\UI\icon_styles\terry\iconManExplosive_ca.paa";
rifleman = "diwako_dui\UI\icon_styles\terry\iconMan_ca.paa";
sql = QPATHTO_T(UI\icon_styles\terry\iconManLeader_ca.paa);
medic = QPATHTO_T(UI\icon_styles\terry\iconManMedic_ca.paa);
auto_rifleman = QPATHTO_T(UI\icon_styles\terry\iconManMG_ca.paa);
at_gunner = QPATHTO_T(UI\icon_styles\terry\iconManAT_ca.paa);
engineer = QPATHTO_T(UI\icon_styles\terry\iconManEngineer_ca.paa);
explosive_specialist = QPATHTO_T(UI\icon_styles\terry\iconManExplosive_ca.paa);
rifleman = QPATHTO_T(UI\icon_styles\terry\iconMan_ca.paa);

buddy_compass = "diwako_dui\UI\icon_styles\terry\buddy_compass.paa";
buddy_compass = QPATHTO_T(UI\icon_styles\terry\buddy_compass.paa);
};

class nato:standard
{
name = "NATO JMS";

sql = "diwako_dui\UI\icon_styles\nato\GAR_iconManLeader_ca.paa";
medic = "diwako_dui\UI\icon_styles\nato\GAR_iconManMedic_ca.paa";
auto_rifleman = "diwako_dui\UI\icon_styles\nato\GAR_iconManMG_ca.paa";
at_gunner = "diwako_dui\UI\icon_styles\nato\GAR_iconManAT_ca.paa";
engineer = "diwako_dui\UI\icon_styles\nato\GAR_iconManEngineer_ca.paa";
explosive_specialist = "diwako_dui\UI\icon_styles\nato\GAR_iconManExplosive_ca.paa";
sql = QPATHTO_T(UI\icon_styles\nato\GAR_iconManLeader_ca.paa);
medic = QPATHTO_T(UI\icon_styles\nato\GAR_iconManMedic_ca.paa);
auto_rifleman = QPATHTO_T(UI\icon_styles\nato\GAR_iconManMG_ca.paa);
at_gunner = QPATHTO_T(UI\icon_styles\nato\GAR_iconManAT_ca.paa);
engineer = QPATHTO_T(UI\icon_styles\nato\GAR_iconManEngineer_ca.paa);
explosive_specialist = QPATHTO_T(UI\icon_styles\nato\GAR_iconManExplosive_ca.paa);
};
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions addons/main/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PREP(canHudBeShown);
PREP(toHex);
2 changes: 2 additions & 0 deletions addons/main/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "script_component.hpp"
if (is3DEN || !hasInterface) exitWith {};
138 changes: 138 additions & 0 deletions addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#include "script_component.hpp"
ADDON = false;
#include "XEH_PREP.hpp"

#include "\a3\ui_f\hpp\defineDIKCodes.inc"
#define CBA_SETTINGS_CAT localize "STR_dui_mod" + " - Main"

GVAR(toggled_off) = false;
GVAR(inFeatureCamera) = false;

private _curCat = localize "STR_dui_cat_general";

private _availableFonts = [
"PuristaBold",
"PuristaLight",
"PuristaMedium",
"PuristaSemibold",
"RobotoCondensed",
"RobotoCondensedBold",
"RobotoCondensedLight",
"EtelkaMonospacePro",
// "EtelkaMonospaceProBold",
// "EtelkaNarrowMediumPro",
"LCD14"
// "TahomaB"
];

[
"diwako_dui_font"
,"LIST"
,[localize "STR_dui_font", localize "STR_dui_font_desc"]
,[CBA_SETTINGS_CAT, _curCat]
,[
_availableFonts,
_availableFonts,
4
]
,false
,{
[QGVAR(refreshUI),[]] call CBA_fnc_localEvent;
}
] call CBA_Settings_fnc_init;

#include "include\getIconStyles.sqf"
[
"diwako_dui_icon_style"
,"LIST"
,[localize "STR_dui_icon", localize "STR_dui_icon_desc"]
,[CBA_SETTINGS_CAT, _curCat]
,[
_iconIdent,
_iconNames,
0
]
,false
] call CBA_Settings_fnc_init;

#include "include\getColorStyles.sqf"
[
"diwako_dui_colors"
,"LIST"
,[localize "STR_dui_color", localize "STR_dui_color_desc"]
,[CBA_SETTINGS_CAT, _curCat]
,[
_colorIdent,
_colorNames,
0
]
,false
] call CBA_Settings_fnc_init;

if (isClass(configfile >> "CfgPatches" >> "ace_interact_menu")) then {
[
"diwako_dui_ace_hide_interaction"
,"CHECKBOX"
,[localize "STR_dui_ace_hide_interaction", localize "STR_dui_ace_hide_interaction_desc"]
,[CBA_SETTINGS_CAT, _curCat]
,true
,false
] call CBA_Settings_fnc_init;
} else {
diwako_dui_ace_hide_interaction = false;
};

if !(hasInterface) exitWith {};

// cba eh for hiding the hud when in certain camera modes
["featureCamera", {
params ["_player", "_featureCamera"];
GVAR(inFeatureCamera) = !(_featureCamera isEqualTo "");
}, true] call CBA_fnc_addPlayerEventHandler;

// player remote controls another unit or changes avatar
// mainly used for the change in avatar / switch unit part as displays will be closed
["unit", {
params ["_newPlayerUnit", "_oldPlayerUnit"];
[QGVAR(refreshUI),[]] call CBA_fnc_localEvent;
}, true] call CBA_fnc_addPlayerEventHandler;

if (isClass (configfile >> "CfgPatches" >> "ace_nametags")) then {
["CBA_SettingChanged", {
params ["_setting", "_value"];
switch (_setting) do {
case "ace_nametags_nametagColorMain": {
EGVAR(main,colors_ace) setVariable ["main_compass", _value select [0, 3]];
EGVAR(main,colors_ace) setVariable ["main", [(_value select 0) * 255,(_value select 1) * 255,(_value select 2) * 255] call EFUNC(main,toHex)];
};
case "ace_nametags_nametagColorRed": {
EGVAR(main,colors_ace) setVariable ["red_compass", _value select [0, 3]];
EGVAR(main,colors_ace) setVariable ["red", [(_value select 0) * 255,(_value select 1) * 255,(_value select 2) * 255] call EFUNC(main,toHex)];
};
case "ace_nametags_nametagColorGreen": {
EGVAR(main,colors_ace) setVariable ["green_compass", _value select [0, 3]];
EGVAR(main,colors_ace) setVariable ["green", [(_value select 0) * 255,(_value select 1) * 255,(_value select 2) * 255] call EFUNC(main,toHex)];
};
case "ace_nametags_nametagColorBlue": {
EGVAR(main,colors_ace) setVariable ["blue_compass", _value select [0, 3]];
EGVAR(main,colors_ace) setVariable ["blue", [(_value select 0) * 255,(_value select 1) * 255,(_value select 2) * 255] call EFUNC(main,toHex)];
};
case "ace_nametags_nametagColorYellow": {
EGVAR(main,colors_ace) setVariable ["yellow_compass", _value select [0, 3]];
EGVAR(main,colors_ace) setVariable ["yellow", [(_value select 0) * 255,(_value select 1) * 255,(_value select 2) * 255] call EFUNC(main,toHex)];
};
default { };
};
}] call CBA_fnc_addEventHandler;
};

// keybind to toggle whole UI
[CBA_SETTINGS_CAT, "diwako_dui_button_toggle_ui", localize "STR_dui_key_toggle", {
GVAR(toggled_off) = !GVAR(toggled_off);
[QGVAR(hudToggled), [GVAR(toggled_off)]] call CBA_fnc_localEvent;
true
},
{false},
[DIK_MULTIPLY, [false, true, false]], false] call CBA_fnc_addKeybind;

ADDON = true;
2 changes: 2 additions & 0 deletions addons/main/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"
18 changes: 18 additions & 0 deletions addons/main/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"cba_main"};
author[] = {"diwako"};
authorUrl = "https://github.com/diwako/diwako_dui";
license = "https://www.bohemia.net/community/licenses/arma-public-license-share-alike";
VERSION_CONFIG;
};
};

#include "CfgEventHandlers.hpp"
#include "CfgColorStyles.hpp"
#include "CfgIconStyles.hpp"
12 changes: 12 additions & 0 deletions addons/main/functions/fnc_canHudBeShown.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "script_component.hpp"
params ["_player"];
!(
visibleMap ||
{GVAR(toggled_off) ||
{!alive _player ||
{(_player getVariable ["ace_spectator_isSet", false]) ||
{dialog ||
{diwako_dui_ace_hide_interaction && {missionNamespace getVariable ["ace_interact_menu_openedMenuType",-1] > -1} ||
{!isnull (missionNamespace getVariable ["ace_arsenal_camera", objNull]) ||
{GVAR(inFeatureCamera)}}}}}}}
)
Loading

0 comments on commit d3b1766

Please sign in to comment.