Skip to content

Commit e91e463

Browse files
blackfischDomT602BoGuu
authored
vehicle sell confirmation (#634)
* add confirmation to vehicle selling * spawn because of scheduled * Travis? * Apply closeDialog suggestions from code review Co-Authored-By: Ollie W <boguug@gmail.com> Co-authored-by: DomT602 <32492434+DomT602@users.noreply.github.com> Co-authored-by: Ollie W <boguug@gmail.com>
1 parent fee7a31 commit e91e463

3 files changed

Lines changed: 38 additions & 4 deletions

File tree

Altis_Life.Altis/dialog/function/fn_sellGarage.sqf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ _sellPrice = _purchasePrice * _multiplier;
4646

4747
if (!(_sellPrice isEqualType 0) || _sellPrice < 1) then {_sellPrice = 500;};
4848

49+
closeDialog 0;
50+
private _action = [
51+
format[localize "STR_Garage_SellWarn", getText(configFile >> "CfgVehicles" >> _vehicle >> "displayName"), [_sellPrice] call life_fnc_numberText],
52+
localize "STR_Garage_SellWarnTitle",
53+
localize "STR_Global_Yes",
54+
localize "STR_Global_No"
55+
] call BIS_fnc_guiMessage;
56+
57+
if !(_action) exitWith {};
58+
4959
if (life_HC_isActive) then {
5060
[_vid,_pid,_sellPrice,player,life_garage_type] remoteExecCall ["HC_fnc_vehicleDelete",HC_Life];
5161
} else {
@@ -66,4 +76,4 @@ if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then {
6676
};
6777

6878
life_action_delay = time;
69-
closeDialog 0;
79+
closeDialog 0;

Altis_Life.Altis/dialog/impound.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Life_impound_menu {
7676
class SellCar: Life_RscButtonMenu {
7777
idc = -1;
7878
text = "$STR_Global_Sell";
79-
onButtonClick = "[] call life_fnc_sellGarage; closeDialog 0;";
79+
onButtonClick = "closeDialog 0; [] spawn life_fnc_sellGarage;";
8080
x = 0.26 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
8181
y = 0.9 - (1 / 25);
8282
w = (6.25 / 40);
@@ -126,4 +126,4 @@ class Life_impound_menu {
126126
h = (1 / 15);
127127
};
128128
};
129-
};
129+
};

Altis_Life.Altis/stringtable.xml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,30 @@
26262626
<Polish>Nie ma pojazdu w pobliżu NPC</Polish>
26272627
<Chinesesimp>NPC附近没有载具。</Chinesesimp>
26282628
</Key>
2629+
<Key ID="STR_Garage_SellWarn">
2630+
<Original>Are you sure you want to sell your %1 for $%2?</Original>
2631+
<Czech>Opravdu chcete prodat svůj %1 za $%2?</Czech>
2632+
<Spanish>¿Estás seguro de que quieres vender tu %1 por $%2?</Spanish>
2633+
<Russian>Вы уверены, что хотите продать свой %1 за $%2?</Russian>
2634+
<German>Bist du sicher, dass du deine(n) %1 für $%2 verkaufen möchtest?</German>
2635+
<French>Êtes-vous sûr de vouloir vendre votre %1 pour $%2 ?</French>
2636+
<Italian>Siete sicuri di voler vendere la vostra %1 per $%2?</Italian>
2637+
<Portuguese>Tem a certeza que quer vender a sua %1 por $%2?</Portuguese>
2638+
<Polish>Jesteś pewien, że chcesz sprzedać swój %1 za $%2?</Polish>
2639+
<Chinesesimp>你确定要把你的%1卖给%2?</Chinesesimp>
2640+
</Key>
2641+
<Key ID="STR_Garage_SellWarnTitle">
2642+
<Original>Sell vehicle</Original>
2643+
<Czech>Prodat vozidlo</Czech>
2644+
<Spanish>Vender el vehículo</Spanish>
2645+
<Russian>Продать автомобиль</Russian>
2646+
<German>Fahrzeug verkaufen</German>
2647+
<French>Vendre un véhicule</French>
2648+
<Italian>Vendere il veicolo</Italian>
2649+
<Portuguese>Vender veículo</Portuguese>
2650+
<Polish>Sprzedaj pojazd</Polish>
2651+
<Chinesesimp>出售车辆</Chinesesimp>
2652+
</Key>
26292653
</Package>
26302654
<Package name="Key_Chain">
26312655
<Key ID="STR_Keys_Title">
@@ -13391,4 +13415,4 @@
1339113415
<Chinesesimp>%1 - %2 将 $%3 存进他们的银行账户。银行存款余额:$%4 手上现金:$%5</Chinesesimp>
1339213416
</Key>
1339313417
</Package>
13394-
</Project>
13418+
</Project>

0 commit comments

Comments
 (0)