Page 6 of 6
Re: Split: viewDirectionChanged woes
Posted: Fri May 23, 2025 11:49 pm
by phkb
Wildeblood wrote: ↑Thu May 22, 2025 6:02 pm
Sometime between June, 2015, and May, 2025, "VIEW_GUI_DISPLAY" has disappeared from the implementation. Was this an intentional decision, or an accident?
So I went back in time, and what I can confirm is that even from Oolite 1.77.1, "VIEW_GUI_SCREEN" has never been reported through the "viewDirectionChanged" event.
According to the wiki history, Kaks added this event back in 2011 for Oolite 1.75, and even then he expected "VIEW_GUI_SCREEN" to be reported through the event.
I guess this comes down to where we consider the bug to be: in the wiki documentation, or in the code.
Re: Split: viewDirectionChanged woes
Posted: Sat May 24, 2025 12:25 am
by phkb
Actually, there are a couple of discrepancies with how viewDirectionChanged is defined on the wiki. Apart from the issues previously noted, this is how the game is sending the event:
Code: Select all
this.viewDirectionChanged = function(newViewString, oldViewString) {
}
I've got a fix for the game to actually put create an event when the view changes to a gui screen. I think it's better to give developers more info about what's happening.
Re: Split: viewDirectionChanged woes
Posted: Sat May 24, 2025 6:18 am
by Wildeblood
phkb wrote: ↑Sat May 24, 2025 12:25 am
Actually, there are a couple of discrepancies with how viewDirectionChanged is defined on the wiki. Apart from the issues previously noted, this is how the game is sending the event:
Code: Select all
this.viewDirectionChanged = function(newViewString, oldViewString) {
}
To confirm, are you asserting as a representation of fact that: as of current (1.90, 1.91) versions, Oolite is calling viewDirectionChanged with two parameters (to, from) the way it used to back in 1.75? ... [Checks wiki page.] ... Well, you've changed the wiki entry, so I guess that is what you're saying. ... [Checks wiki history.] ... Good grief! It was Kaks, himself, who documented it incorrectly at the outset, and no one has ever corrected it.
phkb wrote: ↑Sat May 24, 2025 12:25 am
I've got a fix for the game to actually put create an event when the view changes to a gui screen. I think it's better to give developers more info about what's happening.
We already have that, e.g.
guiScreenChanged("GUI_SCREEN_STATUS", "GUI_SCREEN_MAIN")
No need for duplication. That was what caused the confusion around viewDirectionChanged, it was - in part - duplicating an existing event.