Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: in Dialog Script, style all the dialog-specific keywords #2558

Open
ivan-mogilko opened this issue Oct 28, 2024 · 0 comments
Open

Editor: in Dialog Script, style all the dialog-specific keywords #2558

ivan-mogilko opened this issue Oct 28, 2024 · 0 comments
Labels
context: dialogs dialogs and dialog script context: ui/ux what: editor related to the game editor

Comments

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Oct 28, 2024

Currently only 2 dialog-specific keywords are styled properly in a dialog script: "return" and "stop".

Following is a full list of dialog keywords supported by a dialog compiler in AGS 3.* (many of them may be deprecated in AGS 4 though):

  • return
  • stop
  • goto-dialog
  • goto-previous
  • option-on
  • option-off
  • option-off-forever
  • run-script
  • set-speech-view
  • set-globalint
  • play-sound
  • add-inv
  • lose-inv
  • new-room
  • give-score

Although DialogEditor gathers dialog keywords, they are not applied to scintilla, and instead these 2 "return" and "stop" are hardcoded inside ScintillaWrapper:

if (!onScriptLine && stylingMode == Style.Cpp.Word2) // before colon
{
if (lastword.Trim() == "return" || lastword.Trim() == "stop") newMode = Style.Cpp.Word;
}

This does not have to be so, and it might be possible to fill full list of dialog keywords, and match them in same way as standard script keywords are matched:

if (onScriptLine && _keywords.Contains(lastword.Trim())) newMode = Style.Cpp.Word;

The problem here is that majority of dialog keywords have a non-standard syntax, they contain hyphen, which is not considered a valid keyword character by a standard parser. This has to be taken into account somehow, to ensure that only potential dialog keyword is parsed with a hyphen, and keywords in regular script within a dialog are not.

@ivan-mogilko ivan-mogilko added what: editor related to the game editor context: ui/ux context: dialogs dialogs and dialog script labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: dialogs dialogs and dialog script context: ui/ux what: editor related to the game editor
Projects
None yet
Development

No branches or pull requests

1 participant