Hey liebe NN Community ich habe mich mal mit meinen Kollegen an einen Übrsichtliches Fahrzeug Interactions Menü gesetzt
Dann Fangen wir mal an
Schritt 1. Geht in die core\vehicle\fn_vInteractionMenu.sqf und ersetzt alles durch folgende Datei(Falls ihr keine Original Datei habt dann bearbeitet diese Datei nach euren Wünschen).
Spoiler anzeigen
/*
Author: Deathman & Maxos
Description:
Vehicle Interaction Menu
*/
private["_curTarget","_isVehicle","_display","_btn1","_btn2","_btn3","_btn4","_btn5","_btn6","_btn7","_btn8","_btn9","_btn10"];
disableSerialization;
_curTarget = param [0,ObjNull,[ObjNull]];
_damage = 0;
{
if(_x > 0.34) then
{
_damage = _damage + _x;
};
} forEach ((getAllHitPointsDamage _curTarget) # 2);
if(isNull _curTarget) exitWith {closeDialog 0;};
_isVehicle = if((_curTarget isKindOf "landVehicle") OR (_curTarget isKindOf "Ship") OR (_curTarget isKindOf "Air")) then {true} else {false};
if(!_isVehicle) exitWith {closeDialog 0;};
if(!dialog) then
{
switch (playerside) do
{
case west: {createDialog "interaction_menu_7";};
case independent: {createDialog "interaction_menu_6";};
case civilian: {createDialog "interaction_menu_6";};
};
};
_display = findDisplay 7000;
_background = _display displayCtrl 7001;
_background ctrlSetFade 0;
_background ctrlCommit 5;
_btn1 = _display displayCtrl 7002;
_btn2 = _display displayCtrl 7003;
_btn3 = _display displayCtrl 7004;
_btn4 = _display displayCtrl 7005;
_btn5 = _display displayCtrl 7006;
_btn6 = _display displayCtrl 7007;
_btn7 = _display displayCtrl 7008;
life_vInact_curTarget = _curTarget;
switch (playerside) do
{
case west:
{
_Btn1 ctrlShow false;
_Btn2 ctrlShow false;
_Btn3 ctrlShow false;
_Btn4 ctrlShow false;
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;
_Btn7 ctrlShow false;
_btn1 ctrlSetText "textures\interaction\Vehicle\icon_close.paa";
_btn1 ctrlSetTooltip "Menü Schließen";
_btn1 buttonSetAction "closeDialog 0;";
if(_damage > 0) then
{
_btn2 ctrlSetText "textures\interaction\Vehicle\icon_repair.paa";
_btn2 ctrlSetTooltip "Reparieren";
_btn2 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_repairTruck;";
_btn2 ctrlEnable false;
if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false;};
} else {
_btn2 ctrlSetText "textures\interaction\Vehicle\icon_repair.paa";
_btn2 ctrlSetTooltip "Reparieren";
_btn2 ctrlEnable false;
};
_btn3 ctrlSetText "textures\interaction\Vehicle\icon_unflip.paa";
_btn3 ctrlSetTooltip "Unflip";
_btn3 buttonSetAction "closeDialog 0; life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5];";
_btn4 ctrlSetText "textures\interaction\Vehicle\icon_register.paa";
_btn4 ctrlSetTooltip "Besitzer Abfrage";
_btn4 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_searchVehAction;";
_btn5 ctrlSetText "textures\interaction\Vehicle\icon_search.paa";
_btn5 ctrlSetTooltip "Durchsuchen";
_btn5 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_vehInvSearch;";
_btn6 ctrlSetText "textures\interaction\Vehicle\icon_pullout.paa";
_btn6 ctrlSetTooltip "Herausziehen";
_btn6 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_pulloutAction;";
if(count crew _curTarget == 0) then {_Btn6 ctrlEnable false;};
_btn7 ctrlSetText "textures\interaction\Vehicle\icon_impound.paa";
_btn7 ctrlSetTooltip "Beschlagnahmen";
_btn7 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_impoundAction;";
{
_x ctrlSetFade 0;
_x ctrlCommit 3;
_x ctrlShow true;
} forEach [_Btn1,_Btn2,_Btn3,_Btn4,_Btn5,_Btn6,_Btn7];
};
case independent:
{
_Btn1 ctrlShow false;
_Btn2 ctrlShow false;
_Btn3 ctrlShow false;
_Btn4 ctrlShow false;
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;
_btn1 ctrlSetText "textures\interaction\Vehicle\icon_close.paa";
_btn1 ctrlSetTooltip "Menü Schließen";
_btn1 buttonSetAction "closeDialog 0;";
if(_damage > 0) then
{
_btn2 ctrlSetText "textures\interaction\Vehicle\icon_repair.paa";
_btn2 ctrlSetTooltip "Reparieren";
_btn2 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_repairTruck;";
_btn2 ctrlEnable false;
if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false;};
} else {
_btn2 ctrlSetText "textures\interaction\Vehicle\icon_repair.paa";
_btn2 ctrlSetTooltip "Reparieren";
_btn2 ctrlEnable false;
};
_btn3 ctrlSetText "textures\interaction\Vehicle\icon_push.paa";
_btn3 ctrlSetTooltip "Schieben";
_btn3 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_pushObject;";
_btn4 ctrlSetText "textures\interaction\Vehicle\icon_unflip.paa";
_btn4 ctrlSetTooltip "Unflip";
_btn4 buttonSetAction "closeDialog 0; life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5];";
_btn5 ctrlSetText "textures\interaction\Vehicle\icon_impound.paa";
_btn5 ctrlSetTooltip "Beschlagnahmen";
_btn5 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_impoundAction;";
_btn6 ctrlSetText "textures\interaction\Vehicle\icon_pullout.paa";
_btn6 ctrlSetTooltip "Herausziehen";
_btn6 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_pulloutAction;";
if(count crew _curTarget == 0) then {_Btn6 ctrlEnable false;};
{
_x ctrlSetFade 0;
_x ctrlCommit 3;
_x ctrlShow true;
} forEach [_Btn1,_Btn2,_Btn3,_Btn4,_Btn5,_Btn6];
};
case civilian:
{
_Btn1 ctrlShow false;
_Btn2 ctrlShow false;
_Btn3 ctrlShow false;
_Btn4 ctrlShow false;
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;
_btn1 ctrlSetText "textures\interaction\Vehicle\icon_close.paa";
_btn1 ctrlSetTooltip "Menü Schließen";
_btn1 buttonSetAction "closeDialog 0;";
if(_damage > 0) then
{
_btn2 ctrlSetText "textures\interaction\Vehicle\icon_repair.paa";
_btn2 ctrlSetTooltip "Reparieren";
_btn2 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_repairTruck;";
_btn2 ctrlEnable false;
if ((life_inv_toolkit >= 1) && {alive life_vInact_curTarget} && {([life_vInact_curTarget] call life_fnc_isDamaged)}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false;};
} else {
_btn2 ctrlSetText "textures\interaction\Vehicle\icon_repair.paa";
_btn2 ctrlSetTooltip "Reparieren";
_btn2 ctrlEnable false;
};
_btn3 ctrlSetText "textures\interaction\Vehicle\icon_push.paa";
_btn3 ctrlSetTooltip "Schieben";
_btn3 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_pushObject;";
_btn4 ctrlSetText "textures\interaction\Vehicle\icon_unflip.paa";
_btn4 ctrlSetTooltip "Unflip";
_btn4 buttonSetAction "closeDialog 0; life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5];";
if(_curTarget isKindOf "O_Truck_03_device_F") then
{
_btn5 ctrlSetText "textures\interaction\Vehicle\icon_mining.paa";
_btn5 ctrlSetTooltip "Abbau Starten";
_btn5 buttonSetAction "closedialog 0; [life_vInact_curTarget] spawn life_fnc_deviceMine;";
if(!isNil {(_curTarget getVariable "mining")} OR !local _curTarget && {_curTarget in life_vehicles}) then {
_Btn5 ctrlEnable false;
} else {
_Btn5 ctrlEnable true;
};
} else {
_btn5 ctrlSetText "textures\interaction\Vehicle\icon_mining.paa";
_btn5 ctrlSetTooltip "Abbau Starten";
_btn5 ctrlEnable false;
};
if(license_civ_rebel) then
{
_Btn6 ctrlSetText "textures\interaction\Vehicle\icon_pullout.paa";
_Btn6 ctrlSetTooltip "Herausziehen";
_Btn6 buttonSetAction "closeDialog 0; [life_vInact_curTarget] spawn life_fnc_pulloutAction;";
} else{
_Btn6 ctrlSetText "textures\interaction\Vehicle\icon_pullout.paa";
_Btn6 ctrlSetTooltip "Herausziehen";
_Btn6 ctrlShow false;
};
{
_x ctrlSetFade 0;
_x ctrlCommit 3;
_x ctrlShow true;
} forEach [_Btn1,_Btn2,_Btn3,_Btn4,_Btn5,_Btn6];
};
};
Alles anzeigen
Schritt 2. Geht ihr in die dialog Ordner und erstellt folgende Datei ----> vInteraction.hpp dort fügst du folgendes ein
Spoiler anzeigen
class interaction_menu_7 {
idd = 7000;
name = "interaction_menu_7";
movingenable = false;
enablesimulation = true;
class controlsBackground
{
class Life_RscTitleBackground : Life_RscText
{
colorbackground[] = {0, 0, 0, 0.7};
idc = 7001;
x = 0.365104166666667 * safezoneW + safezoneX;
y = 0.803999026290166 * safezoneH + safezoneY;
w = 0.126041666666667 * safezoneW;
h = 0.148289191820837 * safezoneH;
};
};
class controls
{
class close_pic : Life_RscPictureButton
{
idc = 7002;
x = 0.490034666666667 * safezoneW + safezoneX;
y = 0.773524829600779 * safezoneH + safezoneY;
w = 0.0206316 * safezoneW;
h = 0.033 * safezoneH;
};
class pic_1 : Life_RscPictureButton
{
idc = 7003;
x = 0.370850666666667 * safezoneW + safezoneX;
y = 0.812077896786758 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_2 : Life_RscPictureButton
{
idc = 7004;
x = 0.411475666666667 * safezoneW + safezoneX;
y = 0.812077896786758 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_3 : Life_RscPictureButton
{
idc = 7005;
x = 0.452100666666667 * safezoneW + safezoneX;
y = 0.812077896786758 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_4 : Life_RscPictureButton
{
idc = 7006;
x = 0.370850666666667 * safezoneW + safezoneX;
y = 0.885106134371957 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_5 : Life_RscPictureButton
{
idc = 7007;
x = 0.411475666666667 * safezoneW + safezoneX;
y = 0.885106134371957 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_6 : Life_RscPictureButton
{
idc = 7008;
x = 0.452100666666667 * safezoneW + safezoneX;
y = 0.885106134371957 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
};
};
class interaction_menu_6 {
idd = 7000;
name = "interaction_menu_6";
movingenable = false;
enablesimulation = true;
class controlsBackground
{
class Life_RscTitleBackground : Life_RscText
{
colorbackground[] = {0, 0, 0, 0.7};
idc = 7001;
x = 0.365104166666667 * safezoneW + safezoneX;
y = 0.803999026290166 * safezoneH + safezoneY;
w = 0.126041666666667 * safezoneW;
h = 0.148289191820837 * safezoneH;
};
};
class controls
{
class close_pic : Life_RscPictureButton
{
idc = 7002;
x = 0.490034666666667 * safezoneW + safezoneX;
y = 0.773524829600779 * safezoneH + safezoneY;
w = 0.0206316 * safezoneW;
h = 0.033 * safezoneH;
};
class pic_1 : Life_RscPictureButton
{
idc = 7003;
x = 0.370850666666667 * safezoneW + safezoneX;
y = 0.812077896786758 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_2 : Life_RscPictureButton
{
idc = 7004;
x = 0.411475666666667 * safezoneW + safezoneX;
y = 0.812077896786758 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_3 : Life_RscPictureButton
{
idc = 7005;
x = 0.452100666666667 * safezoneW + safezoneX;
y = 0.812077896786758 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_4 : Life_RscPictureButton
{
idc = 7006;
x = 0.370850666666667 * safezoneW + safezoneX;
y = 0.885106134371957 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
class pic_5 : Life_RscPictureButton
{
idc = 7007;
x = 0.411475666666667 * safezoneW + safezoneX;
y = 0.885106134371957 * safezoneH + safezoneY;
w = 0.0332135 * safezoneW;
h = 0.0574449853943525 * safezoneH;
};
};
};
Alles anzeigen
Schritt 3. Geht in die dialog\pInteraction.hpp und entfernt dort die komplete Class vInteraction_Menu wer nicht weiß was gemeint ist schreibt mir eine Nachricht oder schreibt es unten in die Kommentare
Schritt 4. Geht in die dialog\common.hpp und fügt folgende Code ein
Spoiler anzeigen
class Life_RscPictureButton
{
idc = -1;
type = 11;
style = 48;
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
colorBackground[] = {1,1,1,0.8};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground2[] = {0.75,0.75,0.75,1};
color[] = {1,1,1,0.7};
colorActive[] = {1,1,1,1};
colorFocused[] = {0,0,0,1};
color2[] = {0,0,0,1};
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
period = 1.2;
periodFocus = 1.2;
periodOver = 1.2;
borderSize = 0.0;
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
font = "PuristaMedium";
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
soundEscape[] ={"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
text = "";
};
Alles anzeigen
Schritt 5. Ist kein muss, es geht nur darum das die Medics die Fahrezuge abschleppen können. Ihr geht in die core\action\fn_impoundAction.sqf und sucht folgenden code if (playerSide in [west]) then {und ersetzt es durch das if (playerSide in [west,independent]) then {.
Schritt 6. Nun nur noch die Icons einfügen unter textures\interaction\Vehicle <--- dieser Pfad ist keine Pflicht die Icons findest du unten im Anhang
So jetzt sind wir Fertig vielspaß
Gruß Deathman
UPDATE ZEIT DEM 11.12.2018