Jump to content
Sign in to follow this  
beta

Detecting if the Gear Dialog is open?

Recommended Posts

Is it possible to detect if the Gear dialog is currently open for a player?

Does the 'dialog' command detect pre-existing dialogs (Gear, Map, etc.) along with user made ones?

Simply closing ANY dialog would be fine .. I can't test it at the moment, but would like to know if it is possible.

Thanks for any responses.

Share this post


Link to post
Share on other sites

If you know the display ID, then you can use some simple loops and the FindDisplay commad.

Off hand I don't know what the gear display id is, but if we assume it's say 42. Your code might look like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">While {Alive Player} Do

       {

       WaitUntil {!IsNull (FindDisplay 42)};

       Hint "Gear Dialog is open";

       WaitUntil {IsNull (FindDisplay 42)};

       Hint "Gear Dialog is closed";

       };

Look in the configs to get the correct display ID.

Share this post


Link to post
Share on other sites

Perfect.

I was hoping it would be something like that, searched through a bunch of threads, but nothing was concrete ..

Thanks again!

Just need to find the ID then.

EDIT:

Just de-pbo'd and unbin'd the bin.pbo and config.bin files.

This is the entry which I THINK is related to the gear dialog (for future search reference):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class RscDisplayGear: RscStandardDisplay {

idd = 106;

emptyGun = "#(argb,8,8,3)color(1,1,1,1)";

emptySec = "#(argb,8,8,3)color(1,1,1,1)";

emptyEq = "#(argb,8,8,3)color(1,1,1,1)";

emptyMag = "#(argb,8,8,3)color(1,1,1,1)";

emptyMag2 = "#(argb,8,8,3)color(1,1,1,1)";

emptyHGun = "#(argb,8,8,3)color(1,1,1,1)";

emptyHGunMag = "#(argb,8,8,3)color(1,1,1,1)";

class controls {

class Title: RscTitle {

idc = 101;

text = "$STR_GEAR_TITLE";

};

class Pool: RscListBox {

idc = 105;

style = 16;

x = 0.050000;

y = 0.600000;

w = 0.400000;

h = 0.300000;

color = {0, 0, 0, 1};

};

class Skill: RscPicture {

idc = 102;

x = 0.730000;

y = 0.200000;

w = 0.050000;

h = 0.050000;

};

class Vehicle: RscPicture {

idc = 103;

x = 0.800000;

y = 0.200000;

w = 0.060000;

h = 0.060000;

};

class Weapons: RscHTML {

idc = "IDC_GEAR_WEAPONS";

x = 0.550000;

y = 0.180000;

w = 0.400000;

h = 0.600000;

align = "center";

cycleLinks = 0;

};

class B_Rearm: RscActiveText {

idc = 132;

x = 0.750000;

y = 0.900000;

w = 0.150000;

text = "$STR_GEAR_REARM";

};

class B_Close: RscActiveText {

idc = 2;

x = 0.850000;

y = 0.900000;

w = 0.150000;

text = "$STR_DISP_CLOSE";

default = 1;

};

};

};

EDIT 2:

Ah, so I am assuming that the 'idd=106;' would mean the gear dialog's IDD is 106, so, modifying the above code to:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

While {Alive Player} Do

      {

      WaitUntil {!IsNull (FindDisplay 106)};

      Hint "Gear Dialog is open";

      WaitUntil {IsNull (FindDisplay 106)};

      Hint "Gear Dialog is closed";

      };

This would then display the hints when the dialog opens or is closed?

EDIT 3:

Just gave it a quick test, works like a charm.

Thanks again!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×