Cleanup zeus display modules

Replaces display size and position defines with macros for readability and compactness.

Changes naming convention of functions and displays to distinguish categories and make more readable.

Converts the global set skill module to use display events rather than waiting in a loop for the module to be set and confirmed.
This commit is contained in:
SilentSpike 2016-05-15 18:08:54 +01:00
parent 77de1ec6eb
commit 4d028be876
12 changed files with 267 additions and 309 deletions

View File

@ -13,7 +13,7 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_postInit) ); init = QUOTE(call COMPILE_FILE(XEH_postInit));
}; };
}; };

View File

@ -86,6 +86,26 @@ class CfgVehicles {
scope = 1; scope = 1;
scopeCurator = 2; scopeCurator = 2;
}; };
class GVAR(moduleAddSpareTrack): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleAddSpareTrack_DisplayName);
function = QFUNC(moduleAddSpareTrack);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo
class ModuleDescription {
description = CSTRING(ModuleAddSpareTrack_Description);
sync[] = {};
};
};
class GVAR(moduleAddSpareWheel): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleAddSpareWheel_DisplayName);
function = QFUNC(moduleAddSpareWheel);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo
class ModuleDescription {
description = CSTRING(ModuleAddSpareWheel_Description);
sync[] = {};
};
};
class GVAR(moduleCaptive): GVAR(moduleBase) { class GVAR(moduleCaptive): GVAR(moduleBase) {
curatorCanAttach = 1; curatorCanAttach = 1;
displayName = CSTRING(ModuleCaptive_DisplayName); displayName = CSTRING(ModuleCaptive_DisplayName);
@ -96,6 +116,44 @@ class CfgVehicles {
sync[] = {}; sync[] = {};
}; };
}; };
class GVAR(moduleSetMedic): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedic_DisplayName);
function = QFUNC(moduleSetMedic);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
description = "";
sync[] = {};
};
};
class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedicalFacility_DisplayName);
function = QFUNC(moduleSetMedicalFacility);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
description = "";
sync[] = {};
};
};
class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName);
function = QFUNC(moduleSetMedicalVehicle);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
description = "";
sync[] = {};
};
};
class GVAR(moduleGlobalSetSkill): GVAR(moduleBase) {
displayName = "Global Set AI Skill";
// icon = "\a3\Modules_F_Curator\Data\iconEndMission_ca.paa";
// portrait = "\a3\Modules_F_Curator\Data\portraitEndMission_ca.paa";
curatorInfoType = QGVAR(RscGlobalSetSkill);
class Arguments {};
class Attributes {};//todo, make it a threden as well
};
class GVAR(moduleSurrender): GVAR(moduleBase) { class GVAR(moduleSurrender): GVAR(moduleBase) {
curatorCanAttach = 1; curatorCanAttach = 1;
displayName = CSTRING(ModuleSurrender_DisplayName); displayName = CSTRING(ModuleSurrender_DisplayName);
@ -116,89 +174,4 @@ class CfgVehicles {
sync[] = {}; sync[] = {};
}; };
}; };
class GVAR(moduleSetMedic): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedic_DisplayName);
function = QFUNC(moduleSetMedic);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
description = "";
sync[] = {};
};
};
class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName);
function = QFUNC(moduleSetMedicalVehicle);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
description = "";
sync[] = {};
};
};
class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleSetMedicalFacility_DisplayName);
function = QFUNC(moduleSetMedicalFacility);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));
class ModuleDescription {
description = "";
sync[] = {};
};
};
class GVAR(moduleAddSpareTrack): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleAddSpareTrack_DisplayName);
function = QFUNC(moduleAddSpareTrack);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo
class ModuleDescription {
description = CSTRING(ModuleAddSpareTrack_Description);
sync[] = {};
};
};
class GVAR(moduleAddSpareWheel): GVAR(moduleBase) {
curatorCanAttach = 1;
displayName = CSTRING(ModuleAddSpareWheel_DisplayName);
function = QFUNC(moduleAddSpareWheel);
icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo
class ModuleDescription {
description = CSTRING(ModuleAddSpareWheel_Description);
sync[] = {};
};
};
// class GVAR(moduleSetSuppression): GVAR(moduleBase) {
// curatorCanAttach = 1;
// displayName = CSTRING(ModuleSetSupp_DisplayName);
// function = QFUNC(moduleSetSuppression);
// class ModuleDescription {
// description = "Set group of units to supressed.";
// sync[] = {};
// };
// };
// class GVAR(moduleDisableSuppression): GVAR(moduleBase) {
// curatorCanAttach = 1;
// displayName = CSTRING(ModuleDisableSupp_DisplayName);
// function = QFUNC(moduleDisableSuppression);
// class ModuleDescription {
// description = "Remove suppression for units in group";
// sync[] = {};
// };
// };
class GVAR(zeus_globalSetSkill): GVAR(moduleBase) {
author = ECSTRING(common,ACETeam);
category = "ACE";
scope = 1;
scopeCurator = 2;
isTriggerActivated = 0;
displayName = "Global Set AI Skill";
// icon = "\a3\Modules_F_Curator\Data\iconEndMission_ca.paa";
// portrait = "\a3\Modules_F_Curator\Data\portraitEndMission_ca.paa";
function = QFUNC(zeus_globalSetSkill);
curatorInfoType = QGVAR(RscDisplayAttributes_globalSetSkill);
curatorCost = 0;
class Arguments {};
class Attributes {};//todo, make it a threden as well
};
}; };

View File

@ -1,159 +0,0 @@
class RscControlsGroup;
class RscControlsGroupNoScrollbars;
class RscText;
class RscListbox;
class RscEdit;
class RscXSliderH;
class RscCheckBox;
class RscDisplayAttributes {
class Controls {
class Background;
class Title;
class Content: RscControlsGroup {
class controls;
};
class ButtonOK;
class ButtonCancel;
};
};
class GVAR(RscDisplayAttributes_globalSetSkill): RscDisplayAttributes {
onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscDisplayAttributes_globalSetSkill)))] call FUNC(zeusAttributes));
onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscDisplayAttributes_globalSetSkill)))] call FUNC(zeusAttributes));
class Controls: Controls {
class Background: Background {};
class Title: Title {};
class Content: Content {
class Controls {
class globalSetSkill: RscControlsGroupNoScrollbars {
onSetFocus = QUOTE(_this call FUNC(zeusAttributes_globalSetSkill));
idc = 26422;
x = "0";
y = "0";
w = "26 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
class controls {
class Title1: RscText {
idc = -1;
text = "Skill: General";
toolTip = "Global AI Set Skill: general,commanding,courage";
x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorBackground[] = {0,0,0,0.5};
};
class Value1: RscXSliderH {
idc = 16184;
x = "10.1 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "15.9 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Title2: Title1 {
idc = -1;
text = "Skill: aimingAccuracy";
toolTip = "Global AI Set Skill: aimingAccuracy";
y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Value2: Value1 {
idc = 16185;
y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Title3: Title1 {
idc = -1;
text = "Skill: weaponHandling";
toolTip = "Global AI Set Skill: aimingShake,aimingSpeed,reloadSpeed";
y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Value3: Value1 {
idc = 16186;
y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Title4: Title1 {
idc = -1;
text = "Skill: spotting";
toolTip = "Global AI Set Skill: spotDistance,spotTime";
y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Value4: Value1 {
idc = 16187;
y = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Title5: Title1 {
idc = -1;
text = "Seek Cover";
toolTip = "Global AI Set Skill: AI Seek Cover";
y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Value5: RscCheckBox {
idc = 16188;
x = "10.1 * (((safezoneW / safezoneH) min 1.2) / 40)";
y = "4.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "1 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Title6: Title5 {
idc = -1;
text = "AUTOCOMBAT";
toolTip = "Global AI Set Skill: Ai Switch To Combat Mode";
y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class Value6: Value5 {
idc = 16189;
y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
};
};
};
};
class ButtonOK: ButtonOK {};
class ButtonCancel: ButtonCancel {};
};
};
class GVAR(cargoAttribute): RscControlsGroupNoScrollbars {
onSetFocus = QUOTE(_this call FUNC(zeusAttributes_vehCargo));
idc = 80085;
x = "7 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "10 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "26 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "3 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
class controls {
class Title: RscText {
idc = -1;
text = "Cargo:";
x = "0 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "3 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorBackground[] = {0,0,0,0.5};
};
class Background: RscText {
idc = -1;
x = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "16 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "2.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorBackground[] = {1,1,1,0.1};
};
class Cargo: RscListBox {
idc = 80086;
x = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
y = "0 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "16 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "3 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
};
};
class RscDisplayAttributesVehicle: RscDisplayAttributes {
class Controls: Controls {
class Content: Content {
class Controls: controls {
class Cargo: GVAR(cargoAttribute) { };
};
};
};
};

View File

@ -8,6 +8,7 @@ PREP(handleZeusUnitAssigned);
PREP(moduleAddSpareTrack); PREP(moduleAddSpareTrack);
PREP(moduleAddSpareWheel); PREP(moduleAddSpareWheel);
PREP(moduleCaptive); PREP(moduleCaptive);
PREP(moduleGlobalSetSkill);
PREP(moduleSetMedic); PREP(moduleSetMedic);
PREP(moduleSetMedicalVehicle); PREP(moduleSetMedicalVehicle);
PREP(moduleSetMedicalFacility); PREP(moduleSetMedicalFacility);
@ -15,7 +16,6 @@ PREP(moduleSurrender);
PREP(moduleUnconscious); PREP(moduleUnconscious);
PREP(moduleZeusSettings); PREP(moduleZeusSettings);
PREP(setSkillsLocal); PREP(setSkillsLocal);
PREP(zeus_globalSetSkill); PREP(ui_globalSetSkill);
PREP(ui_vehCargo);
PREP(zeusAttributes); PREP(zeusAttributes);
PREP(zeusAttributes_globalSetSkill);
PREP(zeusAttributes_vehCargo);

View File

@ -1,5 +1,9 @@
#include "script_component.hpp" #include "script_component.hpp"
if (isServer) then {
["ServerUpdateAISettings",FUNC(moduleGlobalSetSkill)] call EFUNC(common,addEventHandler);
};
["UpdateAISettings", { ["UpdateAISettings", {
TRACE_1("UpdateAISettings EH",_this); TRACE_1("UpdateAISettings EH",_this);
{ {

View File

@ -2,7 +2,7 @@
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {QGVAR(zeus_globalSetSkill)}; units[] = {QGVAR(moduleGlobalSetSkill)};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
@ -42,4 +42,4 @@ class ACE_Curator {
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "ACE_Settings.hpp" #include "ACE_Settings.hpp"
#include "UI_RscAttributes.hpp" #include "ui\RscAttributes.hpp"

View File

@ -0,0 +1,27 @@
#include "script_component.hpp"
params ["_logic"];
TRACE_1("params",_logic);
[QGVAR(aiSkill_set), true, false, true] call ace_common_fnc_setSetting;
if (!GVAR(aiSkill_set)) exitWith {
TRACE_1("Setting must be forced off", GVAR(aiSkill_set));
};
private _val = _logic getVariable ["aiSkill_general", -1];
if (_val != -1) then { [QGVAR(aiSkill_general), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_aimingAccuracy", -1];
if (_val != -1) then { [QGVAR(aiSkill_aimingAccuracy), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_weaponHandling", -1];
if (_val != -1) then { [QGVAR(aiSkill_weaponHandling), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_spotting", -1];
if (_val != -1) then { [QGVAR(aiSkill_spotting), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_COVER", -1];
if (!(_val isEqualTo -1)) then { [QGVAR(aiSkill_COVER), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_AUTOCOMBAT", -1];
if (!(_val isEqualTo -1)) then { [QGVAR(aiSkill_AUTOCOMBAT), _val, false, true] call ace_common_fnc_setSetting; };
["UpdateAISettings", []] call ace_common_fnc_globalEvent;
deleteVehicle _logic;
TRACE_6("ai settings updated",GVAR(aiSkill_general),GVAR(aiSkill_aimingAccuracy),GVAR(aiSkill_weaponHandling),GVAR(aiSkill_spotting),GVAR(aiSkill_COVER),GVAR(aiSkill_AUTOCOMBAT));

View File

@ -8,7 +8,7 @@ TRACE_1("params",_control);
//Generic Init: //Generic Init:
private _display = ctrlparent _control; private _display = ctrlparent _control;
private _ctrlButtonOK = _display displayctrl 1; //IDC_OK private _ctrlButtonOK = _display displayctrl 1; //IDC_OK
private _logic = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objnull]; private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull);
TRACE_1("logicObject",_logic); TRACE_1("logicObject",_logic);
_control ctrlRemoveAllEventHandlers "setFocus"; _control ctrlRemoveAllEventHandlers "setFocus";
@ -22,7 +22,7 @@ _fnc_sliderMove = {
case (16186): {GVAR(aiSkill_weaponHandling)}; case (16186): {GVAR(aiSkill_weaponHandling)};
case (16187): {GVAR(aiSkill_spotting)}; case (16187): {GVAR(aiSkill_spotting)};
}; };
_slider ctrlSetTooltip format ["%1 (was %2)", sliderPosition _slider, _curVal]; _slider ctrlSetTooltip format ["%1%3 (was %2%3)", round(sliderPosition _slider * 100), round(_curVal * 100), "%"];
}; };
//Specific on-load stuff: //Specific on-load stuff:
@ -50,18 +50,6 @@ _fnc_sliderMove = {
(_display displayCtrl 16189) cbSetChecked GVAR(aiSkill_AUTOCOMBAT); (_display displayCtrl 16189) cbSetChecked GVAR(aiSkill_AUTOCOMBAT);
private _fnc_onUnload = {
params [["_display", displayNull, [displayNull]]];
TRACE_1("_fnc_onUnload params",_display);
private _logic = missionnamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objnull];
if (isNull _logic) exitWith {};
_logic setVariable ["closed", true];
};
private _fnc_onConfirm = { private _fnc_onConfirm = {
params [["_ctrlButtonOK", controlNull, [controlNull]]]; params [["_ctrlButtonOK", controlNull, [controlNull]]];
TRACE_1("_fnc_onConfirm params",_this); TRACE_1("_fnc_onConfirm params",_this);
@ -78,8 +66,8 @@ private _fnc_onConfirm = {
_logic setVariable ["aiSkill_spotting", sliderPosition (_display displayCtrl 16187), true]; _logic setVariable ["aiSkill_spotting", sliderPosition (_display displayCtrl 16187), true];
_logic setVariable ["aiSkill_COVER", cbChecked (_display displayCtrl 16188), true]; _logic setVariable ["aiSkill_COVER", cbChecked (_display displayCtrl 16188), true];
_logic setVariable ["aiSkill_AUTOCOMBAT", cbChecked (_display displayCtrl 16189), true]; _logic setVariable ["aiSkill_AUTOCOMBAT", cbChecked (_display displayCtrl 16189), true];
_logic setVariable ["set", true, true];
["ServerUpdateAISettings", [_logic]] call EFUNC(common,serverEvent);
}; };
_display displayaddeventhandler ["unload", _fnc_onUnload];
_ctrlButtonOK ctrladdeventhandler ["buttonclick", _fnc_onConfirm]; _ctrlButtonOK ctrladdeventhandler ["buttonclick", _fnc_onConfirm];

View File

@ -1,43 +0,0 @@
#include "script_component.hpp"
params ["_logic"];
TRACE_1("params",_logic);
if (!isServer) exitWith {};
[{
params ["_logic"];
(isNull _logic) || {_logic getVariable ["closed", false]}
}, {
params ["_logic"];
if (isNull _logic) exitWith {TRACE_1("null",_logic);};
if (_logic getVariable ["set", false]) then {
[QGVAR(aiSkill_set), true, false, true] call ace_common_fnc_setSetting;
if (!GVAR(aiSkill_set)) exitWith {
TRACE_1("Setting must be forced off", GVAR(aiSkill_set));
};
private _val = _logic getVariable ["aiSkill_general", -1];
if (_val != -1) then { [QGVAR(aiSkill_general), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_aimingAccuracy", -1];
if (_val != -1) then { [QGVAR(aiSkill_aimingAccuracy), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_weaponHandling", -1];
if (_val != -1) then { [QGVAR(aiSkill_weaponHandling), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_spotting", -1];
if (_val != -1) then { [QGVAR(aiSkill_spotting), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_COVER", -1];
if (!(_val isEqualTo -1)) then { [QGVAR(aiSkill_COVER), _val, false, true] call ace_common_fnc_setSetting; };
_val = _logic getVariable ["aiSkill_AUTOCOMBAT", -1];
if (!(_val isEqualTo -1)) then { [QGVAR(aiSkill_AUTOCOMBAT), _val, false, true] call ace_common_fnc_setSetting; };
["UpdateAISettings", []] call ace_common_fnc_globalEvent;
TRACE_6("ai settings updated",GVAR(aiSkill_general),GVAR(aiSkill_aimingAccuracy),GVAR(aiSkill_weaponHandling),GVAR(aiSkill_spotting),GVAR(aiSkill_COVER),GVAR(aiSkill_AUTOCOMBAT));
} else {
TRACE_1("closed but not set",_logic);
};
deleteVehicle _logic;
}, [_logic]] call ace_common_fnc_waitUntilAndExecute;

View File

@ -15,3 +15,11 @@
#endif #endif
#include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\main\script_macros.hpp"
// UI grid
#define SIZEX ((safezoneW / safezoneH) min 1.2)
#define SIZEY (SIZEX / 1.2)
#define W_PART(num) (num * (SIZEX / 40))
#define H_PART(num) (num * (SIZEY / 25))
#define X_PART(num) (W_PART(num) + (safezoneX + (safezoneW - SIZEX)/2))
#define Y_PART(num) (H_PART(num) + (safezoneY + (safezoneH - SIZEY)/2))

View File

@ -0,0 +1,160 @@
class RscControlsGroup;
class RscControlsGroupNoScrollbars;
class RscText;
class RscListbox;
class RscEdit;
class RscXSliderH;
class RscCheckBox;
class RscDisplayAttributes {
class Controls {
class Background;
class Title;
class Content: RscControlsGroup {
class controls;
};
class ButtonOK;
class ButtonCancel;
};
};
class GVAR(RscGlobalSetSkill): RscDisplayAttributes {
onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscGlobalSetSkill)))] call FUNC(zeusAttributes));
onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscGlobalSetSkill)))] call FUNC(zeusAttributes));
class Controls: Controls {
class Background: Background {};
class Title: Title {};
class Content: Content {
class Controls {
class globalSetSkill: RscControlsGroupNoScrollbars {
onSetFocus = QUOTE(_this call FUNC(ui_globalSetSkill));
idc = 26422;
x = 0;
y = 0;
w = W_PART(26);
h = H_PART(6.5);
class controls {
class Title1: RscText {
idc = -1;
text = "Skill: General";
toolTip = "Global AI Set Skill: general,commanding,courage";
x = 0;
y = 0;
w = W_PART(10);
h = H_PART(1);
colorBackground[] = {0,0,0,0.5};
};
class Value1: RscXSliderH {
idc = 16184;
x = W_PART(10.1);
y = 0;
w = W_PART(15.9);
h = H_PART(1);
};
class Title2: Title1 {
idc = -1;
text = "Skill: aimingAccuracy";
toolTip = "Global AI Set Skill: aimingAccuracy";
y = H_PART(1.1);
};
class Value2: Value1 {
idc = 16185;
y = H_PART(1.1);
};
class Title3: Title1 {
idc = -1;
text = "Skill: weaponHandling";
toolTip = "Global AI Set Skill: aimingShake,aimingSpeed,reloadSpeed";
y = H_PART(2.2);
};
class Value3: Value1 {
idc = 16186;
y = H_PART(2.2);
};
class Title4: Title1 {
idc = -1;
text = "Skill: spotting";
toolTip = "Global AI Set Skill: spotDistance,spotTime";
y = H_PART(3.3);
};
class Value4: Value1 {
idc = 16187;
y = H_PART(3.3);
};
class Title5: Title1 {
idc = -1;
text = "Seek Cover";
toolTip = "Global AI Set Skill: AI Seek Cover";
y = H_PART(4.4);
};
class Value5: RscCheckBox {
idc = 16188;
x = W_PART(10.1);
y = H_PART(4.4);
w = W_PART(1);
h = H_PART(1);
};
class Title6: Title5 {
idc = -1;
text = "AUTOCOMBAT";
toolTip = "Global AI Set Skill: Ai Switch To Combat Mode";
y = H_PART(5.5);
};
class Value6: Value5 {
idc = 16189;
y = H_PART(5.5);
};
};
};
};
};
class ButtonOK: ButtonOK {};
class ButtonCancel: ButtonCancel {};
};
};
class GVAR(cargoAttribute): RscControlsGroupNoScrollbars {
onSetFocus = QUOTE(_this call FUNC(ui_vehCargo));
idc = 80085;
x = X_PART(7);
y = Y_PART(10);
w = W_PART(26);
h = H_PART(3);
class controls {
class Title: RscText {
idc = -1;
text = "Cargo:";
x = 0;
y = 0;
w = W_PART(10);
h = H_PART(3);
colorBackground[] = {0,0,0,0.5};
};
class Background: RscText {
idc = -1;
x = W_PART(10);
y = 0;
w = W_PART(16);
h = H_PART(2.5);
colorBackground[] = {1,1,1,0.1};
};
class Cargo: RscListBox {
idc = 80086;
x = W_PART(10);
y = 0;
w = W_PART(16);
h = H_PART(3);
};
};
};
class RscDisplayAttributesVehicle: RscDisplayAttributes {
class Controls: Controls {
class Content: Content {
class Controls: controls {
class Cargo: GVAR(cargoAttribute) { };
};
};
};
};