Skip to content

Commit

Permalink
Improve selective UI API (#3805)
Browse files Browse the repository at this point in the history
* Improve selective UI API, Disable ammo count when reload component is loaded, Fix stance UI

* Upgrade Selective UI framework for controls that share IDCs for gunner and soldier

* Separate more soldier and gunner settings sharing same IDCs, Remove vehicle gunner weapon which has no effect anymore

* Separate more soldier and gunner IDC sharing elements, Fix typo, Fix API setting not being respected in case where selective type is not the same on load

* Rework Selective UI using ACE_UI config, Cleanup, Add ACE_UI to FCS component to mark it (is already disabled due to other necessary settings for FCS to function)

* Do location check in function, Rename condition to location, change to number

* Use macros in ACE_UI location
  • Loading branch information
jonpas committed Jun 2, 2016
1 parent 5c7148d commit 4c995d4
Show file tree
Hide file tree
Showing 18 changed files with 496 additions and 129 deletions.
4 changes: 4 additions & 0 deletions addons/common/RscInfoType.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ class RscInGameUI {
class RscStaminaBar {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]);
};

class RscStanceInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Stance')])] call FUNC(localEvent););
};
};
7 changes: 7 additions & 0 deletions addons/fcs/ACE_UI.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ACE_UI {
class gunnerZeroing {
class conditions {
ADDON = "false";
};
};
};
1 change: 1 addition & 0 deletions addons/fcs/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class CfgPatches {
};

#include "CfgEventHandlers.hpp"
#include "ACE_UI.hpp"

#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
Expand Down
7 changes: 7 additions & 0 deletions addons/reload/ACE_UI.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ACE_UI {
class ammoCount {
class conditions {
ADDON = "false";
};
};
};
5 changes: 1 addition & 4 deletions addons/reload/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ class CfgPatches {
};

#include "CfgVehicles.hpp"

#include "CfgMagazines.hpp"

#include "CfgEventHandlers.hpp"

#include "CfgActions.hpp"

#include "ACE_Settings.hpp"
#include "ACE_UI.hpp"
2 changes: 1 addition & 1 deletion addons/reload/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
#define DEBUG_SETTINGS DEBUG_ENABLED_RELOAD
#endif

#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
102 changes: 85 additions & 17 deletions addons/ui/ACE_Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ACE_Settings {
};

// ADVANCED
// Upper Weapon Info
// Soldier
class GVAR(weaponName) {
category = CSTRING(Category);
displayName = CSTRING(WeaponName);
Expand All @@ -70,8 +70,6 @@ class ACE_Settings {
value = 1;
isClientSettable = 1;
};

// Lower Weapon Info
class GVAR(ammoType) {
category = CSTRING(Category);
displayName = CSTRING(AmmoType);
Expand All @@ -85,7 +83,7 @@ class ACE_Settings {
displayName = CSTRING(AmmoCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 0;
value = 1;
isClientSettable = 1;
};
class GVAR(magCount) {
Expand Down Expand Up @@ -122,14 +120,12 @@ class ACE_Settings {
};
class GVAR(weaponLowerInfoBackground) {
category = CSTRING(Category);
displayName = CSTRING(WeaponLowerInfoBackground); //todo
displayName = CSTRING(WeaponLowerInfoBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};

// Stance
class GVAR(stance) {
category = CSTRING(Category);
displayName = CSTRING(Stance);
Expand All @@ -138,8 +134,6 @@ class ACE_Settings {
value = 1;
isClientSettable = 1;
};

// Stamina Bar
class GVAR(staminaBar) {
category = CSTRING(Category);
displayName = CSTRING(StaminaBar);
Expand All @@ -149,6 +143,88 @@ class ACE_Settings {
isClientSettable = 1;
};

// Gunner
class GVAR(gunnerWeaponName) {
category = CSTRING(Category);
displayName = CSTRING(GunnerWeaponName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerWeaponNameBackground) {
category = CSTRING(Category);
displayName = CSTRING(GunnerWeaponNameBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerFiringMode) {
category = CSTRING(Category);
displayName = CSTRING(GunnerFiringMode);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerAmmoType) {
category = CSTRING(Category);
displayName = CSTRING(GunnerAmmoType);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerAmmoCount) {
category = CSTRING(Category);
displayName = CSTRING(GunnerAmmoCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerMagCount) {
category = CSTRING(Category);
displayName = CSTRING(GunnerMagCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerLaunchableName) {
category = CSTRING(Category);
displayName = CSTRING(gunnerLaunchableName);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerLaunchableCount) {
category = CSTRING(Category);
displayName = CSTRING(gunnerLaunchableCount);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerZeroing) {
category = CSTRING(Category);
displayName = CSTRING(GunnerZeroing);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
class GVAR(gunnerWeaponLowerInfoBackground) {
category = CSTRING(Category);
displayName = CSTRING(GunnerWeaponLowerInfoBackground);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};

// Vehicle
class GVAR(vehicleName) {
category = CSTRING(Category);
Expand Down Expand Up @@ -206,12 +282,4 @@ class ACE_Settings {
value = 1;
isClientSettable = 1;
};
class GVAR(vehicleGunnerWeapon) {
category = CSTRING(Category);
displayName = CSTRING(VehicleGunnerWeapon);
description = CSTRING(RequiresSoldierVehicleWeaponInfo);
typeName = "BOOL";
value = 1;
isClientSettable = 1;
};
};
180 changes: 180 additions & 0 deletions addons/ui/ACE_UI.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
#define ANYWHERE 0
#define GROUND_ONLY 1
#define VEHICLE_ONLY 2

class ACE_UI {
class weaponName {
idd = 300;
elements[] = {118};
location = GROUND_ONLY;
class conditions {};
};
class weaponNameBackground {
idd = 300;
elements[] = {1001, 1008};
location = GROUND_ONLY;
class conditions {};
};
class firingMode {
idd = 300;
elements[] = {187, 1203};
location = GROUND_ONLY;
class conditions {};
};
class ammoType {
idd = 300;
elements[] = {155};
location = GROUND_ONLY;
class conditions {};
};
class ammoCount {
idd = 300;
elements[] = {184};
location = GROUND_ONLY;
class conditions {};
};
class magCount {
idd = 300;
elements[] = {185};
location = GROUND_ONLY;
class conditions {};
};
class throwableName {
idd = 300;
elements[] = {152};
location = GROUND_ONLY;
class conditions {};
};
class throwableCount {
idd = 300;
elements[] = {151};
location = GROUND_ONLY;
class conditions {};
};
class zeroing {
idd = 300;
elements[] = {168};
location = GROUND_ONLY;
class conditions {};
};
class weaponLowerInfoBackground {
idd = 300;
elements[] = {1202};
location = GROUND_ONLY;
class conditions {};
};
class staminaBar {
idd = 305;
elements[] = {193};
location = GROUND_ONLY;
class conditions {};
};
class stance {
idd = 303;
elements[] = {188, 1201};
location = GROUND_ONLY;
class conditions {};
};
class gunnerWeaponName {
idd = 300;
elements[] = {118};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerWeaponNameBackground {
idd = 300;
elements[] = {1001, 1008};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerFiringMode {
idd = 300;
elements[] = {187, 1203};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerAmmoType {
idd = 300;
elements[] = {155};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerAmmoCount {
idd = 300;
elements[] = {184};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerMagCount {
idd = 300;
elements[] = {185};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerLaunchableName {
idd = 300;
elements[] = {152};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerLaunchableCount {
idd = 300;
elements[] = {151};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerZeroing {
idd = 300;
elements[] = {168};
location = VEHICLE_ONLY;
class conditions {};
};
class gunnerWeaponLowerInfoBackground {
idd = 300;
elements[] = {1202};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleName {
idd = 300;
elements[] = {120};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleNameBackground {
idd = 300;
elements[] = {1000, 1013};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleFuelBar {
idd = 300;
elements[] = {113, 1202};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleSpeed {
idd = 300;
elements[] = {121, 1004, 1006};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleAltitude {
idd = 300;
elements[] = {122, 1005, 1014};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleDamage {
idd = 300;
elements[] = {111};
location = VEHICLE_ONLY;
class conditions {};
};
class vehicleInfoBackground {
idd = 300;
elements[] = {1200};
location = VEHICLE_ONLY;
class conditions {};
};
};
Loading

0 comments on commit 4c995d4

Please sign in to comment.