Skip to content

Commit

Permalink
Reverse close/spawn order in houseMenu
Browse files Browse the repository at this point in the history
Attempt to address #584 #585
  • Loading branch information
BoGuu authored Dec 25, 2019
1 parent ba41b90 commit 9d4ee25
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions Altis_Life.Altis/core/housing/fn_houseMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ if (_curTarget isKindOf "House_F" && playerSide isEqualTo west) exitWith {
if ((nearestObject [_pos,"Land_Dome_Big_F"]) isEqualTo _curTarget || (nearestObject [_pos,_vaultHouse]) isEqualTo _curTarget) then {

_Btn1 ctrlSetText localize "STR_pInAct_Repair";
_Btn1 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_repairDoor; closeDialog 0;";
_Btn1 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_repairDoor;";
_Btn1 ctrlShow true;

_Btn2 ctrlSetText localize "STR_pInAct_CloseOpen";
_Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_doorAnimate; closeDialog 0;";
_Btn2 buttonSetAction "closeDialog 0; [life_pInact_curTarget] call life_fnc_doorAnimate;";
_Btn2 ctrlShow true;

} else {
Expand All @@ -68,19 +68,19 @@ if (_curTarget isKindOf "House_F" && playerSide isEqualTo west) exitWith {
_Btn1 ctrlShow true;

_Btn2 ctrlSetText localize "STR_pInAct_BreakDown";
_Btn2 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_copBreakDoor; closeDialog 0;";
_Btn2 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_copBreakDoor;";
_Btn2 ctrlShow true;

_Btn3 ctrlSetText localize "STR_pInAct_SearchHouse";
_Btn3 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_raidHouse; closeDialog 0;";
_Btn3 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_raidHouse;";
_Btn3 ctrlShow true;

if (player distance _curTarget > 3.6) then {
_Btn3 ctrlEnable false;
};

_Btn4 ctrlSetText localize "STR_pInAct_LockHouse";
_Btn4 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_lockupHouse; closeDialog 0;";
_Btn4 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_lockupHouse;";
_Btn4 ctrlShow true;
} else {
closeDialog 0;
Expand All @@ -96,7 +96,7 @@ if (!(_curTarget in life_vehicles) || isNil {_curTarget getVariable "house_owner
] select _isHouse;

_Btn1 ctrlSetText localize _buildingPurchaseString;
_Btn1 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_buyHouse; closeDialog 0";
_Btn1 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_buyHouse;";
_Btn1 ctrlShow true;

if (!isNil {_curTarget getVariable "house_owner"}) then {
Expand All @@ -114,23 +114,23 @@ if (!(_curTarget in life_vehicles) || isNil {_curTarget getVariable "house_owner
} else {
if (isClass (missionConfigFile >> "Garages" >> worldName >> (typeOf _curTarget))) then {
_Btn1 ctrlSetText localize "STR_pInAct_SellGarage";
_Btn1 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_sellHouse; closeDialog 0;";
_Btn1 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_sellHouse;";
_Btn1 ctrlShow true;

if !(((_curTarget getVariable "house_owner") select 0) isEqualTo getPlayerUID player) then {
_Btn1 ctrlEnable false;
};

_Btn2 ctrlSetText localize "STR_pInAct_AccessGarage";
_Btn2 buttonSetAction "[life_pInact_curTarget,""Car""] spawn life_fnc_vehicleGarage; closeDialog 0;";
_Btn2 buttonSetAction "closeDialog 0; [life_pInact_curTarget,""Car""] spawn life_fnc_vehicleGarage;";
_Btn2 ctrlShow true;

_Btn3 ctrlSetText localize "STR_pInAct_StoreVeh";
_Btn3 buttonSetAction "[life_pInact_curTarget,player] spawn life_fnc_storeVehicle; closeDialog 0;";
_Btn3 buttonSetAction "closeDialog 0; [life_pInact_curTarget,player] spawn life_fnc_storeVehicle;";
_Btn3 ctrlShow true;
} else {
_Btn1 ctrlSetText localize "STR_pInAct_SellHouse";
_Btn1 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_sellHouse; closeDialog 0;";
_Btn1 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_sellHouse;";
_Btn1 ctrlShow true;

if (((_curTarget getVariable "house_owner") select 0) != (getPlayerUID player)) then {
Expand All @@ -142,37 +142,37 @@ if (!(_curTarget in life_vehicles) || isNil {_curTarget getVariable "house_owner
} else {
_Btn2 ctrlSetText localize "STR_pInAct_LockStorage";
};
_Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_lockHouse; closeDialog 0;";
_Btn2 buttonSetAction "closeDialog 0; [life_pInact_curTarget] call life_fnc_lockHouse;";
_Btn2 ctrlShow true;

if (isNull (_curTarget getVariable ["lightSource",objNull])) then {
_Btn3 ctrlSetText localize "STR_pInAct_LightsOn";
} else {
_Btn3 ctrlSetText localize "STR_pInAct_LightsOff";
};
_Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_lightHouseAction; closeDialog 0;";
_Btn3 buttonSetAction "closeDialog 0; [life_pInact_curTarget] call life_fnc_lightHouseAction;";
_Btn3 ctrlShow true;

if (getNumber (missionConfigFile >> "Housing" >> worldName >> (typeOf _curTarget) >> "canGarage") isEqualTo 1 && {!(_curTarget getVariable ["blacklistedGarage",false])}) then {
if (_curTarget getVariable ["garageBought",false]) then {
_Btn4 ctrlSetText localize "STR_pInAct_SellGarage";
_Btn4 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_sellHouseGarage; closeDialog 0;";
_Btn4 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_sellHouseGarage;";
_Btn4 ctrlShow true;

if (((_curTarget getVariable "house_owner") select 0) != (getPlayerUID player)) then {
_Btn4 ctrlEnable false;
};

_Btn5 ctrlSetText localize "STR_pInAct_AccessGarage";
_Btn5 buttonSetAction "[life_pInact_curTarget,""Car""] spawn life_fnc_vehicleGarage; closeDialog 0;";
_Btn5 buttonSetAction "closeDialog 0; [life_pInact_curTarget,""Car""] spawn life_fnc_vehicleGarage;";
_Btn5 ctrlShow true;

_Btn6 ctrlSetText localize "STR_pInAct_StoreVeh";
_Btn6 buttonSetAction "[life_pInact_curTarget,player] spawn life_fnc_storeVehicle; closeDialog 0;";
_Btn6 buttonSetAction "closeDialog 0; [life_pInact_curTarget,player] spawn life_fnc_storeVehicle;";
_Btn6 ctrlShow true;
} else {
_Btn5 ctrlSetText localize "STR_pInAct_BuyGarage";
_Btn5 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_buyHouseGarage; closeDialog 0;";
_Btn5 buttonSetAction "closeDialog 0; [life_pInact_curTarget] spawn life_fnc_buyHouseGarage;";
};

_Btn5 ctrlShow true;
Expand Down

1 comment on commit 9d4ee25

@TaktischerSpeck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my Tests this did not prevent the speedclicker ^^

Please sign in to comment.