Quote:
|
Originally Posted by Landiin
The reason why your OnShow event handle in the compass didn't work is because you have visible set to true, so the OnShow never fired. Set it to !visible in the xml file and when the game loads it it will change it to visible thus firing the OnShow event.
Also I wouldn't use show_window in the OnShow event, I would do Parent.<window name>.Visible=Ture. show_window works but it has to be scripted in twice taking up clock cycles plus having to run the command show_window when it could just set the property by direct paths without having to execute the show_window command.
|
Oh, OnShow _is_ fired, I know for sure. In my code it does many things, not only windows showing. And everything else works.
Setting Visible=true on custom windows appears to do nothing. Or, more correctly, it doesn't show them UNLESS you've already activated them once with show_window command (which doesn't need to be issued twice, btw, if you issue it as you would from in-game prompt (OnActivate="show_window MainHUD.Compass.Solf.ShowWindows") and not using that fancy = syntax).
So, basically, my experience thus far is:
- If you want for window to be shown (_any_ non default hud window including such things as ZoneReuse window), you HAVE to issue show_window command. Setting Visible=True has no effect prior to show_window.
- After show_window has been successfully issued, you can manipulate window using Visible=true/false.
- show_window appears to do NOT work when issued from OnShow handler of the standard windows that are automatically-shown (i.e. it doesn't work for Compass window, but it does work for Target window that is not shown immediatelly).
I've ran quite a few tests of all this.. and I'm reasonably sure that it is how it works.. unfortunately.
Of course, it still doesn't preclude me being wrong

If someone has a working code sample to share that would auto-show custom windows on startup -- I'd greatly appreciate that
