Scenedit Quality of life: be helpful when scrolling past boundaries #543

Merged
NQNStudios merged 8 commits from editor-bounds into master 2025-01-23 14:25:36 +00:00
NQNStudios commented 2025-01-21 22:32:23 +00:00 (Migrated from github.com)

I've implemented 2 features here:

  • When scrolling past the boundaries of the current outdoor section, you will get a yes/no prompt which can load the adjacent section for you at the corresponding center position.
  • When scrolling past the boundaries (literal, not the changeable rectangle) of the current town, the editor will ask if you want to jump to the town's entrance in the outdoors. If there are more than one, you can choose.

I did this because I need to be able to find town entrances in the built-in scenarios so I can debug things.

I've implemented 2 features here: * When scrolling past the boundaries of the current outdoor section, you will get a yes/no prompt which can load the adjacent section for you at the corresponding center position. * When scrolling past the boundaries (literal, not the changeable rectangle) of the current town, the editor will ask if you want to jump to the town's entrance in the outdoors. If there are more than one, you can choose. I did this because I need to be able to find town entrances in the built-in scenarios so I can debug things.
CelticMinstrel (Migrated from github.com) reviewed 2025-01-22 00:54:17 +00:00
@@ -440,33 +440,27 @@ static void handle_scenario_args() {
}
CelticMinstrel (Migrated from github.com) commented 2025-01-22 00:54:16 +00:00

No need. If there are multiple entrances, the town should already be set up to properly handle them – if they are in different outdoor sections, there would be a "change outdoor location" special node near each viable exit, for example. And if they're using the "set town exits in town settings" feature, that should also correctly reposition them when they leave town.

So, this code only really matters if there is just one town entrance… though it certainly doesn't hurt to take the first if there are multiple, just in case.

No need. If there are multiple entrances, the town should already be set up to properly handle them – if they are in different outdoor sections, there would be a "change outdoor location" special node near each viable exit, for example. And if they're using the "set town exits in town settings" feature, that should also correctly reposition them when they leave town. So, this code only really matters if there is just one town entrance… though it certainly doesn't hurt to take the first if there are multiple, just in case.
CelticMinstrel (Migrated from github.com) reviewed 2025-01-22 00:58:44 +00:00
CelticMinstrel (Migrated from github.com) commented 2025-01-22 00:58:42 +00:00

Couldn't this also take into account the exit location settings in the town settings?

Couldn't this also take into account the exit location settings in the town settings?
NQNStudios (Migrated from github.com) reviewed 2025-01-22 01:01:38 +00:00
NQNStudios (Migrated from github.com) commented 2025-01-22 01:01:38 +00:00

Oh, yes it could. And those could be added to the string choice dialog

Oh, yes it could. And those could be added to the string choice dialog
NQNStudios (Migrated from github.com) reviewed 2025-01-22 01:04:49 +00:00
NQNStudios (Migrated from github.com) commented 2025-01-22 01:04:49 +00:00

Although it couldn't guarantee that it put you at the exit coordinate in the right outdoor section, if a multi-entrance town changes the section before you leave via special node. It could provide choices between the different sections that contain entrances? But still that might not cover all possibilities if an exit might be in a totally different section set by a special node.

Although it couldn't guarantee that it put you at the exit coordinate in the right outdoor section, if a multi-entrance town changes the section before you leave via special node. It could provide choices between the different sections that contain entrances? But still that might not cover all possibilities if an exit might be in a totally different section set by a special node.
NQNStudios (Migrated from github.com) reviewed 2025-01-22 16:58:03 +00:00
NQNStudios (Migrated from github.com) commented 2025-01-22 16:58:03 +00:00

@CelticMinstrel Given those considerations I don't think the Town Exits feature would be very reliable/good if I did implement it.

@CelticMinstrel Given those considerations I don't think the Town Exits feature would be very reliable/good if I did implement it.
NQNStudios (Migrated from github.com) reviewed 2025-01-22 18:39:51 +00:00
NQNStudios (Migrated from github.com) commented 2025-01-22 18:39:51 +00:00

I guess in the most basic case of only having entrances in one section, it would be nice....

I guess in the most basic case of only having entrances in one section, it would be nice....
CelticMinstrel (Migrated from github.com) reviewed 2025-01-23 00:54:25 +00:00
CelticMinstrel (Migrated from github.com) commented 2025-01-23 00:54:24 +00:00

I think the Town Exits feature should be thought of as a "shortcut" for when all the exits are in the same section. You shouldn't use it when there are exits in multiple sections.

Furthermore, in the most typical use-cases, there will be a town at the location of the Town Exit point, so generally those exits will be found by your normal search.

But that said, it's not necessary for a town to exist at the Town Exit point. The second fort in Exile II is a good example of a town that would probably (if implemented in Blades of Exile) use the Town Exits feature to point to a location in the outdoors that's not itself a town.

So, I think a reasonable conclusion can be: if all the town locations you found are in the same outdoor section, check the Town Exit location for the direction you're exiting in and add it if it isn't already in the list.


By the way, what happens here if there are no entrances to the town?

I think the Town Exits feature should be thought of as a "shortcut" for when all the exits are in the same section. You shouldn't use it when there are exits in multiple sections. Furthermore, in the most typical use-cases, there will be a town at the location of the Town Exit point, so generally those exits will be found by your normal search. But that said, it's not _necessary_ for a town to exist at the Town Exit point. The second fort in Exile II is a good example of a town that would probably (if implemented in Blades of Exile) use the Town Exits feature to point to a location in the outdoors that's not itself a town. So, I think a reasonable conclusion can be: if all the town locations you found are in the same outdoor section, check the Town Exit location for the direction you're exiting in and add it if it isn't already in the list. ---- By the way, what happens here if there are _no_ entrances to the town?
NQNStudios commented 2025-01-23 02:02:03 +00:00 (Migrated from github.com)

That makes sense for the exits.

When there are no entrances, nothing happens. I didn’t add a message for it
or anything.

On Wed, Jan 22, 2025 at 6:54 PM Celtic Minstrel @.***>
wrote:

@.**** commented on this pull request.

In src/scenedit/scen.actions.cpp
https://github.com/calref/cboe/pull/543#discussion_r1926205970:

  •   // In town, prompt whether to go back to outdoor entrance location
    
  •   std::vector<town_entrance_t> town_entrances = scenario.find_town_entrances(cur_town);
    
  •   if(town_entrances.size() == 1){
    
  •   	town_entrance_t only_entrance = town_entrances[0];
    
  •   	cChoiceDlog shift_prompt("shift-town-entrance", {"yes", "no"});
    
  •   	shift_prompt->getControl("out-sec").setText(boost::lexical_cast<std::string>(only_entrance.out_sec));
    
  •   	if(shift_prompt.show() == "yes"){
    
  •   		set_current_out(only_entrance.out_sec);
    
  •   		start_out_edit();
    
  •   		cen_x = only_entrance.loc.x;
    
  •   		cen_y = only_entrance.loc.y;
    
  •   		redraw_screen();
    
  •   		return;
    
  •   	}
    
  •   }else if(town_entrances.size() > 1){
    

I think the Town Exits feature should be thought of as a "shortcut" for
when all the exits are in the same section. You shouldn't use it when there
are exits in multiple sections.

Furthermore, in the most typical use-cases, there will be a town at the
location of the Town Exit point, so generally those exits will be found by
your normal search.

But that said, it's not necessary for a town to exist at the Town Exit
point. The second fort in Exile II is a good example of a town that would
probably (if implemented in Blades of Exile) use the Town Exits feature to
point to a location in the outdoors that's not itself a town.

So, I think a reasonable conclusion can be: if all the town locations you
found are in the same outdoor section, check the Town Exit location for the
direction you're exiting in and add it if it isn't already in the list.

By the way, what happens here if there are no entrances to the town?


Reply to this email directly, view it on GitHub
https://github.com/calref/cboe/pull/543#discussion_r1926205970, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AATXBKLZVJ36WQRLRWMS2ND2MA4VLAVCNFSM6AAAAABVTSCI36VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNRYGYZTAMZTGY
.
You are receiving this because you authored the thread.Message ID:
@.***>

That makes sense for the exits. When there are no entrances, nothing happens. I didn’t add a message for it or anything. On Wed, Jan 22, 2025 at 6:54 PM Celtic Minstrel ***@***.***> wrote: > ***@***.**** commented on this pull request. > ------------------------------ > > In src/scenedit/scen.actions.cpp > <https://github.com/calref/cboe/pull/543#discussion_r1926205970>: > > > + // In town, prompt whether to go back to outdoor entrance location > + std::vector<town_entrance_t> town_entrances = scenario.find_town_entrances(cur_town); > + if(town_entrances.size() == 1){ > + town_entrance_t only_entrance = town_entrances[0]; > + cChoiceDlog shift_prompt("shift-town-entrance", {"yes", "no"}); > + shift_prompt->getControl("out-sec").setText(boost::lexical_cast<std::string>(only_entrance.out_sec)); > + > + if(shift_prompt.show() == "yes"){ > + set_current_out(only_entrance.out_sec); > + start_out_edit(); > + cen_x = only_entrance.loc.x; > + cen_y = only_entrance.loc.y; > + redraw_screen(); > + return; > + } > + }else if(town_entrances.size() > 1){ > > I think the Town Exits feature should be thought of as a "shortcut" for > when all the exits are in the same section. You shouldn't use it when there > are exits in multiple sections. > > Furthermore, in the most typical use-cases, there will be a town at the > location of the Town Exit point, so generally those exits will be found by > your normal search. > > But that said, it's not *necessary* for a town to exist at the Town Exit > point. The second fort in Exile II is a good example of a town that would > probably (if implemented in Blades of Exile) use the Town Exits feature to > point to a location in the outdoors that's not itself a town. > > So, I think a reasonable conclusion can be: if all the town locations you > found are in the same outdoor section, check the Town Exit location for the > direction you're exiting in and add it if it isn't already in the list. > ------------------------------ > > By the way, what happens here if there are *no* entrances to the town? > > — > Reply to this email directly, view it on GitHub > <https://github.com/calref/cboe/pull/543#discussion_r1926205970>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AATXBKLZVJ36WQRLRWMS2ND2MA4VLAVCNFSM6AAAAABVTSCI36VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKNRYGYZTAMZTGY> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
CelticMinstrel commented 2025-01-23 03:23:44 +00:00 (Migrated from github.com)

It just stops scrolling?

It just stops scrolling?
NQNStudios commented 2025-01-23 12:02:32 +00:00 (Migrated from github.com)

Yes.

On Wed, Jan 22, 2025 at 9:24 PM Celtic Minstrel @.***>
wrote:

It just stops scrolling?


Reply to this email directly, view it on GitHub
https://github.com/calref/cboe/pull/543#issuecomment-2608766736, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AATXBKPCZNNNYMH3PWN4J332MBOFLAVCNFSM6AAAAABVTSCI36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYG43DMNZTGY
.
You are receiving this because you authored the thread.Message ID:
@.***>

Yes. On Wed, Jan 22, 2025 at 9:24 PM Celtic Minstrel ***@***.***> wrote: > It just stops scrolling? > > — > Reply to this email directly, view it on GitHub > <https://github.com/calref/cboe/pull/543#issuecomment-2608766736>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AATXBKPCZNNNYMH3PWN4J332MBOFLAVCNFSM6AAAAABVTSCI36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYG43DMNZTGY> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Sign in to join this conversation.
No description provided.