ACE3/addons/markers/functions/fnc_onLBSelChangedShape.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

41 lines
1.1 KiB
Plaintext

#include "..\script_component.hpp"
/*
* 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
*/
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 IDC_DIARY_MARKER_ICON};
case (isNull findDisplay 52): {(findDisplay 52) displayCtrl IDC_DIARY_MARKER_ICON};
case (isNull findDisplay 53): {(findDisplay 53) displayCtrl IDC_DIARY_MARKER_ICON};
case (isNull findDisplay 37): {(findDisplay 37) displayCtrl IDC_DIARY_MARKER_ICON};
default {controlNull};
};
if (_ctrl != _bisShapeLB) then { //Don't set what we got a EH from
_bisShapeLB lbSetCurSel GVAR(curSelMarkerShape);
};