Jump to content
Pasta_Bake

[TUTORIAL] New Clothing Dialog

Recommended Posts

Hey Everyone,

I made this dialogue for any store but I'm only showing this for the Clothing store. Just simply copy the code below and pas it into, Dialog \ clothing.hpp

class Life_Clothing {
    idd = 3100;
    name= "Life_Clothing";
    movingEnable = 1;
    enableSimulation = 1;
    //onLoad = "[] execVM 'core\client\keychain\init.sqf'";

    class controlsBackground
    {
        class Background: Life_RscText
        {
	        idc = -1;
			colorBackground[] = {0, 0, 0, 0.7};
	        x = 0.716562 * safezoneW + safezoneX;
	        y = 0.016 * safezoneH + safezoneY;
	        w = 0.273281 * safezoneW;
	        h = 0.968 * safezoneH;
        };
        class Background2: Life_RscText
        {
	        idc = -1;
			colorBackground[] = {0, 0, 0, 0.7};
	        x = 0.716563 * safezoneW + safezoneX;
	        y = 0.016 * safezoneH + safezoneY;
	        w = 0.273281 * safezoneW;
	        h = 0.968 * safezoneH;
        };
    };

    class controls 
    {
        class Title: Life_RscStructuredText
        {
	        idc = 1100;
			colorBackground[] = {0, 0, 0, 0};
	        text = "Clothing Shop"; //--- ToDo: Localize;
	        x = 0.824844 * safezoneW + safezoneX;
	        y = 0.016 * safezoneH + safezoneY;
	        w = 0.0825 * safezoneW;
	        h = 0.033 * safezoneH;
        };
        class ClothingList: Life_RscListbox
        {
	        onLBSelChanged = "[_this] call life_fnc_changeClothes;";
	        idc = 3101;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.06 * safezoneH + safezoneY;
	        w = 0.242344 * safezoneW;
	        h = 0.748 * safezoneH;
        };
        class PriceTag: Life_RscStructuredText
        {
	        idc = 3102;
	        x = 0.778437 * safezoneW + safezoneX;
	        y = 0.907 * safezoneH + safezoneY;
	        w = 0.0567187 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        class TotalPrice: Life_RscStructuredText
        {
	        idc = 3106;
	        x = 0.778437 * safezoneW + safezoneX;
	        y = 0.874 * safezoneH + safezoneY;
	        w = 0.0567187 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        class FilterList: Life_RscCombo
        {
	        onLBSelChanged	= "_this call life_fnc_clothingFilter";
	        idc = 3105;
	        x = 0.835156 * safezoneW + safezoneX;
	        y = 0.819 * safezoneH + safezoneY;
	        w = 0.139219 * safezoneW;
	        h = 0.022 * safezoneH;
	        tooltip = "Use this to change to backpack or vests or some other section."; //--- ToDo: Localize;
        };
        class Total: Life_RscStructuredText
        {
	        idc = 1103;
	        text = "Total Price:"; //--- ToDo: Localize;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.874 * safezoneH + safezoneY;
	        w = 0.0515625 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        class ItemPrice: Life_RscStructuredText
        {
	        idc = 1104;
	        text = "Item Price:"; //--- ToDo: Localize;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.907 * safezoneH + safezoneY;
	        w = 0.0515625 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        class CloseButtonKey: Life_RscButtonMenu
        {
	        onButtonClick = "closeDialog 0; [] call life_fnc_playerSkins;";

	        idc = -1;
	        text = "Exit"; //--- ToDo: Localize;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.951 * safezoneH + safezoneY;
	        w = 0.0670312 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        class BuyButtonKey: Life_RscButtonMenu
        {
	        onButtonClick = "[] call life_fnc_buyClothes;";

	        idc = -1;
	        text = "Buy"; //--- ToDo: Localize;
	        x = 0.9125 * safezoneW + safezoneX;
	        y = 0.951 * safezoneH + safezoneY;
	        w = 0.0670312 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        class viewAngle: life_RscXSliderH
        {
	        onSliderPosChanged = "[4,_this select 1] call life_fnc_s_onSliderChange;";
	        idc = 3107;
			color[] = {1, 1, 1, 0.45};
            colorActive[] = {1, 1, 1, 0.65};
			text = "";
	        x = 0.00499997 * safezoneW + safezoneX;
	        y = 0.951 * safezoneH + safezoneY;
	        w = 0.221719 * safezoneW;
	        h = 0.033 * safezoneH;
	        tooltip = "Use this to see your person and what they will look like with thier new snazzy clothes."; //--- ToDo: Localize;
        };
    };
};

Then that's it, This is my first post on the release section so please be nice any issues let me know.  This was tested on version 5.0 but I see no reason for it to not work on lower versions. I have also attached a Screenshot below.

FB3B6EE6EAC80A4A9C5314B4BD48ACFF49C495A9

Edited by Pasta_Bake
  • Like 6
  • Thanks 2

Share this post


Link to post
Share on other sites

Anyway to make the text a little bigger? 

Would also like to try an make it smaller and in the centre. Would a scroll bar be added if items go outside?

Share this post


Link to post
Share on other sites
Just now, Carlos Lopez said:

Just like this, when you select the clothing the price is not there at all, nothing in RPT.

What resolution and aspect ratio are you playing at?

Share this post


Link to post
Share on other sites
38 minutes ago, Carlos Lopez said:

1920x1080, multiple people tested it on my server with different resolutions.  

Odd, just gave it a ran on me and @imthatguyhere dev server and didn't find an issue with the prices appearing. I flipped threw a few resolutions as well.

KpAX6dC.jpg

(I play at 21:9 anyway, which that screenshot is)

All I can say is try copy and pasting mine in and seeing if it works for you.

class Life_Clothing {
    idd = 3100;
    name= "Life_Clothing";
    movingEnable = 1;
    enableSimulation = 1;
    //onLoad = "[] execVM 'core\client\keychain\init.sqf'";

    class controlsBackground {
        class Background: Life_RscText {
	        idc = -1;
			colorBackground[] = {0, 0, 0, 0.7};
	        x = 0.716562 * safezoneW + safezoneX;
	        y = 0.016 * safezoneH + safezoneY;
	        w = 0.273281 * safezoneW;
	        h = 0.968 * safezoneH;
        };
        
		class Background2: Life_RscText {
	        idc = -1;
			colorBackground[] = {0, 0, 0, 0.7};
	        x = 0.716563 * safezoneW + safezoneX;
	        y = 0.016 * safezoneH + safezoneY;
	        w = 0.273281 * safezoneW;
	        h = 0.968 * safezoneH;
        };
    };

    class controls {
        class Title: Life_RscStructuredText {
	        idc = 1100;
			colorBackground[] = {0, 0, 0, 0};
	        text = "Clothing Shop"; //--- ToDo: Localize;
	        x = 0.824844 * safezoneW + safezoneX;
	        y = 0.016 * safezoneH + safezoneY;
	        w = 0.0825 * safezoneW;
	        h = 0.033 * safezoneH;
        };
        
		class ClothingList: Life_RscListbox {
	        onLBSelChanged = "[_this] call life_fnc_changeClothes;";
	        idc = 3101;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.06 * safezoneH + safezoneY;
	        w = 0.242344 * safezoneW;
	        h = 0.748 * safezoneH;
        };
        
		class PriceTag: Life_RscStructuredText {
	        idc = 3102;
	        x = 0.778437 * safezoneW + safezoneX;
	        y = 0.907 * safezoneH + safezoneY;
	        w = 0.0567187 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        
		class TotalPrice: Life_RscStructuredText {
	        idc = 3106;
	        x = 0.778437 * safezoneW + safezoneX;
	        y = 0.874 * safezoneH + safezoneY;
	        w = 0.0567187 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        
		class FilterList: Life_RscCombo {
	        onLBSelChanged	= "_this call life_fnc_clothingFilter";
	        idc = 3105;
	        x = 0.835156 * safezoneW + safezoneX;
	        y = 0.819 * safezoneH + safezoneY;
	        w = 0.139219 * safezoneW;
	        h = 0.022 * safezoneH;
	        tooltip = "Use this to change to backpack or vests or some other section."; //--- ToDo: Localize;
        };
        
		class Total: Life_RscStructuredText {
	        idc = 1103;
	        text = "Total Price:"; //--- ToDo: Localize;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.874 * safezoneH + safezoneY;
	        w = 0.0515625 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        
		class ItemPrice: Life_RscStructuredText {
	        idc = 1104;
	        text = "Item Price:"; //--- ToDo: Localize;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.907 * safezoneH + safezoneY;
	        w = 0.0515625 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        
		class CloseButtonKey: Life_RscButtonMenu {
	        onButtonClick = "closeDialog 0; [] call life_fnc_playerSkins;";

	        idc = -1;
	        text = "Exit"; //--- ToDo: Localize;
	        x = 0.732031 * safezoneW + safezoneX;
	        y = 0.951 * safezoneH + safezoneY;
	        w = 0.0670312 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        
		class BuyButtonKey: Life_RscButtonMenu {
	        onButtonClick = "[] call life_fnc_buyClothes;";

	        idc = -1;
	        text = "Buy"; //--- ToDo: Localize;
	        x = 0.9125 * safezoneW + safezoneX;
	        y = 0.951 * safezoneH + safezoneY;
	        w = 0.0670312 * safezoneW;
	        h = 0.022 * safezoneH;
        };
        
		class viewAngle: life_RscXSliderH {
	        onSliderPosChanged = "[4,_this select 1] call life_fnc_s_onSliderChange;";
	        idc = 3107;
			color[] = {1, 1, 1, 0.45};
            colorActive[] = {1, 1, 1, 0.65};
			text = "";
	        x = 0.00499997 * safezoneW + safezoneX;
	        y = 0.951 * safezoneH + safezoneY;
	        w = 0.221719 * safezoneW;
	        h = 0.033 * safezoneH;
	        tooltip = "Use this to see your person and what they will look like with thier new snazzy clothes."; //--- ToDo: Localize;
        };
    };
};

 

Share this post


Link to post
Share on other sites

@Resonance I had that happen to me on my old server. I couldn't be bothered fixing it though.

If I remember correctly it was when I had more than 1 item selected.

Edited by Delexical
Autism.

Share this post


Link to post
Share on other sites
16 minutes ago, Delexical said:

If I remember correctly it was when I had more than 1 item selected. 

As in one item for each category? (Vest, Hat, Ect) If so, I tried that too and it was working fine with all the prices displaying as well as the total actually totaling

Share this post


Link to post
Share on other sites
2 minutes ago, Resonance said:

As in one item for each category? (Vest, Hat, Ect) If so, I tried that too and it was working fine with all the prices displaying as well as the total actually totaling

Yeah, I'm pretty sure it was one item in each category.

Share this post


Link to post
Share on other sites
Just now, Resonance said:

Fun, glad to hear you got it solved.

The "idc = 3106;" is different on the tutorial than base framework which is why a lot of people have issues. Not sure if you're a moderator but might pay to edit the post for future problems.

Share this post


Link to post
Share on other sites
23 minutes ago, Carlos Lopez said:

Not sure if you're a moderator but might pay to edit the post for future problems.

I am not, though I will forward this to one and they can choose to edit it if they feel it would be beneficial to do so.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×