Rewrote and rename "dialog_box" to "message_box"

Added support for '\n' control character to create_message_window.

Fix the playback of the speech sound file for the death screen.
This commit is contained in:
NovaRain
2020-01-28 13:14:58 +08:00
parent 893847cc6a
commit 408661f42b
8 changed files with 99 additions and 71 deletions
+1 -1
View File
@@ -244,7 +244,6 @@
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
#define create_win_flag(winName, x, y, w, h, flag) sfall_func6("create_win", winName, x, y, w, h, flag)
#define critter_inven_obj2(obj, type) sfall_func2("critter_inven_obj2", obj, type)
#define dialog_box(text) sfall_func1("dialog_box", text)
#define dialog_obj sfall_func0("dialog_obj")
#define display_stats sfall_func0("display_stats")
#define draw_image(pathFile, frame, x, y, noTrans) sfall_func5("draw_image", pathFile, frame, x, y, noTrans)
@@ -273,6 +272,7 @@
#define item_weight(obj) sfall_func1("item_weight", obj)
#define lock_is_jammed(obj) sfall_func1("lock_is_jammed", obj)
#define loot_obj sfall_func0("loot_obj")
#define message_box(text) sfall_func1("message_box", text)
#define metarule_exist(metaruleName) sfall_func1("metarule_exist", metaruleName)
#define npc_engine_level_up(toggle) sfall_func1("npc_engine_level_up", toggle)
#define obj_under_cursor(onlyCritter, includeDude) sfall_func2("obj_under_cursor", onlyCritter, includeDude)
+6 -5
View File
@@ -623,12 +623,13 @@ optional arguments:
- sets a floating text for a town on the world map when hovering the cursor over the player's marker
- areaID: the ID number of the town from city.txt
> int sfall_func1("dialog_box", string text1)
> int sfall_func2("dialog_box", string text1, string text2)
> int sfall_func3("dialog_box", string text1, string text2, string text3)
- creates a dialog box with text and returns the result of pressing the button: 0 - No, 1 - Yes
- text1/text2/text3: corresponding text in the dialog box for the first, second, and third lines
> int sfall_func4("message_box", string message, int flags, int color1, int color2)
- creates a dialog box with text and returns the result of pressing the button: 0 - No, 1 - Yes/Done
- returns -1 if for some reason the dialog box cannot be created
- message: the text in the dialog box. Use the \n control character to move text to a new line (example: "Hello\nWorld!")
optional arguments:
- flags: mode flags (see DIALOGOUT_* constants in define_extra.h). Pass -1 to skip setting the flags (default flags are DIALOGOUT_NORMAL|DIALOGOUT_YESNO)
- color1/2: the color index in Fallout palette. color1 sets the text color for the first line, and color2 for all subsequent lines of text (default color is 145)
------------------------
------ MORE INFO -------