Hi all,
I have a problem with the mod I released to display weapons and ammo...
I used the onload of the RscDisplayMission as a hook into my script which works very well. Unfortunately if the user reverts to a previous save or reverts to mission start, my script is killed but the onload trigger of RscDisplayMission is not fired. It seems that RscDisplayMission does not get unloaded when the mission is reverted to any point.
This is my class definition for RscDisplayMission;
PHP Code:
class RscDisplayMission : RscDisplayEmpty {
onLoad = "_jedh = [] execVM '\x\jed_weapStatGUI\addons\jed_weapCheckGUI\init.sqf'; uiNamespace setVariable ['JED_RscDisplayMission',_this select 0]; ";
onUnload = "diag_log 'display unloaded';"; //Checking if it ever gets unloaded
class controlsBackground {
class RscText_1000: RscText
{
idc = 1000;
text = ""; //--- ToDo: Localize;
x = 0.879439 * safezoneW + safezoneX;
y = 0.0181822 * safezoneH + safezoneY;
w = 0.11628 * safezoneW;
h = 0.035255 * safezoneH;
};
class RscText_1001: RscText
{
idc = 1001;
x = 0.475781 * safezoneW + safezoneX;
y = 0.628143 * safezoneH + safezoneY;
w = 0.0391679 * safezoneW;
h = 0.0470066 * safezoneH;
};
};
};
I have tried to use CBA instead, but again the general Init handlers do not fire when a mission is reverted within a mission. I can get it to work with 'getin' and 'getout' handlers, but unfortunately this doesn't help if the play starts in a vehicle.
Anyway, my question is;
Is there an event (either display or CBA) that I can utilise so I can re-initialise my script when a user reverts?