Jump to content

Recommended Posts

Is there anyway to check what an ctrleventhandler does for example "LBSelChanged" to see what is linked to the control and what it does if its executed in the mission?

_thisScript might come into play but not sure

Share this post


Link to post
Share on other sites

You could retrieve it by script (might be a bit tricky) but you'd be better off browsing the cfg files of the display you want to get the script.

Share this post


Link to post
Share on other sites
16 minutes ago, Mr H. said:

You could retrieve it by script (might be a bit tricky) but you'd be better off browsing the cfg files of the display you want to get the script.

Say if i loaded up editor and executed a Killed event handler on my self with a script with i be able to retrieve what script will be triggered when the eventhandler happends? 

Share this post


Link to post
Share on other sites

Your question was about a control handler, a regular event handler is a different matter. You can't get the script this way you'd have to find where it's added in the first place. Maybe if you explained what you're trying to do it would be easier to help you.

Share this post


Link to post
Share on other sites
1 hour ago, Mr H. said:

Your question was about a control handler, a regular event handler is a different matter. You can't get the script this way you'd have to find where it's added in the first place. Maybe if you explained what you're trying to do it would be easier to help you.

I mean a control handler i didn't realise I put a regular eventhandler

Share this post


Link to post
Share on other sites

_G_Slider = _display ctrlCreate ["RscXSliderH",68];
_G_Slider sliderSetRange [0, 255];
_G_Slider sliderSetPosition _GREEN;
_G_Slider sliderSetSpeed [10, 10, 1];
_G_Slider ctrlSetPosition [0.237492 * safezoneW + safezoneX,0.232889 * safezoneH + safezoneY,0.2 * safezoneW,0.025 * safezoneH];
_G_Slider ctrlSetBackgroundColor [0.15,0.85,0.85,1];
_G_Slider ctrlRemoveAllEventHandlers 'SliderPosChanged';
_G_Slider ctrlAddEventHandler ['SliderPosChanged','
    _RED = profileNamespace getVariable "Var_Red";
    _BLUE = profileNamespace getVariable "Var_Blue";
    _GREEN = profileNamespace getVariable "Var_Green";
    _BRIGHT = profileNamespace getVariable "Var_Bright";
    _REDC = _RED  / 255;
    _BLUEC = _BLUE / 255;
    _BRIGHTC = _BRIGHT / 255;
    _GREEN_UR = (_this select 1);
    _GREEN = Round _GREEN_UR;
    _GREENC = _GREEN / 255;
    _RGBA = [_REDC,_GREENC,_BLUEC,_BRIGHTC];
    ((findDisplay 999) displayCtrl 68) sliderSetPosition (_this select 1);
    ((findDisplay 999) displayCtrl 119) ctrlSetText format[''%1 '',_GREEN];
    ((findDisplay 999) displayCtrl 123) ctrlSetBackgroundColor _RGBA;
    profileNamespace setVariable ["Var_Green",_GREEN];

'];
_G_Slider ctrlCommit 0.3;

For example, how would i get what happends when the sliderpos is changed

Share this post


Link to post
Share on other sites
1 hour ago, bumyplum said:

For example, how would i get what happends when the sliderpos is changed

I don't understand what you want, what hapens when the pos is changed is defined in what you posted above:

_G_Slider ctrlAddEventHandler ['SliderPosChanged','
    _RED = profileNamespace getVariable "Var_Red";
    _BLUE = profileNamespace getVariable "Var_Blue";
    _GREEN = profileNamespace getVariable "Var_Green";
    _BRIGHT = profileNamespace getVariable "Var_Bright";
    _REDC = _RED  / 255;
    _BLUEC = _BLUE / 255;
    _BRIGHTC = _BRIGHT / 255;
    _GREEN_UR = (_this select 1);
    _GREEN = Round _GREEN_UR;
    _GREENC = _GREEN / 255;
    _RGBA = [_REDC,_GREENC,_BLUEC,_BRIGHTC];
    ((findDisplay 999) displayCtrl 68) sliderSetPosition (_this select 1);
    ((findDisplay 999) displayCtrl 119) ctrlSetText format[''%1 '',_GREEN];
    ((findDisplay 999) displayCtrl 123) ctrlSetBackgroundColor _RGBA;
    profileNamespace setVariable ["Var_Green",_GREEN];

'];

this sets the color of the control and redefines the value of the green in profilenamespace

Share this post


Link to post
Share on other sites
1 minute ago, Mr H. said:

I don't understand what you want, what hapens when the pos is changed is defined in what you posted above:

this sets the color of the control and redefines the value of the green in profilenamespace

My goal is to find out what a non specific ctrleventhandler does, im not sure how else to explain it

Share this post


Link to post
Share on other sites

Yup so back to my previous answer: the best way is to look it up in the configviewer

Share this post


Link to post
Share on other sites

For a control /display created by config it might be possible to use getText do get the handler, but for a script created control I don't think there's a command for that and so you can't.

Share this post


Link to post
Share on other sites
3 minutes ago, Mr H. said:

For a control /display created by config it might be possible to use getText do get the handler, but for a script created control I don't think there's a command for that and so you can't.

For example using getText how would i get the displayeventhandler for "Abort" on the pause them just for reference 

Share this post


Link to post
Share on other sites

_handler = getText (configFile>>"RscDisplayInterrupt">>"ButtonAbort">>"action") doesn't work because the handler is set by script, but you can get the onload script by
 getText (configFile>>"RscDisplayInterrupt">>"onload")

Share this post


Link to post
Share on other sites
22 minutes ago, Mr H. said:

_handler = getText (configFile>>"RscDisplayInterrupt">>"ButtonAbort">>"action") doesn't work because the handler is set by script, but you can get the onload script by
 getText (configFile>>"RscDisplayInterrupt">>"onload")

Would you be able to use this to find out a command to open the settings menu?

Share this post


Link to post
Share on other sites

nope. I don't know if that's even possible ctrlActivate ((findDisplay 49) displayCtrl 101) doesn't work

Share this post


Link to post
Share on other sites
17 minutes ago, Mr H. said:

nope. I don't know if that's even possible ctrlActivate ((findDisplay 49) displayCtrl 101) doesn't work

After doing some filtering i found the idd for Video
ctrlActivate ((findDisplay 49) displayCtrl 301);


Loads up the video setting from the pause menu how ever i'm not sure how to open the pause menu through a script

 

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

×