Better editing for talk node keys #548

Merged
NQNStudios merged 5 commits from talk-keys into master 2025-02-02 18:57:55 +00:00
NQNStudios commented 2025-01-24 02:39:13 +00:00 (Migrated from github.com)

This is a more involved change than anything in my other scenedit PR.

I really don't like the way the 2 talk node keys are handled in the editor. Filling the fields with 4 spaces, expecting the designer to delete them and put in 4 other characters... just awkward. Also, 'purc' is impossible to remember and I never will.

New behavior is:

  • The fields start out empty, and it is allowed to keep one of them empty. (A node only needs one key to be useful, right?
  • When the node is saved, empty strings are replaced with " ". If this is not harmless to the game logic, then I'll need to make the game aware that either key might be " ".
  • You cannot type more than 4 characters in these fields (unless there's a way to insert characters I'm not aware of).
  • If you put 'buy' in a field, it automatically becomes 'purc'.
  • There is a note next to the response keys (kind of squished in the corner) enumerating the special logic of the in-game Buy and Sell buttons.
  • My other scenedit PR should be merged first, because these notes overlap with a message that I removed in the other PR. If both PRs are merged it will look like this:
Screenshot 2025-01-23 at 8 09 12 PM
This is a more involved change than anything in my other scenedit PR. I really don't like the way the 2 talk node keys are handled in the editor. Filling the fields with 4 spaces, expecting the designer to delete them and put in 4 other characters... just awkward. Also, 'purc' is impossible to remember and I never will. New behavior is: * The fields start out empty, and it is *allowed* to keep *one of them* empty. (A node only needs one key to be useful, right? * When the node is saved, empty strings are replaced with `" "`. If this is not harmless to the game logic, then I'll need to make the game aware that either key might be `" "`. * You cannot type more than 4 characters in these fields (unless there's a way to insert characters I'm not aware of). * If you put 'buy' in a field, it automatically becomes 'purc'. * There is a note next to the response keys (kind of squished in the corner) enumerating the special logic of the in-game Buy and Sell buttons. * My other scenedit PR should be merged first, because these notes overlap with a message that I removed in the other PR. If both PRs are merged it will look like this: <img width="767" alt="Screenshot 2025-01-23 at 8 09 12 PM" src="https://github.com/user-attachments/assets/e7ab0c6e-7b11-4106-8d05-282c907a0a3d" />
NQNStudios commented 2025-01-24 03:10:08 +00:00 (Migrated from github.com)

And I just realized we might as well de-capitalize letters automatically. So that's done.

And I just realized we might as well de-capitalize letters automatically. So that's done.
NQNStudios commented 2025-01-24 16:48:22 +00:00 (Migrated from github.com)

Copy/Paste is something worth making sure can't violate the new maxChars limit in field.cpp

Copy/Paste is something worth making sure can't violate the new maxChars limit in field.cpp
NQNStudios commented 2025-01-25 00:48:22 +00:00 (Migrated from github.com)

I just tested copy/paste on Mac in the max-chars fields... and discovered that copy/paste isn't working in any text field. So I'll make a note of that somewhere else.

I just tested copy/paste on Mac in the max-chars fields... and discovered that copy/paste isn't working in *any* text field. So I'll make a note of that somewhere else.
CelticMinstrel (Migrated from github.com) reviewed 2025-01-26 15:39:25 +00:00
@@ -93,0 +93,4 @@
/// Setting maxChars AFTER the player has a chance to type in the field would be a bad idea.
/// So would calling setText() with a string longer than maxChars.
/// Really, it should probably only be set in xml, as the attribute "max-chars".
int maxChars = -1;
CelticMinstrel (Migrated from github.com) commented 2025-01-26 15:39:24 +00:00

I wouldn't call it a priority to have a runtime setter for maxChars, but I don't think it's something that's difficult to do – it could just truncate the current text to the new maximum length. Similarly, setText() could truncate the text to the current maximum length.

I wouldn't call it a priority to have a runtime setter for `maxChars`, but I don't think it's something that's difficult to do – it could just truncate the current text to the new maximum length. Similarly, `setText()` could truncate the text to the current maximum length.
Sign in to join this conversation.
No description provided.