Bonjour, on se retrouve pour vous expliquer comment installer un dialog de garage "2.0" avec une barre de recherche de véhicules.
Si vous voulez utiliser la barre de recherche, vous devez également suivre ce tutoriel : https://forum.the-programmer.com/post/filtrer-les-véhicules-dans-le-garage.1565/
Voici un aperçu :
[CODE lang="cpp" title="impound.hpp"]
class Life_impound_menu {
idd = 2800;
name = "Life_impound_menu";
movingenable = 0;
enablesimulation = 1;
onload = "ctrlShow [2330,false];";
class controlsBackground
{
class InventoryBack : Life_RscPicture
{
text = "DUBOIS_textures\GarageMenu\textures_Menu_Garage.paa";
idc = -1;
x = 0.233854166666667 * safezoneW + safezoneX;
y = 0.0589970501474926 * safezoneH + safezoneY;
w = 0.571354166666667 * safezoneW;
h = 0.933136676499508 * safezoneH;
};
};
class controls
{
class CloseBtn : Life_RscButtonMenu
{
text = "";
onbuttonclick = "closeDialog 0;";
x = 0.322916666666667 * safezoneW + safezoneX;
y = 0.695181907571288 * safezoneH + safezoneY;
w = 0.1 * safezoneW;
h = 0.0373647984267453 * safezoneH;
tooltip = "$STR_Global_Close";
colorbackground[] = {0,0,0,0};
colorbackgroundfocused[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
color[] = {1,1,1,0};
colorfocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
idc = 1000;
};
class RentCar : Life_RscButtonMenu
{
text = "";
onbuttonclick = "[] call life_fnc_unimpound;";
x = 0.436458333333333 * safezoneW + safezoneX;
y = 0.695181907571288 * safezoneH + safezoneY;
w = 0.101041666666667 * safezoneW;
h = 0.0373647984267453 * safezoneH;
tooltip = "$STR_Global_Retrieve";
colorbackground[] = {0,0,0,0};
colorbackgroundfocused[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
color[] = {1,1,1,0};
colorfocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
idc = 1000;
};
class BuyCar : life_RscButtonMenu
{
idc = -1;
text = "";
onbuttonclick = "[] call life_fnc_sellGarage; closeDialog 0;";
x = 0.5453125 * safezoneW + safezoneX;
y = 0.695181907571288 * safezoneH + safezoneY;
w = 0.1015625 * safezoneW;
h = 0.0373647984267453 * safezoneH;
tooltip = "$STR_Global_Sell";
colorbackground[] = {0,0,0,0};
colorbackgroundfocused[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
color[] = {1,1,1,0};
colorfocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
};
class VehicleList : Life_RscListBox
{
idc = 2802;
text = "";
sizeex = 0.04;
colorbackground[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
onlbselchanged = "_this call life_fnc_garageLBChange;";
x = 0.322916666666666 * safezoneW + safezoneX;
y = 0.291052114060964 * safezoneH + safezoneY;
w = 0.16875 * safezoneW;
h = 0.339233038348082 * safezoneH;
};
class vehicleInfomationList : Life_RscStructuredText
{
idc = 2803;
sizeex = 0.035;
colorbackground[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
x = 0.508333333333334 * safezoneW + safezoneX;
y = 0.291052114060964 * safezoneH + safezoneY;
w = 0.2265625 * safezoneW;
h = 0.339233038348082 * safezoneH;
};
class MainHideText : Life_RscText
{
idc = 2811;
text = "STR_ANOTF_QueryGarage";
x = 0.317655999999999 * safezoneW + safezoneX;
y = 0.233529990167158 * safezoneH + safezoneY;
w = 0.122969 * safezoneW;
h = 0.0368731563421831 * safezoneH;
};
class Search_veh: Life_RscEdit {
idc = 2812;
text = "";
x = 0.11;
y = 0.8;
w = 0.3;
h = 0.04;
onKeyUp = "[(_this # 0), 2802, 2803] spawn life_fnc_filterGarage";
};
};
};[/CODE]
C'était simple non ?
A une prochaine fois !
Si vous voulez utiliser la barre de recherche, vous devez également suivre ce tutoriel : https://forum.the-programmer.com/post/filtrer-les-véhicules-dans-le-garage.1565/
Voici un aperçu :
- Étape 1:
- Étape 2:
[CODE lang="cpp" title="impound.hpp"]
class Life_impound_menu {
idd = 2800;
name = "Life_impound_menu";
movingenable = 0;
enablesimulation = 1;
onload = "ctrlShow [2330,false];";
class controlsBackground
{
class InventoryBack : Life_RscPicture
{
text = "DUBOIS_textures\GarageMenu\textures_Menu_Garage.paa";
idc = -1;
x = 0.233854166666667 * safezoneW + safezoneX;
y = 0.0589970501474926 * safezoneH + safezoneY;
w = 0.571354166666667 * safezoneW;
h = 0.933136676499508 * safezoneH;
};
};
class controls
{
class CloseBtn : Life_RscButtonMenu
{
text = "";
onbuttonclick = "closeDialog 0;";
x = 0.322916666666667 * safezoneW + safezoneX;
y = 0.695181907571288 * safezoneH + safezoneY;
w = 0.1 * safezoneW;
h = 0.0373647984267453 * safezoneH;
tooltip = "$STR_Global_Close";
colorbackground[] = {0,0,0,0};
colorbackgroundfocused[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
color[] = {1,1,1,0};
colorfocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
idc = 1000;
};
class RentCar : Life_RscButtonMenu
{
text = "";
onbuttonclick = "[] call life_fnc_unimpound;";
x = 0.436458333333333 * safezoneW + safezoneX;
y = 0.695181907571288 * safezoneH + safezoneY;
w = 0.101041666666667 * safezoneW;
h = 0.0373647984267453 * safezoneH;
tooltip = "$STR_Global_Retrieve";
colorbackground[] = {0,0,0,0};
colorbackgroundfocused[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
color[] = {1,1,1,0};
colorfocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
idc = 1000;
};
class BuyCar : life_RscButtonMenu
{
idc = -1;
text = "";
onbuttonclick = "[] call life_fnc_sellGarage; closeDialog 0;";
x = 0.5453125 * safezoneW + safezoneX;
y = 0.695181907571288 * safezoneH + safezoneY;
w = 0.1015625 * safezoneW;
h = 0.0373647984267453 * safezoneH;
tooltip = "$STR_Global_Sell";
colorbackground[] = {0,0,0,0};
colorbackgroundfocused[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
color[] = {1,1,1,0};
colorfocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
};
class VehicleList : Life_RscListBox
{
idc = 2802;
text = "";
sizeex = 0.04;
colorbackground[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
onlbselchanged = "_this call life_fnc_garageLBChange;";
x = 0.322916666666666 * safezoneW + safezoneX;
y = 0.291052114060964 * safezoneH + safezoneY;
w = 0.16875 * safezoneW;
h = 0.339233038348082 * safezoneH;
};
class vehicleInfomationList : Life_RscStructuredText
{
idc = 2803;
sizeex = 0.035;
colorbackground[] = {0,0,0,0};
colorbackground2[] = {0,0,0,0};
colortext[] = {1,1,1,1};
x = 0.508333333333334 * safezoneW + safezoneX;
y = 0.291052114060964 * safezoneH + safezoneY;
w = 0.2265625 * safezoneW;
h = 0.339233038348082 * safezoneH;
};
class MainHideText : Life_RscText
{
idc = 2811;
text = "STR_ANOTF_QueryGarage";
x = 0.317655999999999 * safezoneW + safezoneX;
y = 0.233529990167158 * safezoneH + safezoneY;
w = 0.122969 * safezoneW;
h = 0.0368731563421831 * safezoneH;
};
class Search_veh: Life_RscEdit {
idc = 2812;
text = "";
x = 0.11;
y = 0.8;
w = 0.3;
h = 0.04;
onKeyUp = "[(_this # 0), 2802, 2803] spawn life_fnc_filterGarage";
};
};
};[/CODE]
C'était simple non ?
A une prochaine fois !
By DuBois
Fichiers joints
Dernière édition par un modérateur: