From 1d3aaafc618fab6cb516f64a918888ba0eb74c31 Mon Sep 17 00:00:00 2001 From: He-Man Date: Thu, 28 Feb 2019 20:36:58 +0100 Subject: [PATCH] Change License Plates --- .../EPOCH_vehicle_ChangeLicensePlate.sqf | 35 +++++++++++++++++++ .../CfgActionMenu/CfgActionMenu_target.hpp | 7 ++++ .../Configs/CfgClientFunctions.hpp | 1 + 3 files changed, 43 insertions(+) create mode 100644 Sources/epoch_code/compile/vehicles/EPOCH_vehicle_ChangeLicensePlate.sqf diff --git a/Sources/epoch_code/compile/vehicles/EPOCH_vehicle_ChangeLicensePlate.sqf b/Sources/epoch_code/compile/vehicles/EPOCH_vehicle_ChangeLicensePlate.sqf new file mode 100644 index 00000000..a6d99c7d --- /dev/null +++ b/Sources/epoch_code/compile/vehicles/EPOCH_vehicle_ChangeLicensePlate.sqf @@ -0,0 +1,35 @@ +/* + Author: He-Man - EpochMod.com + + Contributors: + + Description: + change license plates from Vehicles + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/vehicles/EPOCH_vehicle_ChangeLicensePlate.sqf +*/ + +private ["_display","_maintxt","_txt","_bottomtxt","_savebutton"]; +params ['_vehicle',['_player',player]]; +if (isnull _vehicle) exitwith {}; +if (_player distance _vehicle > 10) exitwith {}; +if (!alive _vehicle) exitwith {}; +if (!local _vehicle) exitwith { + ['Go in as driver first',5] call Epoch_Message; +}; +Epoch_PlateVehicle = _vehicle; +createdialog 'EPOCH_SimpleInput'; +waituntil {!isnull (finddisplay -1200)}; +disableSerialization; +_display = (finddisplay -1200); +_maintxt = _display displayctrl 20; +_txt = _display displayctrl 23; +_bottomtxt = _display displayctrl 22; +_savebutton = _display displayctrl 30; +_maintxt ctrlSetText (format ['Change Licenseplate for %1',(typeof _vehicle) call Epoch_ItemDisplayName]); +_txt ctrlSetText 'New Plate:'; +_savebutton buttonSetAction 'if (player distance Epoch_PlateVehicle > 10) exitwith {}; Epoch_PlateVehicle setPlateNumber (ctrlText (finddisplay -1200 displayctrl 21)); closedialog 0; Epoch_PlateVehicle call EPOCH_interact; Epoch_PlateVehicle = nil'; diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp index 15591aad..cbceb8c0 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp @@ -530,6 +530,13 @@ class VehMaintanance tooltipcode = "format ['Upgrade to %1 - %2',(Ignatz_VehicleUpgradeArray select 4 select 2),(Ignatz_VehicleUpgradeArray select 4 select 3)]"; }; }; + class ChangePlate + { + condition = "{dyna_cursorTarget iskindof _x} count ['Van_01_base_F','Van_02_base_F','SUV_01_base_F','Hatchback_01_base_F','Offroad_01_base_F','Offroad_02_base_F'] > 0"; + action = "[dyna_cursorTarget,player] spawn EPOCH_vehicle_ChangeLicensePlate"; + icon = "x\addons\a3_epoch_code\Data\UI\buttons\Epoch_LicensePlate.paa"; + tooltip = "Change License Plate"; + }; }; //Groups diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index 54ed9cfa..8e2f9c36 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -192,6 +192,7 @@ class CfgClientFunctions class client_VehicleMaintananceDo {}; class vehicle_checkTurretAmmo {}; class vehicle_removeTurretAmmo {}; + class vehicle_ChangeLicensePlate {}; }; class missions {