Show Cargo Example

This commit is contained in:
PabstMirror 2016-02-26 01:37:00 -06:00
parent 7fc1c87bc4
commit 424c6fe878
3 changed files with 65 additions and 1 deletions

View File

@ -1,3 +1,4 @@
class RscControlsGroup;
class RscControlsGroupNoScrollbars;
class RscText;
class RscListbox;
@ -9,7 +10,9 @@ class RscDisplayAttributes {
class Controls {
class Background;
class Title;
class Content;
class Content: RscControlsGroup {
class controls;
};
class ButtonOK;
class ButtonCancel;
};
@ -108,3 +111,49 @@ class GVAR(RscDisplayAttributes_globalSetSkill): RscDisplayAttributes {
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

@ -18,3 +18,4 @@ PREP(setSkillsLocal);
PREP(zeus_globalSetSkill);
PREP(zeusAttributes);
PREP(zeusAttributes_globalSetSkill);
PREP(zeusAttributes_vehCargo);

View File

@ -0,0 +1,14 @@
#include "script_component.hpp"
params ["_control"];
TRACE_1("params",_control);
private _veh = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objnull];
TRACE_1("",_veh);
private _loaded = _veh getVariable [QEGVAR(cargo,loaded), []];
TRACE_1("",_loaded);
{
((ctrlParent _control) displayCtrl 80086) lbAdd (str _x);
} forEach _loaded;