Fixed the button flickering bug. It turns out that guiHide/guiUnHide were settings controls to hidden/unhidden each tick, which caused the C++ code to reset mouse interaction properties even if the thing went from unhidden to unhidden. I fixed it by making guiHide and guiUnHide check whether the control is already hidden/unhidden before changing it, though maybe we want different behaviour from the C++ code.

This was SVN commit r3262.
This commit is contained in:
Matei
2005-12-17 00:24:43 +00:00
parent 7af724889c
commit a40ee4bcbc
3 changed files with 10 additions and 9 deletions
@@ -53,7 +53,7 @@
setWaterHeight(getWaterHeight() - 0.25);
]]></action>
</object>
<!-- GROUP: MINIMAP -->
<object name="snMiniMap"
hotkey="session.minimap.toggle"
@@ -250,7 +250,7 @@
]]></action>
<object name="snStatusPanePortrait"
style="portrait"
style="portrait"
type="button"
hotkey="selection.snap"
>
@@ -315,7 +315,7 @@ function snRefresh()
{
// Reveal Status Orb
guiUnHide ("snStatusPane");
// (later, we need to base this on the selected unit's stats changing)
refreshStatusPane();
@@ -8,10 +8,11 @@
// Hide GUI object.
function guiHide (objectName)
{
var guiObject = getGUIObjectByName (objectName);
if (guiObject == "" || guiObject == null || guiObject == undefined || guiObject == "undefined")
var guiObject = getGUIObjectByName (objectName);
if( guiObject == "" || guiObject == null || guiObject == undefined || guiObject == "undefined" )
console.write ("GUI Object not found: " + objectName);
guiObject.hidden = true;
if( !guiObject.hidden )
guiObject.hidden = true;
}
// ====================================================================
@@ -19,11 +20,11 @@ function guiHide (objectName)
// Reveal GUI object.
function guiUnHide (objectName)
{
var guiObject = getGUIObjectByName (objectName);
var guiObject = getGUIObjectByName (objectName);
if (guiObject == "" || guiObject == null || guiObject == undefined || guiObject == "undefined")
console.write ("GUI Object not found: " + objectName);
guiObject.hidden = false;
if( guiObject.hidden )
guiObject.hidden = false;
}
// ====================================================================