Split: viewDirectionChanged woes

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5106
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Split: viewDirectionChanged woes

Post 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.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5106
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Split: viewDirectionChanged woes

Post 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.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2726
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Split: viewDirectionChanged woes

Post 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. :shock:
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.
Make pteridomania great again!
Post Reply