ACE3/addons/microdagr/functions/fnc_showApplicationPage.sqf
Dedmen Miller e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00

118 lines
4.9 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: PabstMirror
* Changes the "application page" shown on the microDAGR
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_microdagr_fnc_showApplicationPage
*
* Public: No
*/
disableSerialization;
private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
//TopBar
(_display displayCtrl IDC_RANGEFINDERCONNECTEDICON) ctrlShow (GVAR(currentWaypoint) == -2);
//Mode: Info:
(_display displayCtrl IDC_MODEDISPLAY) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_INFODISPLAY);
if (GVAR(currentApplicationPage) == APP_MODE_INFODISPLAY) then {
(_display displayCtrl IDC_MODEDISPLAY_UTMGRID) ctrlSetText GVAR(mgrsGridZoneDesignator);
if (GVAR(currentWaypoint) == -1) then {
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTIMECG) ctrlShow true;
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTARGETCG) ctrlShow false;
} else {
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTIMECG) ctrlShow false;
(_display displayCtrl IDC_MODEDISPLAY_MODEPOSTARGETCG) ctrlShow true;
if (GVAR(currentWaypoint) == -2) then {
(_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText QUOTE(PATHTOF(images\icon_menuLaser.paa));
} else {
(_display displayCtrl IDC_MODEDISPLAY_TARGETICON) ctrlSetText QPATHTOF(images\icon_menuMark.paa);
};
};
};
//Mode: Compass:
(_display displayCtrl IDC_MODECOMPASS) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_COMPASS);
(_display displayCtrl IDC_MAPCOMPASS) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_COMPASS);
//Mode: Map
(_display displayCtrl IDC_MODEMAP_MAPTRACKBUTTON) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_MAP);
(_display displayCtrl IDC_MODEMAP_MAPZOOMIN) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_MAP);
(_display displayCtrl IDC_MODEMAP_MAPZOOMOUT) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_MAP);
(_display displayCtrl IDC_MAPPLAIN) ctrlShow ((GVAR(currentApplicationPage) == APP_MODE_MAP) && {!GVAR(mapShowTexture)});
(_display displayCtrl IDC_MAPDETAILS) ctrlShow ((GVAR(currentApplicationPage) == APP_MODE_MAP) && {GVAR(mapShowTexture)});
if (GVAR(currentApplicationPage) == APP_MODE_MAP) then {
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
_mapSize = (ctrlPosition _theMap) select 3;
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom) / _mapSize), GVAR(mapPosition)];
ctrlMapAnimCommit _theMap;
if (GVAR(mapAutoTrackPosition)) then {
(_display displayCtrl IDC_MODEMAP_MAPTRACKBUTTON) ctrlSetTextColor [1,1,1,0.8];
} else {
(_display displayCtrl IDC_MODEMAP_MAPTRACKBUTTON) ctrlSetTextColor [1,1,1,0.4];
};
};
//Mode: Menu
(_display displayCtrl IDC_MODEMENU) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_MENU);
//Mode: Mark
if (GVAR(currentApplicationPage) == APP_MODE_MARK) then {
(_display displayCtrl IDC_MODEMARK) ctrlShow true;
//not backed up for displayMode swap, not a big deal
if ((count GVAR(newWaypointPosition)) == 0) then {
(_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText (localize LSTRING(wpEnterCords));
(_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText "";
} else {
(_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText format [(localize LSTRING(wpEnterName)), mapGridPosition GVAR(newWaypointPosition)];
(_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText format ["[%1]", mapGridPosition GVAR(newWaypointPosition)];
};
ctrlSetFocus (_display displayCtrl IDC_MODEMARK_CORDSEDIT);
} else {
(_display displayCtrl IDC_MODEMARK) ctrlShow false;
GVAR(newWaypointPosition) = [];
};
//Mode: Waypoints
(_display displayCtrl IDC_MODEWAYPOINTS) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_WAYPOINTS);
//Mode: Setting
(_display displayCtrl IDC_MODESETTINGS) ctrlShow (GVAR(currentApplicationPage) == APP_MODE_SETUP);
//Buttons pushed:
if (GVAR(currentApplicationPage) == APP_MODE_INFODISPLAY) then {
(_display displayCtrl IDC_BUTTONBG0) ctrlSetText QPATHTOF(images\button_pushedDown.paa);
} else {
(_display displayCtrl IDC_BUTTONBG0) ctrlSetText QPATHTOF(images\button_pushedUp.paa);
};
if (GVAR(currentApplicationPage) == APP_MODE_COMPASS) then {
(_display displayCtrl IDC_BUTTONBG1) ctrlSetText QPATHTOF(images\button_pushedDown.paa);
} else {
(_display displayCtrl IDC_BUTTONBG1) ctrlSetText QPATHTOF(images\button_pushedUp.paa);
};
if (GVAR(currentApplicationPage) == APP_MODE_MAP) then {
(_display displayCtrl IDC_BUTTONBG2) ctrlSetText QPATHTOF(images\button_pushedDown.paa);
} else {
(_display displayCtrl IDC_BUTTONBG2) ctrlSetText QPATHTOF(images\button_pushedUp.paa);
};
//Update the page now:
[] call FUNC(updateDisplay);