mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* 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
57 lines
1.7 KiB
Plaintext
57 lines
1.7 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: PabstMirror
|
|
* Saves the current mode and sets a new mode
|
|
* Used to backup display when switching display modes
|
|
*
|
|
* Arguments:
|
|
* 0: New Mode <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode
|
|
*
|
|
* Public: No
|
|
*/
|
|
params ["_newMode"];
|
|
|
|
disableSerialization;
|
|
private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
|
|
|
if (isNull _display) exitWith {ERROR("No Display");};
|
|
|
|
if (GVAR(currentApplicationPage) == 2) then {
|
|
private _theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture));
|
|
private _mapCtrlPos = ctrlPosition _theMap;
|
|
|
|
_mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"];
|
|
private _centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)];
|
|
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
|
|
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;
|
|
|
|
//Hit button again, toggle map modes:
|
|
if (_newMode == 2) then {
|
|
if (GVAR(mapShowTexture)) then {
|
|
GVAR(mapShowTexture) = false;
|
|
} else {
|
|
if (GVAR(MapDataAvailable) == MAP_DETAIL_SAT) then {
|
|
GVAR(mapShowTexture) = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
//Can't switch to map if no map loaded
|
|
if (_newMode == APP_MODE_MAP) then {
|
|
if (GVAR(MapDataAvailable) == MAP_DETAIL_NONE) then {
|
|
_newMode = -1;
|
|
};
|
|
};
|
|
|
|
if (_newMode != -1) then {
|
|
GVAR(currentApplicationPage) = _newMode;
|
|
[] call FUNC(showApplicationPage);
|
|
};
|