Skip to content

Commit

Permalink
Chemical - Fix Zeus module UI + unlocalized string (#366)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
Fix sizing and behaviour of the zeus module UI.
Fix unlocalized string in UI

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.
  • Loading branch information
AtrixZockt authored Jul 10, 2023
1 parent 825ad3b commit a50af85
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addons/chemical/functions/fnc_AttributeRadius.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*
*/


params ["_control"];

private _display = ctrlParent _control;
private _logic = missionNamespace getVariable["BIS_fnc_initCuratorAttributes_target",objNull];
_control ctrlRemoveAllEventHandlers "SetFocus";
Expand All @@ -28,11 +28,11 @@ if!(isNull attachedTo _logic) then {
_sealCheckBox ctrlShow true;
_sealText ctrlShow true;

_placeText ctrlSetText CSTRING(GasModule_createContaminatedObject);
_placeText ctrlSetText LLSTRING(GasModule_createContaminatedObject);
} else {
_sealCheckBox ctrlShow false;
_sealText ctrlShow false;
_placetext ctrlSetText CSTRING(GasModule_createContaminatedZone);
_placetext ctrlSetText LLSTRING(GasModule_createContaminatedZone);
};

private _gasTypeCombo = _display displayCtrl 1615;
Expand Down
18 changes: 15 additions & 3 deletions addons/chemical/functions/fnc_ui_gasModule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
params ["_control"];

private _display = ctrlParent _control;
private _ctrlButtonOK = _display displayCtrl 1;
private _ctrlButtonOK = _display displayCtrl IDC_OK;
private _ctrlButtonCancel = _display displayCtrl IDC_CANCEL;
private _logic = missionNamespace getVariable["BIS_fnc_initCuratorAttributes_target",objNull];


Expand All @@ -28,7 +29,17 @@ _control ctrlRemoveAllEventHandlers "SetFocus";
private _fnc_onUnload = {
private _logic = missionNamespace getVariable["BIS_fnc_initCuratorAttributes_target",objNull];
if (isNull _logic) exitWith {};
if !(isNull attachedTo _logic) then {};
if !(_display getVariable [QGVAR(Confirmed), false]) then
{
if !(isNull attachedTo _logic) then
{
deleteVehicle _logic;
} else
{
detach (attachedTo _logic);
deleteVehicle _logic;
};
};
};

scopeName "Main";
Expand Down Expand Up @@ -85,7 +96,6 @@ private _fnc_onConfirm = {
private _logic = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target",objNull];
if (isNull _logic) exitWith {};


if !(isNull attachedTo _logic) then {
private _object = attachedto _logic;
private _position = getPos _object;
Expand All @@ -100,6 +110,8 @@ private _fnc_onConfirm = {
private _position = getPos _logic;
[_logic,_position,_radius_max,_radius_min,_gastype] call FUNC(gasCheck);
};

_display setVariable [QGVAR(Confirmed), true];
};
};

Expand Down
4 changes: 2 additions & 2 deletions addons/chemical/ui/RscAttributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class GVAR(kat_RscAtributeRadius): RscControlsGroupNoScrollbars {


class GVAR(kat_RscGasModul): RscDisplayAttributes {
onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(kat_RscGasModul))] call FUNC(zeusAttributes));
onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(kat_RscGasModul))] call FUNC(zeusAttributes));
onLoad = QUOTE([ARR_3('onLoad', _this, QQGVAR(kat_RscGasModul))] call EFUNC(zeus,zeusAttributes));
onUnload = QUOTE([ARR_3('onUnload', _this, QQGVAR(kat_RscGasModul))] call EFUNC(zeus,zeusAttributes));

class Controls: Controls {
class Background: Background {};
Expand Down

0 comments on commit a50af85

Please sign in to comment.