initial files
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
#include "script_components.hpp"
|
||||
/*
|
||||
File: fn_overlayUpdateResources.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2020-05-01
|
||||
Last Update: 2020-08-25
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
Update resources overlay.
|
||||
|
||||
Parameter(s):
|
||||
_overlay - Overlay display [DISPLAY, defaults to displayNull]
|
||||
_show - Should the resources controls be shown [BOOL, defaults to true]
|
||||
_updateValues - Should values controls be updated with data [BOOL, defaults to true]
|
||||
_resourceArea - Name of resource area to be shown [STRING, defaults ""]
|
||||
|
||||
Returns:
|
||||
Resources overlay visible [BOOL]
|
||||
*/
|
||||
|
||||
params [
|
||||
["_overlay", displayNull, [displayNull]],
|
||||
["_show", true, [true]],
|
||||
["_updateValues", true, [true]],
|
||||
["_resourceArea", "", [""]]
|
||||
];
|
||||
|
||||
if (isNull _overlay) exitWith {
|
||||
["Null overlay given"] call BIS_fnc_error;
|
||||
false
|
||||
};
|
||||
if (!_show) exitWith {
|
||||
{
|
||||
(_overlay displayCtrl _x) ctrlShow false;
|
||||
} forEach OVERLAY_RSC_IDCS;
|
||||
false
|
||||
};
|
||||
|
||||
if (_updateValues) then {
|
||||
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_FOB) ctrlSetText toUpper (_resourceArea select [4]);
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_SUPPLIES) ctrlSetText str floor KP_liberation_supplies;
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_AMMO) ctrlSetText str floor KP_liberation_ammo;
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_FUEL) ctrlSetText str floor KP_liberation_fuel;
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_UNITCAP) ctrlSetText ([unitcap, "/", [] call KPLIB_fnc_getLocalCap] joinString "");
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_HELIPAD) ctrlSetText ([KP_liberation_heli_count, "/", KP_liberation_heli_slots] joinString "");
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_PLANE) ctrlSetText ([KP_liberation_plane_count, "/", KP_liberation_plane_slots] joinString "");
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_ALERT) ctrlSetText ([round combat_readiness, "%"] joinString "");
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_CIVREP) ctrlSetText ([KP_liberation_civ_rep,"%"] joinString "");
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_INTEL) ctrlSetText str round resources_intel;
|
||||
|
||||
private _color_readiness = [0.8,0.8,0.8,1];
|
||||
if (combat_readiness >= 25) then {_color_readiness = [0.8,0.8,0,1]};
|
||||
if (combat_readiness >= 50) then {_color_readiness = [0.8,0.6,0,1]};
|
||||
if (combat_readiness >= 75) then {_color_readiness = [0.8,0.3,0,1]};
|
||||
if (combat_readiness >= 100) then {_color_readiness = [0.8,0,0,1]};
|
||||
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_PIC_ALERT) ctrlSetTextColor _color_readiness;
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_ALERT) ctrlSetTextColor _color_readiness;
|
||||
|
||||
private _color_reputation = [0.8,0.8,0.8,1];
|
||||
if (KP_liberation_civ_rep >= 25) then {_color_reputation = [0,0.7,0,1]};
|
||||
if (KP_liberation_civ_rep <= -25) then {_color_reputation = [0.7,0,0,1]};
|
||||
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_PIC_CIVREP) ctrlSetTextColor _color_reputation;
|
||||
(_overlay displayCtrl IDC_OVERLAY_RSC_LABEL_CIVREP) ctrlSetTextColor _color_reputation;
|
||||
|
||||
};
|
||||
|
||||
{
|
||||
(_overlay displayCtrl _x) ctrlShow true;
|
||||
} forEach OVERLAY_RSC_IDCS;
|
||||
|
||||
true
|
||||
78
kp_liberation.brf_sumava/functions/ui/script_components.hpp
Normal file
78
kp_liberation.brf_sumava/functions/ui/script_components.hpp
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_BG 758001
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_FOB 758002
|
||||
#define IDC_OVERLAY_RSC_PIC_FOB_SHADOW 758003
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_SUPPLIES 758005
|
||||
#define IDC_OVERLAY_RSC_PIC_SUPPLIES_SHADOW 758006
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_AMMO 758008
|
||||
#define IDC_OVERLAY_RSC_PIC_AMMO_SHADOW 758009
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_FUEL 758011
|
||||
#define IDC_OVERLAY_RSC_PIC_FUEL_SHADOW 758012
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_UNITCAP 758014
|
||||
#define IDC_OVERLAY_RSC_PIC_UNITCAP_SHADOW 758015
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_HELIPAD 758017
|
||||
#define IDC_OVERLAY_RSC_PIC_HELIPAD_SHADOW 758018
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_PLANE 758020
|
||||
#define IDC_OVERLAY_RSC_PIC_PLANE_SHADOW 758021
|
||||
|
||||
// Combat readiness / enemy altertness
|
||||
#define IDC_OVERLAY_RSC_PIC_ALERT 758023
|
||||
#define IDC_OVERLAY_RSC_PIC_ALERT_SHADOW 758024
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_CIVREP 758026
|
||||
#define IDC_OVERLAY_RSC_PIC_CIVREP_SHADOW 758027
|
||||
|
||||
#define IDC_OVERLAY_RSC_PIC_INTEL 758029
|
||||
#define IDC_OVERLAY_RSC_PIC_INTEL_SHADOW 758030
|
||||
|
||||
#define IDC_OVERLAY_RSC_LABEL_FOB 758004
|
||||
#define IDC_OVERLAY_RSC_LABEL_SUPPLIES 758007
|
||||
#define IDC_OVERLAY_RSC_LABEL_AMMO 758010
|
||||
#define IDC_OVERLAY_RSC_LABEL_FUEL 758013
|
||||
#define IDC_OVERLAY_RSC_LABEL_UNITCAP 758016
|
||||
#define IDC_OVERLAY_RSC_LABEL_HELIPAD 758019
|
||||
#define IDC_OVERLAY_RSC_LABEL_PLANE 758022
|
||||
#define IDC_OVERLAY_RSC_LABEL_ALERT 758025
|
||||
#define IDC_OVERLAY_RSC_LABEL_CIVREP 758028
|
||||
#define IDC_OVERLAY_RSC_LABEL_INTEL 758031
|
||||
|
||||
#define OVERLAY_RSC_IDCS [\
|
||||
IDC_OVERLAY_RSC_PIC_BG,\
|
||||
IDC_OVERLAY_RSC_PIC_FOB,\
|
||||
IDC_OVERLAY_RSC_PIC_FOB_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_FOB,\
|
||||
IDC_OVERLAY_RSC_PIC_SUPPLIES,\
|
||||
IDC_OVERLAY_RSC_PIC_SUPPLIES_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_SUPPLIES,\
|
||||
IDC_OVERLAY_RSC_PIC_AMMO,\
|
||||
IDC_OVERLAY_RSC_PIC_AMMO_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_AMMO,\
|
||||
IDC_OVERLAY_RSC_PIC_FUEL,\
|
||||
IDC_OVERLAY_RSC_PIC_FUEL_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_FUEL,\
|
||||
IDC_OVERLAY_RSC_PIC_UNITCAP,\
|
||||
IDC_OVERLAY_RSC_PIC_UNITCAP_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_UNITCAP,\
|
||||
IDC_OVERLAY_RSC_PIC_HELIPAD,\
|
||||
IDC_OVERLAY_RSC_PIC_HELIPAD_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_HELIPAD,\
|
||||
IDC_OVERLAY_RSC_PIC_PLANE,\
|
||||
IDC_OVERLAY_RSC_PIC_PLANE_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_PLANE,\
|
||||
IDC_OVERLAY_RSC_PIC_ALERT,\
|
||||
IDC_OVERLAY_RSC_PIC_ALERT_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_ALERT,\
|
||||
IDC_OVERLAY_RSC_PIC_CIVREP,\
|
||||
IDC_OVERLAY_RSC_PIC_CIVREP_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_CIVREP,\
|
||||
IDC_OVERLAY_RSC_PIC_INTEL,\
|
||||
IDC_OVERLAY_RSC_PIC_INTEL_SHADOW,\
|
||||
IDC_OVERLAY_RSC_LABEL_INTEL\
|
||||
]
|
||||
Reference in New Issue
Block a user