Add textbuttons() script command, make Violet's ENTER dialogue dynamic

Violet's dialogue now looks like this:

squeak(purple)
text(purple,0,0,2)
Remember that you can press {b_map}
to check where you are on the map!
position(purple,above)
textbuttons()
speak_active

The new textbuttons() command sets the next textbox to replace {b_map}
with the map button, and {b_int} with the interact button. The
remaining keys would be added as soon as they need to be added to
ActionSets.h as well.
This commit is contained in:
Dav999-v
2023-03-18 22:31:13 +01:00
committed by Misa Elizabeth Kai
parent 3354a1a352
commit 620365614d
8 changed files with 75 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
#include <limits.h>
#include <SDL_timer.h>
#include "Alloc.h"
#include "Constants.h"
#include "CustomLevels.h"
#include "Editor.h"
@@ -48,6 +49,7 @@ scriptclass::scriptclass(void)
textpad_right = 0;
textpadtowidth = 0;
textcase = 1;
textbuttons = false;
textlarge = false;
}
@@ -798,6 +800,12 @@ void scriptclass::run(void)
|| key.isDown(KEYBOARD_UP) || key.isDown(KEYBOARD_DOWN)) game.jumpheld = true;
}
game.backgroundtext = false;
if (textbuttons)
{
graphics.textboxbuttons();
}
textbuttons = false;
}
else if (words[0] == "endtext")
{
@@ -2427,6 +2435,11 @@ void scriptclass::run(void)
}
}
}
else if (words[0] == "textbuttons")
{
// Parse buttons in the next textbox
textbuttons = true;
}
else if (words[0] == "textcase")
{
// Used to disambiguate identical textboxes for translations (1 by default)