1
0
mirror of https://github.com/acemod/ACE3.git synced 2024-08-30 18:23:18 +00:00
ACE3/addons/markers/functions/fnc_onLBSelChangedShape.sqf
PabstMirror b6aaba7f90 Integrate 1.60 marker shape color map interface ()
1.60 adds ability to set color and marker type from the map interface
Luckily they use the same values and indexes as ACE,
This PR connects the two systems,
Selecting a color from the 1.60 map display will set the color in the
ace marker display and vice versa
2016-06-02 09:28:52 -05:00

41 lines
1.0 KiB
Plaintext

/*
* Author: commy2
* When the shape list box is changed.
*
* Arguments:
* 0: Shape ListBox (idc 1210) <CONTROL>
* 1: Selected Index <NUMBER>
*
* Return Value:
* None
*
* Example:
* [ColorLB, 5] call ace_markers_fnc_onLBSelChangedShape;
*
* Public: No
*/
#include "script_component.hpp"
params ["_ctrl", "_index"];
TRACE_2("params",_ctrl,_index);
private _data = _ctrl lbValue _index;
GVAR(curSelMarkerShape) = _index;
private _config = (configFile >> "CfgMarkers") select _data;
GVAR(currentMarkerConfigName) = configName _config;
//Set map display to same shape:
private _bisShapeLB = switch (false) do {
case (isNull findDisplay 12): {(findDisplay 12) displayCtrl 1091};
case (isNull findDisplay 52): {(findDisplay 52) displayCtrl 1091};
case (isNull findDisplay 53): {(findDisplay 53) displayCtrl 1091};
case (isNull findDisplay 37): {(findDisplay 37) displayCtrl 1091};
default {controlNull};
};
if (_ctrl != _bisShapeLB) then { //Don't set what we got a EH from
_bisShapeLB lbSetCurSel GVAR(curSelMarkerShape);
};