ACE3/addons/pylons/menu.hpp
Ozan Eğitmen 1b86063ade Add Pylons Component (#5517)
* Initial commit

* Change order

* ace-ify functions

* Add function headers, tweak onPylonMirror function

* Finish localization

* Fix trivial idc collision

* Styling

* Add self as author

* Add interaction for the dialog

* Add settings to enable menu and change behaviour

* Add strings

* Move changes into pylons component

* Progress

* Only one function left!

* Fix issues with overlapping players, Use LINKFUNC

* Add progress bar

* I need to switch branches

* Remove old pylon weapons from aircraft

* Explicitly set new pylon's ammo to 0

* Replace magic numbers with ID list

* Align controls properly

* Remove space before eol

* Add ability to add/remove FRIES

* 🐛 Whoops

* Fix logic errors

* Value of 1 means helicopter has built-in FRIES

* Add pilot/gunner switch button

Working on those buttons also helped me improve both the static and
on-the-fly (pun intended) parts of the dialog.

* Add quick zeus module

* Add a way to retrieve scripted pylon turrets

Not entirely reliable, but if used in both rearm and pylons, missions
that only use ace will work perfectly.

* Use getNumber default

* Use common's getPylonTurret

* Make dialog close on apply for zeus

* Handle UI Scaling better

* Prevent progressBar from failing in zeus

* Remove unnecessary stringtable key
2017-10-11 14:05:54 -05:00

159 lines
5.8 KiB
C++

class IGUIBack;
class RscCheckBox;
class RscListBox;
class RscEdit;
class RscButtonMenu;
class RscText;
class RscPictureKeepAspect;
class GVAR(DialogLoadout) {
idd = ID_DIALOG;
name = QGVAR(DialogLoadout);
enableSimulation = 1;
class Controls {
class TextTitlebar: RscText {
idc = ID_TEXT_TITLEBAR;
text = CSTRING(AircraftLoadoutTitle);
x = 0.15835 * safezoneW + safezoneX;
y = 0.262 * safezoneH + safezoneY;
w = 0.68304 * safezoneW;
h = 0.028 * safezoneH;
colorBackground[] = {"(profileNamespace getVariable ['GUI_BCG_RGB_R', 0.13])","(profileNamespace getVariable ['GUI_BCG_RGB_G', 0.54])","(profileNamespace getVariable ['GUI_BCG_RGB_B', 0.21])",1};
};
class BackgroundDialog: IGUIBack {
idc = ID_BACKGROUND_DIALOG;
x = 0.15835 * safezoneW + safezoneX;
y = 0.29 * safezoneH + safezoneY;
w = 0.68304 * safezoneW;
h = 0.448 * safezoneH;
colorBackground[] = {0,0,0,0.3};
};
class BackgroundPicture: IGUIBack {
idc = ID_BACKGROUND_PICTURE;
x = 0.171616 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.440035 * safezoneW;
h = 0.392 * safezoneH;
colorBackground[] = {0.3,0.3,0.3,1};
};
class PictureAircraft: RscPictureKeepAspect {
idc = ID_PICTURE_AIRCRAFT;
x = 0.171616 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.440035 * safezoneW;
h = 0.392 * safezoneH;
};
class CheckboxMirror: RscCheckBox {
idc = ID_CHECKBOX_MIRROR;
x = 0.171616 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.0165 * safezoneW;
h = 0.028 * safezoneH;
};
class TextMirror: RscText {
idc = ID_TEXT_MIRROR;
text = "$STR_3DEN_Object_Attribute_PylonsMirror_displayName";
tooltip="$STR_3DEN_Object_Attribute_PylonsMirror_tooltip";
x = 0.188116 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.0656768 * safezoneW;
h = 0.028 * safezoneH;
colorBackground[] = {0,0,0,0.5};
};
class CheckboxFRIES: RscCheckBox {
idc = ID_CHECKBOX_FRIES;
x = 0.171616 * safezoneW + safezoneX;
y = 0.346 * safezoneH + safezoneY;
w = 0.0165 * safezoneW;
h = 0.028 * safezoneH;
};
class TextFRIES: RscText {
idc = ID_TEXT_FRIES;
text = "FRIES";
x = 0.188116 * safezoneW + safezoneX;
y = 0.346 * safezoneH + safezoneY;
w = 0.0656768 * safezoneW;
h = 0.028 * safezoneH;
colorBackground[] = {0,0,0,0.5};
};
class TextListTitle: RscText {
idc = ID_TEXT_LISTTITLE;
x = 0.624786 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.203437 * safezoneW;
h = 0.028 * safezoneH;
colorBackground[] = {0,0,0,0.5};
};
class ListLoadouts: RscListBox {
idc = ID_LIST_LOADOUTS;
x = 0.624786 * safezoneW + safezoneX;
y = 0.346 * safezoneH + safezoneY;
w = 0.203437 * safezoneW;
h = 0.294 * safezoneH;
};
class EditLoadoutName: RscEdit {
idc = ID_EDIT_LOADOUTNAME;
x = 0.624786 * safezoneW + safezoneX;
y = 0.64 * safezoneH + safezoneY;
w = 0.203437 * safezoneW;
h = 0.028 * safezoneH;
colorBackground[] = {0,0,0,0.7};
};
class ButtonSave: RscButtonMenu {
idc = ID_BUTTON_SAVE;
action = QUOTE(call FUNC(onButtonSave));
text = "$STR_disp_int_save";
x = 0.624786 * safezoneW + safezoneX;
y = 0.682 * safezoneH + safezoneY;
w = 0.0590625 * safezoneW;
h = 0.028 * safezoneH;
};
class ButtonLoad: RscButtonMenu {
idc = ID_BUTTON_LOAD;
action = QUOTE(call FUNC(onButtonLoad));
text = "$STR_disp_int_load";
x = 0.69703 * safezoneW + safezoneX;
y = 0.682 * safezoneH + safezoneY;
w = 0.0590625 * safezoneW;
h = 0.028 * safezoneH;
};
class ButtonDelete: RscButtonMenu {
idc = ID_BUTTON_DELETE;
action = QUOTE(call FUNC(onButtonDelete));
text = "$STR_disp_delete";
x = 0.769275 * safezoneW + safezoneX;
y = 0.682 * safezoneH + safezoneY;
w = 0.0590625 * safezoneW;
h = 0.028 * safezoneH;
};
class ButtonApply: RscButtonMenu {
idc = ID_BUTTON_APPLY;
action = QUOTE(call FUNC(onButtonApply));
text = "$STR_ui_debug_but_apply";
x = 0.683895 * safezoneW + safezoneX;
y = 0.738 * safezoneH + safezoneY;
w = 0.0721875 * safezoneW;
h = 0.028 * safezoneH;
};
class ButtonClose: RscButtonMenu {
idc = ID_BUTTON_CLOSE;
text = "$STR_disp_cancel";
action = QUOTE(call FUNC(onButtonClose));
x = 0.769275 * safezoneW + safezoneX;
y = 0.738 * safezoneH + safezoneY;
w = 0.0721875 * safezoneW;
h = 0.028 * safezoneH;
};
class TextBanner: RscText {
idc = ID_TEXT_BANNER;
text = CSTRING(BannerText);
x = 0.171616 * safezoneW + safezoneX;
y = 0.738 * safezoneH + safezoneY;
w = 0.440035 * safezoneW;
h = 0.028 * safezoneH;
colorBackground[] = {0.5,0,0,0.5};
};
};
};