Added support for editor.msg to message_str_game

Edits to header files.
This commit is contained in:
NovaRain
2022-08-09 08:12:54 +08:00
parent 050af07b3b
commit c878d17a2b
5 changed files with 11 additions and 9 deletions
+5 -2
View File
@@ -121,9 +121,12 @@
#define MSGBOX_YESNO (0x10) // use YES/NO buttons instead of DONE
#define MSGBOX_CLEAN (0x20) // no buttons
// remove inven obj defines for the 4th argument to HOOK_REMOVEINVOBJ
// Some possible defines for the 4th argument to HOOK_REMOVEINVOBJ
#define RMOBJ_DROP 4831349 // If the object is dropped manually by the player from the inventory screen
#define RMOBJ_TRADE 4683293 // If the object is offered up as a trade
#define RMOBJ_DROPMULTI 4571599 // When dropping a part of a stack (RMOBJ_DROP occurs first)
#define RMOBJ_CONSUME_DRUG 4666772 // (inven_action_cursor_)
#define RMOBJ_CONTAINER 4683293 // same as RMOBJ_TRADE (item_move_func_)
//#define RMOBJ_CONTAINER 4683293 // same as RMOBJ_TRADE (item_move_func_)
#define RMOBJ_USE_OBJ 4666865 // (inven_action_cursor_)
#define RMOBJ_EQUIP_ARMOR 4658121 // (inven_pickup_)
#define RMOBJ_EQUIP_WEAPON 4658675 // (switch_hand_)
+2 -5
View File
@@ -125,11 +125,6 @@
#define ATKTYPE_HOOKKICK (18)
#define ATKTYPE_PIERCINGKICK (19)
// Some possible values for the 4th argument to hs_removeinvobj
#define RMOBJ_DROP (0x49B875) // If the object is dropped manually by the player from the inventory screen
#define RMOBJ_TRADE (0x47761D) // If the object is offered up as a trade
#define RMOBJ_DROPMULTI (0x45C1CF) // When dropping a part of a stack (RMOBJ_DROP occurs first)
// Return values for "typeof"
#define VALTYPE_NONE (0) // not used yet
#define VALTYPE_INT (1)
@@ -212,6 +207,7 @@
#define GAME_MSG_STAT (17)
#define GAME_MSG_TRAIT (18)
#define GAME_MSG_WORLDMAP (19)
#define GAME_MSG_EDITOR (20)
#define GAME_MSG_PRO_ITEM (0x1000)
#define GAME_MSG_PRO_CRIT (0x1001)
#define GAME_MSG_PRO_SCEN (0x1002)
@@ -257,6 +253,7 @@
#define mstr_stat(x) (message_str_game(GAME_MSG_STAT, x))
#define mstr_trait(x) (message_str_game(GAME_MSG_TRAIT, x))
#define mstr_worldmap(x) (message_str_game(GAME_MSG_WORLDMAP, x))
#define mstr_character(x) (message_str_game(GAME_MSG_EDITOR, x))
#define BLOCKING_TYPE_BLOCK (0)
+2 -1
View File
@@ -50,7 +50,8 @@ const fo::MessageList* Message::gameMsgFiles[] = {
CASTMSG(MSG_FILE_SKILLDEX),
CASTMSG(MSG_FILE_STAT),
CASTMSG(MSG_FILE_TRAIT),
CASTMSG(MSG_FILE_WORLDMAP)
CASTMSG(MSG_FILE_WORLDMAP),
CASTMSG(MSG_FILE_EDITOR)
};
#undef CASTMSG
+1
View File
@@ -49,6 +49,7 @@ namespace sfall
#define MSG_FILE_STAT (0x66817C)
#define MSG_FILE_TRAIT (0x66BE38)
#define MSG_FILE_WORLDMAP (0x672FB0)
#define MSG_FILE_EDITOR (0x56FCA8)
typedef std::unordered_map<int, std::unique_ptr<fo::MessageList>> ExtraGameMessageListsMap;
+1 -1
View File
@@ -348,7 +348,7 @@ void op_message_str_game(OpcodeContext& ctx) {
int fileId = ctx.arg(0).rawValue();
if (fileId >= 0) {
int msgId = ctx.arg(1).rawValue();
if (fileId < 20) { // main msg files
if (fileId <= 20) { // main msg files
msg = fo::util::GetMessageStr(Message::gameMsgFiles[fileId], msgId);
} else if (fileId >= 0x1000 && fileId <= 0x1005) { // proto msg files
msg = fo::util::GetMessageStr(&fo::var::proto_msg_files[fileId - 0x1000], msgId);