forked from 0ad/0ad
A minor improvement for enabling/disabling user feedback. It was set to enabled/disabled in every tick which triggered some code.
Now it's only enabled or disabled when the user clicks the button and therefore much less events are triggered. This was SVN commit r11463.
This commit is contained in:
parent
3db7f32d17
commit
a21fc77212
@ -14,6 +14,8 @@ function init()
|
||||
|
||||
// initialize currentSubmenuType with placeholder to avoid null when switching
|
||||
currentSubmenuType = "submenuSinglePlayer";
|
||||
|
||||
EnableUserReport(Engine.IsUserReportEnabled());
|
||||
}
|
||||
|
||||
var t0 = new Date;
|
||||
@ -140,18 +142,17 @@ function onTick()
|
||||
|
||||
if (Engine.IsUserReportEnabled())
|
||||
{
|
||||
getGUIObjectByName("userReportDisabled").hidden = true;
|
||||
getGUIObjectByName("userReportEnabled").hidden = false;
|
||||
|
||||
getGUIObjectByName("userReportEnabledText").caption =
|
||||
getGUIObjectByName("userReportEnabledText").caption =
|
||||
userReportEnabledText.replace(/\$status/,
|
||||
formatUserReportStatus(Engine.GetUserReportStatus()));
|
||||
}
|
||||
else
|
||||
{
|
||||
getGUIObjectByName("userReportDisabled").hidden = false;
|
||||
getGUIObjectByName("userReportEnabled").hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
function EnableUserReport(Enabled)
|
||||
{
|
||||
getGUIObjectByName("userReportDisabled").hidden = Enabled;
|
||||
getGUIObjectByName("userReportEnabled").hidden = !Enabled;
|
||||
Engine.SetUserReportEnabled(Enabled);
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,7 +97,7 @@ You can automatically send us anonymous feedback that will help us fix bugs, and
|
||||
</object>
|
||||
<object type="button" style="StoneButton" size="8 100%-36 146 100%-8">
|
||||
Enable feedback
|
||||
<action on="Press">Engine.SetUserReportEnabled(true);</action>
|
||||
<action on="Press">EnableUserReport(true);</action>
|
||||
</object>
|
||||
<object type="button" style="StoneButton" size="100%-146 100%-36 100%-8 100%-8">
|
||||
Technical details
|
||||
@ -149,7 +149,7 @@ Status: $status.
|
||||
|
||||
<object type="button" style="StoneButton" size="8 100%-36 146 100%-8">
|
||||
Disable feedback
|
||||
<action on="Press">Engine.SetUserReportEnabled(false);</action>
|
||||
<action on="Press">EnableUserReport(false);</action>
|
||||
</object>
|
||||
<object type="button" style="StoneButton" size="100%-146 100%-36 100%-8 100%-8">
|
||||
Technical details
|
||||
|
Loading…
Reference in New Issue
Block a user