From 311e1c1c583b2d0584f78266543ae2547170fe4c Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:21:14 +0000 Subject: [PATCH 01/27] Update sprites.h --- src/sprites.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/sprites.h b/src/sprites.h index d08d69b8e4..a8ce9994c8 100644 --- a/src/sprites.h +++ b/src/sprites.h @@ -753,7 +753,56 @@ enum GUIPanelSprite { GPS_rpanel_manufacture_cant = 839, GPS_portrt_qmark = 840, - GUI_PANEL_SPRITES_COUNT = 900, + // additional colour ! icons + // not set up to flash, don't want to distract from heart attack message. + GPS_message_rpanel_msg_exclam_blue_std = 261, // default blue. + GPS_message_rpanel_msg_exclam_brown_std = 850, + GPS_message_rpanel_msg_exclam_green_std = 852, // dull green, like dragons. + GPS_message_rpanel_msg_exclam_grey_std = 854, + GPS_message_rpanel_msg_exclam_orange_std = 856, + GPS_message_rpanel_msg_exclam_pgreen_std = 858, // bright green, "player green". + GPS_message_rpanel_msg_exclam_purple_std = 860, + GPS_message_rpanel_msg_exclam_red_std = 834, // used already for heart attack. + GPS_message_rpanel_msg_exclam_white_std = 862, + GPS_message_rpanel_msg_exclam_yellow_std = 864, + + // additional colour i icons + // not sure if names are weird here - usually _act refers to when clicked, but I wanted to make it clearer + // when distinguising between flashing and non-flashing. Maybe _lit is better? + GPS_message_rpanel_msg_info_blue_std = 866, // default normal message icon, but _act is new so need to be paired. + GPS_message_rpanel_msg_info_blue_act = 868, // blue lit icon. + GPS_message_rpanel_msg_info_brown_std = 870, + GPS_message_rpanel_msg_info_brown_act = 872, + GPS_message_rpanel_msg_info_green_std = 874, + GPS_message_rpanel_msg_info_green_act = 876, + GPS_message_rpanel_msg_info_grey_std = 878, + GPS_message_rpanel_msg_info_grey_act = 880, + GPS_message_rpanel_msg_info_orange_std = 882, + GPS_message_rpanel_msg_info_orange_act = 884, + GPS_message_rpanel_msg_info_pgreen_std = 269, // default INFORMATION message. + GPS_message_rpanel_msg_info_pgreen_act = 271, // default INFORMATION message, lit. + GPS_message_rpanel_msg_info_purple_std = 886, + GPS_message_rpanel_msg_info_purple_act = 888, + GPS_message_rpanel_msg_info_red_std = 890, + GPS_message_rpanel_msg_info_red_act = 892, + GPS_message_rpanel_msg_info_white_std = 894, + GPS_message_rpanel_msg_info_white_act = 896, + GPS_message_rpanel_msg_info_yellow_std = 898, + GPS_message_rpanel_msg_info_yellow_act = 900, + + // additional colour ? icons + GPS_message_rpanel_msg_questn_blue_std = 902, + GPS_message_rpanel_msg_questn_brown_std = 904, + GPS_message_rpanel_msg_questn_green_std = 906, + GPS_message_rpanel_msg_questn_grey_std = 908, + GPS_message_rpanel_msg_questn_orange_std = 910, + GPS_message_rpanel_msg_questn_pgreen_std = 259, // default OBJECTIVE message. + GPS_message_rpanel_msg_questn_purple_std = 912, + GPS_message_rpanel_msg_questn_red_std = 914, + GPS_message_rpanel_msg_questn_white_std = 916, + GPS_message_rpanel_msg_questn_yellow_std = 918, + + GUI_PANEL_SPRITES_COUNT = 1000, GUI_PANEL_SPRITES_NEW = 512, }; From fafb7114c8a340d96ef73e10817c95feab66eb2c Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Wed, 18 Mar 2026 02:26:50 +0000 Subject: [PATCH 02/27] more setup for these set up objectives to be unique per colour for now, not sure a better way to do it. Need to set up OBJECTIVE/INFORMATION (and make WARNING which should just be similar to INFORMATION), extra argument should specify colour and link to sprite and, for objective, EvKind_Objective[Colour]. --- src/frontend.cpp | 101 ++++++++++++++++++++++++-------------- src/lvl_script_commands.c | 10 ++-- src/lvl_script_lib.h | 2 + src/map_events.h | 9 ++++ src/sprites.h | 80 +++++++++++++++--------------- 5 files changed, 122 insertions(+), 80 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index e42dd8348b..243f9c01e2 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -331,42 +331,71 @@ struct FrontEndButtonData frontend_button_info[FRONTEND_BUTTON_INFO_COUNT] = { // bttn_sprite, tooltip_stridx, msg_stridx, lifespan_turns, turns_between_events, replace_event_kind_button; struct EventTypeInfo event_button_info[] = { - {GPS_message_rpanel_msg_exclam_act, GUIStr_Empty, GUIStr_Empty, 1, 1, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventDnHeartAttackedDesc, GUIStr_EventHeartAttacked, 300, 250, EvKind_Nothing}, - {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_FriendlyFight}, - {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventBreachDesc, GUIStr_EventBreach, 300, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_room_act, GUIStr_EventNewRoomResrchDesc, GUIStr_EventNewRoomResearched, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_creatr_act, GUIStr_EventNewCreatureDesc, GUIStr_EventNewCreature, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_spell_act, GUIStr_EventNewSpellResrchDesc, GUIStr_EventNewSpellResearched, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewTrapDesc, GUIStr_EventNewTrap, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewDoorDesc, GUIStr_EventNewDoor, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrScavngDesc, GUIStr_EventScavengingDetected, 1200, 0, EvKind_Nothing}, // EvKind_CreatrScavenged - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTreasrRoomFullDesc, GUIStr_EventTreasureRoomFull, 1200, 500, EvKind_Nothing}, - {GPS_message_rpanel_msg_payday_act, GUIStr_EventCreaturePaydayDesc, GUIStr_EventCreaturePayday, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventAreaDiscoveredDesc, GUIStr_EventAreaDiscovered, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSpellPickedUpDesc, GUIStr_EventNewSpellPickedUp, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventRoomTakenOverDesc, GUIStr_EventNewRoomTakenOver, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrAnnoyedDesc, GUIStr_EventCreatureAnnoyed, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNoMoreLivingSetDesc, GUIStr_EventNoMoreLivingSpace, 1200, 500, EvKind_Nothing}, - {GPS_message_rpanel_msg_alarm_act, GUIStr_EventAlarmTriggeredDesc, GUIStr_EventAlarmTriggered, 300, 200, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomUnderAttackDesc, GUIStr_EventRoomUnderAttack, 300, 250, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNeedTreasrRoomDesc, GUIStr_EventTreasureRoomNeeded, 300, 500, EvKind_Nothing}, // EvKind_NeedTreasureRoom - {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomLostDesc, GUIStr_EventRoomLost, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreaturesHungryDesc, GUIStr_EventCreaturesHungry, 300, 500, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTrapCrateFoundDesc, GUIStr_EventTrapCrateFound, 300, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventDoorCrateFoundDesc, GUIStr_EventDoorCrateFound, 300, 0, EvKind_Nothing}, // EvKind_DoorCrateFound - {GPS_message_rpanel_msg_bonusbox_act, GUIStr_EventDnSpecialFoundDesc, GUIStr_EventDnSpecialFound, 300, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_EnemyFight}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWorkRoomUnreachblDesc, GUIStr_EventWorkRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_WorkRoomUnreachable - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventStorgRoomUnreachblDesc, GUIStr_EventStorgRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_StorageRoomUnreachable - {0, GUIStr_Empty, GUIStr_Empty, 50, 10, EvKind_Nothing}, // EvKind_PrisonerStarving - {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_TorturedHurt - {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_EnemyDoor - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSecretDoorDiscovDesc, GUIStr_EventSecretDoorDiscovered,300, 200, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventSecretDoorSpottedDesc, GUIStr_EventSecretDoorSpotted, 300, 200, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_Empty, GUIStr_Empty, 1, 1, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventDnHeartAttackedDesc, GUIStr_EventHeartAttacked, 300, 250, EvKind_Nothing}, + {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_FriendlyFight}, + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventBreachDesc, GUIStr_EventBreach, 300, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_room_act, GUIStr_EventNewRoomResrchDesc, GUIStr_EventNewRoomResearched, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_creatr_act, GUIStr_EventNewCreatureDesc, GUIStr_EventNewCreature, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_spell_act, GUIStr_EventNewSpellResrchDesc, GUIStr_EventNewSpellResearched, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewTrapDesc, GUIStr_EventNewTrap, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewDoorDesc, GUIStr_EventNewDoor, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrScavngDesc, GUIStr_EventScavengingDetected, 1200, 0, EvKind_Nothing}, // EvKind_CreatrScavenged + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTreasrRoomFullDesc, GUIStr_EventTreasureRoomFull, 1200, 500, EvKind_Nothing}, + {GPS_message_rpanel_msg_payday_act, GUIStr_EventCreaturePaydayDesc, GUIStr_EventCreaturePayday, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventAreaDiscoveredDesc, GUIStr_EventAreaDiscovered, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSpellPickedUpDesc, GUIStr_EventNewSpellPickedUp, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventRoomTakenOverDesc, GUIStr_EventNewRoomTakenOver, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrAnnoyedDesc, GUIStr_EventCreatureAnnoyed, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNoMoreLivingSetDesc, GUIStr_EventNoMoreLivingSpace, 1200, 500, EvKind_Nothing}, + {GPS_message_rpanel_msg_alarm_act, GUIStr_EventAlarmTriggeredDesc, GUIStr_EventAlarmTriggered, 300, 200, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomUnderAttackDesc, GUIStr_EventRoomUnderAttack, 300, 250, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNeedTreasrRoomDesc, GUIStr_EventTreasureRoomNeeded, 300, 500, EvKind_Nothing}, // EvKind_NeedTreasureRoom + {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomLostDesc, GUIStr_EventRoomLost, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreaturesHungryDesc, GUIStr_EventCreaturesHungry, 300, 500, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTrapCrateFoundDesc, GUIStr_EventTrapCrateFound, 300, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventDoorCrateFoundDesc, GUIStr_EventDoorCrateFound, 300, 0, EvKind_Nothing}, // EvKind_DoorCrateFound + {GPS_message_rpanel_msg_bonusbox_act, GUIStr_EventDnSpecialFoundDesc, GUIStr_EventDnSpecialFound, 300, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_EnemyFight}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWorkRoomUnreachblDesc, GUIStr_EventWorkRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_WorkRoomUnreachable + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventStorgRoomUnreachblDesc, GUIStr_EventStorgRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_StorageRoomUnreachable + {0, GUIStr_Empty, GUIStr_Empty, 50, 10, EvKind_Nothing}, // EvKind_PrisonerStarving + {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_TorturedHurt + {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_EnemyDoor + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSecretDoorDiscovDesc, GUIStr_EventSecretDoorDiscovered,300, 200, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventSecretDoorSpottedDesc, GUIStr_EventSecretDoorSpotted, 300, 200, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_blue_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // looks like default but flashes + {GPS_message_rpanel_msg_info_brown_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_green_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_grey_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_orange_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_purple_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_red_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_white_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_info_yellow_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_brown_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_green_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_grey_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_orange_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_pgreen_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_purple_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_white_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_yellow_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_questn_blue_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveBlue}, // give each colour its own objective slot for now. + {GPS_message_rpanel_msg_questn_brown_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveBrown}, + {GPS_message_rpanel_msg_questn_green_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveGreen}, + {GPS_message_rpanel_msg_questn_grey_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveGrey}, + {GPS_message_rpanel_msg_questn_orange_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveOrange}, + {GPS_message_rpanel_msg_questn_purple_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectivePurple}, + {GPS_message_rpanel_msg_questn_red_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveRed}, + {GPS_message_rpanel_msg_questn_white_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveWhite}, + {GPS_message_rpanel_msg_questn_yellow_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveYellow}, }; const unsigned long alliance_grid[4][4] = { diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 1f7f2e2e99..51dce6c35c 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -6382,10 +6382,12 @@ const struct CommandDesc command_desc[] = { {"ALLY_PLAYERS", "PPN ", Cmd_ALLY_PLAYERS, NULL, NULL}, {"DEAD_CREATURES_RETURN_TO_POOL", "B ", Cmd_DEAD_CREATURES_RETURN_TO_POOL, NULL, NULL}, {"BONUS_LEVEL_TIME", "Nb ", Cmd_BONUS_LEVEL_TIME, NULL, NULL}, - {"QUICK_OBJECTIVE", "NAl ", Cmd_QUICK_OBJECTIVE, NULL, NULL}, - {"QUICK_INFORMATION", "NAl ", Cmd_QUICK_INFORMATION, NULL, NULL}, - {"QUICK_OBJECTIVE_WITH_POS", "NANN ", Cmd_QUICK_OBJECTIVE_WITH_POS, NULL, NULL}, - {"QUICK_INFORMATION_WITH_POS", "NANN ", Cmd_QUICK_INFORMATION_WITH_POS, NULL, NULL}, + {"QUICK_OBJECTIVE", "NAla ", Cmd_QUICK_OBJECTIVE, NULL, NULL}, + {"QUICK_INFORMATION", "NAla ", Cmd_QUICK_INFORMATION, NULL, NULL}, + {"QUICK_WARNING", "NAla ", Cmd_QUICK_WARNING, NULL, NULL}, + {"QUICK_OBJECTIVE_WITH_POS", "NANNa ", Cmd_QUICK_OBJECTIVE_WITH_POS, NULL, NULL}, + {"QUICK_INFORMATION_WITH_POS", "NANNa ", Cmd_QUICK_INFORMATION_WITH_POS, NULL, NULL}, + {"QUICK_WARNING_WITH_POS", "NANNa ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, {"SWAP_CREATURE", "CC ", Cmd_SWAP_CREATURE, &swap_creature_check, &swap_creature_process}, {"PRINT", "A ", Cmd_PRINT, NULL, NULL}, {"MESSAGE", "A ", Cmd_MESSAGE, NULL, NULL}, diff --git a/src/lvl_script_lib.h b/src/lvl_script_lib.h index b95e49654d..d10b8d93b4 100644 --- a/src/lvl_script_lib.h +++ b/src/lvl_script_lib.h @@ -197,6 +197,8 @@ enum TbScriptCommands { Cmd_SHOW_BONUS_LEVEL = 185, Cmd_HIDE_BONUS_LEVEL = 186, Cmd_HIDE_HERO_GATE = 187, + Cmd_QUICK_WARNING = 188, + Cmd_QUICK_WARNING_WITH_POS = 189, }; struct ScriptLine { diff --git a/src/map_events.h b/src/map_events.h index dfa2f6bf87..f141ce81eb 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -68,6 +68,15 @@ enum EventKinds { EvKind_EnemyDoor, // ComputerKeeper: DoorAtck1 [event20] --> attacks enemy doors EvKind_SecretDoorDiscovered, EvKind_SecretDoorSpotted, + EvKind_ObjectiveBlue, + EvKind_ObjectiveBrown, + EvKind_ObjectiveGreen, + EvKind_ObjectiveGrey, + EvKind_ObjectiveOrange, + EvKind_ObjectivePurple, + EvKind_ObjectiveRed, + EvKind_ObjectiveWhite, + EvKind_ObjectiveYellow, }; enum EventFlags { diff --git a/src/sprites.h b/src/sprites.h index a8ce9994c8..e611b579ee 100644 --- a/src/sprites.h +++ b/src/sprites.h @@ -755,52 +755,52 @@ enum GUIPanelSprite { // additional colour ! icons // not set up to flash, don't want to distract from heart attack message. - GPS_message_rpanel_msg_exclam_blue_std = 261, // default blue. - GPS_message_rpanel_msg_exclam_brown_std = 850, - GPS_message_rpanel_msg_exclam_green_std = 852, // dull green, like dragons. - GPS_message_rpanel_msg_exclam_grey_std = 854, - GPS_message_rpanel_msg_exclam_orange_std = 856, - GPS_message_rpanel_msg_exclam_pgreen_std = 858, // bright green, "player green". - GPS_message_rpanel_msg_exclam_purple_std = 860, - GPS_message_rpanel_msg_exclam_red_std = 834, // used already for heart attack. - GPS_message_rpanel_msg_exclam_white_std = 862, - GPS_message_rpanel_msg_exclam_yellow_std = 864, + GPS_message_rpanel_msg_exclam_blue_act = 260, // default blue. + GPS_message_rpanel_msg_exclam_brown_act = 849, + GPS_message_rpanel_msg_exclam_green_act = 851, // dull green, like dragons. + GPS_message_rpanel_msg_exclam_grey_act = 853, + GPS_message_rpanel_msg_exclam_orange_act = 855, + GPS_message_rpanel_msg_exclam_pgreen_act = 857, // bright green, "player green". + GPS_message_rpanel_msg_exclam_purple_act = 859, + GPS_message_rpanel_msg_exclam_red_act = 834, // used already for heart attack. + GPS_message_rpanel_msg_exclam_white_act = 861, + GPS_message_rpanel_msg_exclam_yellow_act = 863, // additional colour i icons // not sure if names are weird here - usually _act refers to when clicked, but I wanted to make it clearer // when distinguising between flashing and non-flashing. Maybe _lit is better? - GPS_message_rpanel_msg_info_blue_std = 866, // default normal message icon, but _act is new so need to be paired. - GPS_message_rpanel_msg_info_blue_act = 868, // blue lit icon. - GPS_message_rpanel_msg_info_brown_std = 870, - GPS_message_rpanel_msg_info_brown_act = 872, - GPS_message_rpanel_msg_info_green_std = 874, - GPS_message_rpanel_msg_info_green_act = 876, - GPS_message_rpanel_msg_info_grey_std = 878, - GPS_message_rpanel_msg_info_grey_act = 880, - GPS_message_rpanel_msg_info_orange_std = 882, - GPS_message_rpanel_msg_info_orange_act = 884, - GPS_message_rpanel_msg_info_pgreen_std = 269, // default INFORMATION message. - GPS_message_rpanel_msg_info_pgreen_act = 271, // default INFORMATION message, lit. - GPS_message_rpanel_msg_info_purple_std = 886, - GPS_message_rpanel_msg_info_purple_act = 888, - GPS_message_rpanel_msg_info_red_std = 890, - GPS_message_rpanel_msg_info_red_act = 892, - GPS_message_rpanel_msg_info_white_std = 894, - GPS_message_rpanel_msg_info_white_act = 896, - GPS_message_rpanel_msg_info_yellow_std = 898, - GPS_message_rpanel_msg_info_yellow_act = 900, + GPS_message_rpanel_msg_info_blue_act = 865, // default normal message icon, but _act is new so need to be paired. + GPS_message_rpanel_msg_info_blue_lit_act = 867, // blue lit icon. + GPS_message_rpanel_msg_info_brown_act = 869, + GPS_message_rpanel_msg_info_brown_lit_act = 871, + GPS_message_rpanel_msg_info_green_act = 873, + GPS_message_rpanel_msg_info_green_lit_act = 875, + GPS_message_rpanel_msg_info_grey_act = 877, + GPS_message_rpanel_msg_info_grey_lit_act = 879, + GPS_message_rpanel_msg_info_orange_act = 881, + GPS_message_rpanel_msg_info_orange_lit_act = 883, + GPS_message_rpanel_msg_info_pgreen_act = 268, // default INFORMATION message. + GPS_message_rpanel_msg_info_pgreen_lit_act = 270, // default INFORMATION message, lit. + GPS_message_rpanel_msg_info_purple_act = 885, + GPS_message_rpanel_msg_info_purple_lit_act = 887, + GPS_message_rpanel_msg_info_red_act = 889, + GPS_message_rpanel_msg_info_red_lit_act = 891, + GPS_message_rpanel_msg_info_white_act = 893, + GPS_message_rpanel_msg_info_white_lit_act = 895, + GPS_message_rpanel_msg_info_yellow_act = 897, + GPS_message_rpanel_msg_info_yellow_lit_act = 899, // additional colour ? icons - GPS_message_rpanel_msg_questn_blue_std = 902, - GPS_message_rpanel_msg_questn_brown_std = 904, - GPS_message_rpanel_msg_questn_green_std = 906, - GPS_message_rpanel_msg_questn_grey_std = 908, - GPS_message_rpanel_msg_questn_orange_std = 910, - GPS_message_rpanel_msg_questn_pgreen_std = 259, // default OBJECTIVE message. - GPS_message_rpanel_msg_questn_purple_std = 912, - GPS_message_rpanel_msg_questn_red_std = 914, - GPS_message_rpanel_msg_questn_white_std = 916, - GPS_message_rpanel_msg_questn_yellow_std = 918, + GPS_message_rpanel_msg_questn_blue_act = 901, + GPS_message_rpanel_msg_questn_brown_act = 903, + GPS_message_rpanel_msg_questn_green_act = 905, + GPS_message_rpanel_msg_questn_grey_act = 907, + GPS_message_rpanel_msg_questn_orange_act = 909, + GPS_message_rpanel_msg_questn_pgreen_act = 258, // default OBJECTIVE message. + GPS_message_rpanel_msg_questn_purple_act = 911, + GPS_message_rpanel_msg_questn_red_act = 913, + GPS_message_rpanel_msg_questn_white_act = 915, + GPS_message_rpanel_msg_questn_yellow_act = 917, GUI_PANEL_SPRITES_COUNT = 1000, GUI_PANEL_SPRITES_NEW = 512, From 97b76772d54366353841f1574c610ee2a6ea5a0b Mon Sep 17 00:00:00 2001 From: Loobinex Date: Wed, 18 Mar 2026 15:15:57 +0100 Subject: [PATCH 03/27] added GUIStr_EventWarningDesc to enum --- src/config_strings.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config_strings.h b/src/config_strings.h index b65ea89cbf..6e316abb8d 100644 --- a/src/config_strings.h +++ b/src/config_strings.h @@ -433,6 +433,7 @@ enum GUIStrings { GUIStr_CtrlAscend = STRINGS_MAX + 1078, GUIStr_CtrlDescend = STRINGS_MAX + 1079, GUIStr_Keeper = STRINGS_MAX + 1082, + GUIStr_EventWarningDesc, //todo add string }; enum CampaignStrings { From 3e8c4824a115174c70e594748d379b18800aa683 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Wed, 18 Mar 2026 15:28:12 +0100 Subject: [PATCH 04/27] Made it build --- src/map_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map_events.h b/src/map_events.h index f141ce81eb..c3bd306887 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -27,7 +27,7 @@ extern "C" { #endif /******************************************************************************/ #define EVENT_BUTTONS_COUNT 12 -#define EVENT_KIND_COUNT 36 +#define EVENT_KIND_COUNT 65 #define EVENTS_COUNT 200 #define INVALID_EVENT &game.event[0] From 3d200f97e19c5b134fdf265d508cc7b35804ae24 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Thu, 19 Mar 2026 01:48:48 +0000 Subject: [PATCH 05/27] added a million entries to EventTypeInfo (sorry) It feels gross doing it this way, hopefully we don't actually have to do this and there's a more compact way. --- src/frontend.cpp | 209 ++++++++++++++++++++++++++++++++--------------- src/map_events.h | 18 ++-- 2 files changed, 152 insertions(+), 75 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index 243f9c01e2..88d96b350e 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -331,71 +331,150 @@ struct FrontEndButtonData frontend_button_info[FRONTEND_BUTTON_INFO_COUNT] = { // bttn_sprite, tooltip_stridx, msg_stridx, lifespan_turns, turns_between_events, replace_event_kind_button; struct EventTypeInfo event_button_info[] = { - {GPS_message_rpanel_msg_exclam_act, GUIStr_Empty, GUIStr_Empty, 1, 1, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventDnHeartAttackedDesc, GUIStr_EventHeartAttacked, 300, 250, EvKind_Nothing}, - {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_FriendlyFight}, - {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventBreachDesc, GUIStr_EventBreach, 300, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_room_act, GUIStr_EventNewRoomResrchDesc, GUIStr_EventNewRoomResearched, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_creatr_act, GUIStr_EventNewCreatureDesc, GUIStr_EventNewCreature, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_spell_act, GUIStr_EventNewSpellResrchDesc, GUIStr_EventNewSpellResearched, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewTrapDesc, GUIStr_EventNewTrap, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewDoorDesc, GUIStr_EventNewDoor, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrScavngDesc, GUIStr_EventScavengingDetected, 1200, 0, EvKind_Nothing}, // EvKind_CreatrScavenged - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTreasrRoomFullDesc, GUIStr_EventTreasureRoomFull, 1200, 500, EvKind_Nothing}, - {GPS_message_rpanel_msg_payday_act, GUIStr_EventCreaturePaydayDesc, GUIStr_EventCreaturePayday, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventAreaDiscoveredDesc, GUIStr_EventAreaDiscovered, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSpellPickedUpDesc, GUIStr_EventNewSpellPickedUp, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventRoomTakenOverDesc, GUIStr_EventNewRoomTakenOver, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrAnnoyedDesc, GUIStr_EventCreatureAnnoyed, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNoMoreLivingSetDesc, GUIStr_EventNoMoreLivingSpace, 1200, 500, EvKind_Nothing}, - {GPS_message_rpanel_msg_alarm_act, GUIStr_EventAlarmTriggeredDesc, GUIStr_EventAlarmTriggered, 300, 200, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomUnderAttackDesc, GUIStr_EventRoomUnderAttack, 300, 250, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNeedTreasrRoomDesc, GUIStr_EventTreasureRoomNeeded, 300, 500, EvKind_Nothing}, // EvKind_NeedTreasureRoom - {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomLostDesc, GUIStr_EventRoomLost, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreaturesHungryDesc, GUIStr_EventCreaturesHungry, 300, 500, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTrapCrateFoundDesc, GUIStr_EventTrapCrateFound, 300, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventDoorCrateFoundDesc, GUIStr_EventDoorCrateFound, 300, 0, EvKind_Nothing}, // EvKind_DoorCrateFound - {GPS_message_rpanel_msg_bonusbox_act, GUIStr_EventDnSpecialFoundDesc, GUIStr_EventDnSpecialFound, 300, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_EnemyFight}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWorkRoomUnreachblDesc, GUIStr_EventWorkRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_WorkRoomUnreachable - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventStorgRoomUnreachblDesc, GUIStr_EventStorgRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_StorageRoomUnreachable - {0, GUIStr_Empty, GUIStr_Empty, 50, 10, EvKind_Nothing}, // EvKind_PrisonerStarving - {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_TorturedHurt - {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_EnemyDoor - {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSecretDoorDiscovDesc, GUIStr_EventSecretDoorDiscovered,300, 200, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventSecretDoorSpottedDesc, GUIStr_EventSecretDoorSpotted, 300, 200, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_blue_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // looks like default but flashes - {GPS_message_rpanel_msg_info_brown_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_green_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_grey_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_orange_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_purple_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_red_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_white_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_info_yellow_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_brown_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_green_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_grey_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_orange_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_pgreen_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_purple_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_white_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_yellow_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {GPS_message_rpanel_msg_questn_blue_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveBlue}, // give each colour its own objective slot for now. - {GPS_message_rpanel_msg_questn_brown_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveBrown}, - {GPS_message_rpanel_msg_questn_green_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveGreen}, - {GPS_message_rpanel_msg_questn_grey_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveGrey}, - {GPS_message_rpanel_msg_questn_orange_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveOrange}, - {GPS_message_rpanel_msg_questn_purple_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectivePurple}, - {GPS_message_rpanel_msg_questn_red_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveRed}, - {GPS_message_rpanel_msg_questn_white_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveWhite}, - {GPS_message_rpanel_msg_questn_yellow_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_ObjectiveYellow}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_Empty, GUIStr_Empty, 1, 1, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventDnHeartAttackedDesc, GUIStr_EventHeartAttacked, 300, 250, EvKind_Nothing}, + {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_FriendlyFight}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventBreachDesc, GUIStr_EventBreach, 300, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_room_act, GUIStr_EventNewRoomResrchDesc, GUIStr_EventNewRoomResearched, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_creatr_act, GUIStr_EventNewCreatureDesc, GUIStr_EventNewCreature, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_spell_act, GUIStr_EventNewSpellResrchDesc, GUIStr_EventNewSpellResearched, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewTrapDesc, GUIStr_EventNewTrap, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_manufct_act, GUIStr_EventNewDoorDesc, GUIStr_EventNewDoor, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrScavngDesc, GUIStr_EventScavengingDetected, 1200, 0, EvKind_Nothing}, // EvKind_CreatrScavenged + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTreasrRoomFullDesc, GUIStr_EventTreasureRoomFull, 1200, 500, EvKind_Nothing}, + {GPS_message_rpanel_msg_payday_act, GUIStr_EventCreaturePaydayDesc, GUIStr_EventCreaturePayday, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventAreaDiscoveredDesc, GUIStr_EventAreaDiscovered, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSpellPickedUpDesc, GUIStr_EventNewSpellPickedUp, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventRoomTakenOverDesc, GUIStr_EventNewRoomTakenOver, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreatrAnnoyedDesc, GUIStr_EventCreatureAnnoyed, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNoMoreLivingSetDesc, GUIStr_EventNoMoreLivingSpace, 1200, 500, EvKind_Nothing}, + {GPS_message_rpanel_msg_alarm_act, GUIStr_EventAlarmTriggeredDesc, GUIStr_EventAlarmTriggered, 300, 200, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomUnderAttackDesc, GUIStr_EventRoomUnderAttack, 300, 250, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNeedTreasrRoomDesc, GUIStr_EventTreasureRoomNeeded, 300, 500, EvKind_Nothing}, // EvKind_NeedTreasureRoom + {rpanel_msg_info_colour[MSG_COLOUR_DEFAULT], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomLostDesc, GUIStr_EventRoomLost, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreaturesHungryDesc, GUIStr_EventCreaturesHungry, 300, 500, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTrapCrateFoundDesc, GUIStr_EventTrapCrateFound, 300, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventDoorCrateFoundDesc, GUIStr_EventDoorCrateFound, 300, 0, EvKind_Nothing}, // EvKind_DoorCrateFound + {GPS_message_rpanel_msg_bonusbox_act, GUIStr_EventDnSpecialFoundDesc, GUIStr_EventDnSpecialFound, 300, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_EnemyFight}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWorkRoomUnreachblDesc, GUIStr_EventWorkRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_WorkRoomUnreachable + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventStorgRoomUnreachblDesc, GUIStr_EventStorgRoomUnreachbl, 1200, 500, EvKind_Nothing}, // EvKind_StorageRoomUnreachable + {0, GUIStr_Empty, GUIStr_Empty, 50, 10, EvKind_Nothing}, // EvKind_PrisonerStarving + {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_TorturedHurt + {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_EnemyDoor + {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSecretDoorDiscovDesc, GUIStr_EventSecretDoorDiscovered,300, 200, EvKind_Nothing}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventSecretDoorSpottedDesc, GUIStr_EventSecretDoorSpotted, 300, 200, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_BLUE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // looks like default but flashes + {rpanel_msg_info_colour[MSG_COLOUR_BROWN], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_GREEN], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_GREY], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_ORANGE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_PGREEN], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_PURPLE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_RED], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_WHITE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_info_colour[MSG_COLOUR_YELLOW], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_DEFAULT], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_BLUE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_BROWN], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_GREEN], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_GREY], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_ORANGE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_PGREEN], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_PURPLE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_RED], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_WHITE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_exclam_colour[MSG_COLOUR_YELLOW], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, // surely there's a better way than listing every combination + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, // of colour and objective number? + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, // 60 + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, // Objective slot 2 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, // Objective slot 3 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, // Objective slot 4 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, // Objective slot 5 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, // Objective slot 6 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, // Objective slot 7 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, + {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, // Objective slot 8 + {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, + {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, }; const unsigned long alliance_grid[4][4] = { diff --git a/src/map_events.h b/src/map_events.h index c3bd306887..ff4377ed6d 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -27,7 +27,7 @@ extern "C" { #endif /******************************************************************************/ #define EVENT_BUTTONS_COUNT 12 -#define EVENT_KIND_COUNT 65 +#define EVENT_KIND_COUNT 144 #define EVENTS_COUNT 200 #define INVALID_EVENT &game.event[0] @@ -68,15 +68,13 @@ enum EventKinds { EvKind_EnemyDoor, // ComputerKeeper: DoorAtck1 [event20] --> attacks enemy doors EvKind_SecretDoorDiscovered, EvKind_SecretDoorSpotted, - EvKind_ObjectiveBlue, - EvKind_ObjectiveBrown, - EvKind_ObjectiveGreen, - EvKind_ObjectiveGrey, - EvKind_ObjectiveOrange, - EvKind_ObjectivePurple, - EvKind_ObjectiveRed, - EvKind_ObjectiveWhite, - EvKind_ObjectiveYellow, + EvKind_Objective2, + EvKind_Objective3, + EvKind_Objective4, + EvKind_Objective5, + EvKind_Objective6, + EvKind_Objective7, + EvKind_Objective8, }; enum EventFlags { From e603663cfe2f0875369c7796bb2d2eba531cbed3 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Fri, 27 Mar 2026 16:30:11 +0000 Subject: [PATCH 06/27] idk lol --- src/frontend.cpp | 57 +++++++++++++++++++++++++++++++++++++++ src/lvl_script_commands.c | 32 +++++++++++++++++----- src/lvl_script_lib.h | 7 +++-- src/main.cpp | 3 ++- 4 files changed, 90 insertions(+), 9 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index 88d96b350e..f35904c5d7 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -484,6 +484,63 @@ const unsigned long alliance_grid[4][4] = { {0x04, 0x10, 0x20, 0x00,}, }; +typedef enum { + MSG_COLOUR_DEFAULT, + MSG_COLOUR_BLUE, + MSG_COLOUR_BROWN, + MSG_COLOUR_GREEN, + MSG_COLOUR_GREY, + MSG_COLOUR_ORANGE, + MSG_COLOUR_PGREEN, + MSG_COLOUR_PURPLE, + MSG_COLOUR_RED, + MSG_COLOUR_WHITE, + MSG_COLOUR_YELLOW, + MSG_COLOUR_COUNT +} MsgColour; + +int rpanel_msg_info_colour[MSG_COLOUR_COUNT] = { + GPS_message_rpanel_msg_inforg_act, // pgreen is default + GPS_message_rpanel_msg_info_blue_act, // like blue icon but flashes + GPS_message_rpanel_msg_info_brown_act, + GPS_message_rpanel_msg_info_green_act, + GPS_message_rpanel_msg_info_grey_act, + GPS_message_rpanel_msg_info_orange_act, + GPS_message_rpanel_msg_inforg_act, // pgreen is default + GPS_message_rpanel_msg_info_purple_act, + GPS_message_rpanel_msg_info_red_act, + GPS_message_rpanel_msg_info_white_act, + GPS_message_rpanel_msg_info_yellow_act +}; + +int rpanel_msg_exclam_colour[MSG_COLOUR_COUNT] = { + GPS_message_rpanel_msg_exclam_act, // blue is default + GPS_message_rpanel_msg_exclam_act, // blue is default + GPS_message_rpanel_msg_exclam_brown_act, + GPS_message_rpanel_msg_exclam_green_act, + GPS_message_rpanel_msg_exclam_grey_act, + GPS_message_rpanel_msg_exclam_orange_act, + GPS_message_rpanel_msg_exclam_pgreen_act, + GPS_message_rpanel_msg_exclam_purple_act, + GPS_message_rpanel_msg_exclam_red_act, // used for heart attack, probably best to avoid + GPS_message_rpanel_msg_exclam_white_act, + GPS_message_rpanel_msg_exclam_yellow_act +}; + +int rpanel_msg_questn_colour[MSG_COLOUR_COUNT] = { + GPS_message_rpanel_msg_questn_act, // pgreen is default + GPS_message_rpanel_msg_questn_blue_act, + GPS_message_rpanel_msg_questn_brown_act, + GPS_message_rpanel_msg_questn_green_act, + GPS_message_rpanel_msg_questn_grey_act, + GPS_message_rpanel_msg_questn_orange_act, + GPS_message_rpanel_msg_questn_act, // pgreen is default + GPS_message_rpanel_msg_questn_purple_act, + GPS_message_rpanel_msg_questn_red_act, + GPS_message_rpanel_msg_questn_white_act, + GPS_message_rpanel_msg_questn_yellow_act +}; + #if (BFDEBUG_LEVEL > 0) // Declarations for font testing screen (debug version only) struct TbSpriteSheet *testfont[TESTFONTS_COUNT]; diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 51dce6c35c..2669248451 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -458,6 +458,24 @@ const struct NamedCommand texture_pack_desc[] = { {NULL, 0}, }; +const struct NamedCommand message_colour_desc[] = { + {"DEFAULT", 0}, + {"BLUE", 1}, + {"BROWN", 2}, + {"GREEN", 3}, + {"GREY", 4}, + {"GRAY", 4}, + {"ORANGE", 5}, + {"PGREEN", 6}, + {"PLAYERGREEN",6}, + {"GREEN2", 6}, + {"PURPLE", 7}, + {"RED", 8}, + {"WHITE", 9}, + {"YELLOW", 10}, + {NULL, 0}, +}; + ThingModel parse_creature_name(const char *creature_name) { ThingModel ret = get_rid(creature_desc, creature_name); @@ -6356,10 +6374,10 @@ const struct CommandDesc command_desc[] = { {"MAX_CREATURES", "PN ", Cmd_MAX_CREATURES, NULL, NULL}, {"NEXT_COMMAND_REUSABLE", " ", Cmd_NEXT_COMMAND_REUSABLE, NULL, NULL}, {"DOOR_AVAILABLE", "PANN ", Cmd_DOOR_AVAILABLE, NULL, NULL}, - {"DISPLAY_OBJECTIVE", "Nl ", Cmd_DISPLAY_OBJECTIVE, &display_objective_check, &display_objective_process}, - {"DISPLAY_OBJECTIVE_WITH_POS", "NNN ", Cmd_DISPLAY_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, - {"DISPLAY_INFORMATION", "Nl ", Cmd_DISPLAY_INFORMATION, NULL, NULL}, - {"DISPLAY_INFORMATION_WITH_POS", "NNN ", Cmd_DISPLAY_INFORMATION_WITH_POS, NULL, NULL}, + {"DISPLAY_OBJECTIVE", "Nlan ", Cmd_DISPLAY_OBJECTIVE, &display_objective_check, &display_objective_process}, + {"DISPLAY_OBJECTIVE_WITH_POS", "NNNan ", Cmd_DISPLAY_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, + {"DISPLAY_INFORMATION", "Nla ", Cmd_DISPLAY_INFORMATION, NULL, NULL}, + {"DISPLAY_INFORMATION_WITH_POS", "NNNa ", Cmd_DISPLAY_INFORMATION_WITH_POS, NULL, NULL}, {"ADD_TUNNELLER_PARTY_TO_LEVEL", "PAAANNN ", Cmd_ADD_TUNNELLER_PARTY_TO_LEVEL, NULL, NULL}, {"ADD_CREATURE_TO_POOL", "CN ", Cmd_ADD_CREATURE_TO_POOL, NULL, NULL}, {"RESET_ACTION_POINT", "Na ", Cmd_RESET_ACTION_POINT, &reset_action_point_check, &reset_action_point_process}, @@ -6384,10 +6402,8 @@ const struct CommandDesc command_desc[] = { {"BONUS_LEVEL_TIME", "Nb ", Cmd_BONUS_LEVEL_TIME, NULL, NULL}, {"QUICK_OBJECTIVE", "NAla ", Cmd_QUICK_OBJECTIVE, NULL, NULL}, {"QUICK_INFORMATION", "NAla ", Cmd_QUICK_INFORMATION, NULL, NULL}, - {"QUICK_WARNING", "NAla ", Cmd_QUICK_WARNING, NULL, NULL}, {"QUICK_OBJECTIVE_WITH_POS", "NANNa ", Cmd_QUICK_OBJECTIVE_WITH_POS, NULL, NULL}, {"QUICK_INFORMATION_WITH_POS", "NANNa ", Cmd_QUICK_INFORMATION_WITH_POS, NULL, NULL}, - {"QUICK_WARNING_WITH_POS", "NANNa ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, {"SWAP_CREATURE", "CC ", Cmd_SWAP_CREATURE, &swap_creature_check, &swap_creature_process}, {"PRINT", "A ", Cmd_PRINT, NULL, NULL}, {"MESSAGE", "A ", Cmd_MESSAGE, NULL, NULL}, @@ -6494,6 +6510,10 @@ const struct CommandDesc command_desc[] = { {"LOCK_POSSESSION", "PB! ", Cmd_LOCK_POSSESSION, &lock_possession_check, &lock_possession_process}, {"SET_DIGGER", "PC ", Cmd_SET_DIGGER , &set_digger_check, &set_digger_process}, {"RUN_LUA_CODE", "A ", Cmd_RUN_LUA_CODE , &run_lua_code_check, &run_lua_code_process}, + {"DISPLAY_WARNING", "Nla ", Cmd_DISPLAY_WARNING, NULL, NULL}, + {"DISPLAY_WARNING_WITH_POS", "NNNa ", Cmd_DISPLAY_WARNING, NULL, NULL}, + {"QUICK_WARNING", "NAla ", Cmd_QUICK_WARNING, NULL, NULL}, + {"QUICK_WARNING_WITH_POS", "NANNa ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, {NULL, " ", Cmd_NONE, NULL, NULL}, }; diff --git a/src/lvl_script_lib.h b/src/lvl_script_lib.h index d10b8d93b4..dcf071ac33 100644 --- a/src/lvl_script_lib.h +++ b/src/lvl_script_lib.h @@ -197,8 +197,10 @@ enum TbScriptCommands { Cmd_SHOW_BONUS_LEVEL = 185, Cmd_HIDE_BONUS_LEVEL = 186, Cmd_HIDE_HERO_GATE = 187, - Cmd_QUICK_WARNING = 188, - Cmd_QUICK_WARNING_WITH_POS = 189, + Cmd_DISPLAY_WARNING = 188, + Cmd_DISPLAY_WARNING_WITH_POS = 189, + Cmd_QUICK_WARNING = 190, + Cmd_QUICK_WARNING_WITH_POS = 191, }; struct ScriptLine { @@ -328,6 +330,7 @@ extern const struct NamedCommand fill_desc[]; extern const struct NamedCommand set_door_desc[]; extern const struct NamedCommand texture_pack_desc[]; extern const struct NamedCommand locked_desc[]; +extern const struct NamedCommand message_colour_desc[]; ThingModel parse_creature_name(const char *creature_name); struct ScriptValue *allocate_script_value(void); diff --git a/src/main.cpp b/src/main.cpp index 7632d3c4ef..ed58be2dda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1940,7 +1940,8 @@ void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, M pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id); + struct Event *event = event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id); + event->icon = 268; //GPS_message_rpanel_msg_inforg_act; } void set_general_objective(long msg_id, TbMapLocation target, long x, long y) From f39db10a455612ca7a23681335e7d166e9bc3db0 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:40:32 +0000 Subject: [PATCH 07/27] undid disgusting list, hoping to set icon later Set up types and colours better (hopefully). Aim is to add "icon" to Event struct and update this, then use this later on when setting message sprite. --- src/frontend.cpp | 250 ++++++++++++++---------------------- src/frontmenu_ingame_tabs.c | 10 +- src/map_events.h | 1 + 3 files changed, 105 insertions(+), 156 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index f35904c5d7..e6d0c043ef 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -334,7 +334,7 @@ struct EventTypeInfo event_button_info[] = { {GPS_message_rpanel_msg_exclam_act, GUIStr_Empty, GUIStr_Empty, 1, 1, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam2_act, GUIStr_EventDnHeartAttackedDesc, GUIStr_EventHeartAttacked, 300, 250, EvKind_Nothing}, {GPS_message_rpanel_msg_battle_act, GUIStr_EventFightDesc, GUIStr_EventFight, -1, 0, EvKind_FriendlyFight}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventBreachDesc, GUIStr_EventBreach, 300, 0, EvKind_Nothing}, {GPS_message_rpanel_msg_room_act, GUIStr_EventNewRoomResrchDesc, GUIStr_EventNewRoomResearched, 1200, 0, EvKind_Nothing}, {GPS_message_rpanel_msg_creatr_act, GUIStr_EventNewCreatureDesc, GUIStr_EventNewCreature, 1200, 0, EvKind_Nothing}, @@ -352,7 +352,7 @@ struct EventTypeInfo event_button_info[] = { {GPS_message_rpanel_msg_alarm_act, GUIStr_EventAlarmTriggeredDesc, GUIStr_EventAlarmTriggered, 300, 200, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomUnderAttackDesc, GUIStr_EventRoomUnderAttack, 300, 250, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventNeedTreasrRoomDesc, GUIStr_EventTreasureRoomNeeded, 300, 500, EvKind_Nothing}, // EvKind_NeedTreasureRoom - {rpanel_msg_info_colour[MSG_COLOUR_DEFAULT], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, + {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventRoomLostDesc, GUIStr_EventRoomLost, 1200, 0, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventCreaturesHungryDesc, GUIStr_EventCreaturesHungry, 300, 500, EvKind_Nothing}, {GPS_message_rpanel_msg_inforb_act, GUIStr_EventTrapCrateFoundDesc, GUIStr_EventTrapCrateFound, 300, 0, EvKind_Nothing}, @@ -367,123 +367,17 @@ struct EventTypeInfo event_button_info[] = { {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_EnemyDoor {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSecretDoorDiscovDesc, GUIStr_EventSecretDoorDiscovered,300, 200, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventSecretDoorSpottedDesc, GUIStr_EventSecretDoorSpotted, 300, 200, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_BLUE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // looks like default but flashes - {rpanel_msg_info_colour[MSG_COLOUR_BROWN], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_GREEN], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_GREY], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_ORANGE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_PGREEN], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_PURPLE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_RED], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_WHITE], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_info_colour[MSG_COLOUR_YELLOW], GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_DEFAULT], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_BLUE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_BROWN], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_GREEN], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_GREY], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_ORANGE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_PGREEN], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_PURPLE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_RED], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_WHITE], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_exclam_colour[MSG_COLOUR_YELLOW], GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, // surely there's a better way than listing every combination - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, // of colour and objective number? - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, // 60 - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, // Objective slot 2 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, // Objective slot 3 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, // Objective slot 4 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, // Objective slot 5 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, // Objective slot 6 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, // Objective slot 7 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, - {rpanel_msg_questn_colour[MSG_COLOUR_DEFAULT], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, // Objective slot 8 - {rpanel_msg_questn_colour[MSG_COLOUR_BLUE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_BROWN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_GREY], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_ORANGE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_PGREEN], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_PURPLE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_RED], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_WHITE], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, - {rpanel_msg_questn_colour[MSG_COLOUR_YELLOW], GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, -}; - -const unsigned long alliance_grid[4][4] = { - {0x00, 0x01, 0x02, 0x04,}, - {0x01, 0x00, 0x08, 0x10,}, - {0x02, 0x08, 0x00, 0x20,}, - {0x04, 0x10, 0x20, 0x00,}, + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // EvKind_Warning - Information but with a ! + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, // Objective slot 2 + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, // Objective slot 3 + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, // Objective slot 4 + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective5}, // Objective slot 5 + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective6}, // Objective slot 6 + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective7}, // Objective slot 7 + {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective8}, // Objective slot 8 }; +// setup of message colours for i,!,? (icons and default vary) typedef enum { MSG_COLOUR_DEFAULT, MSG_COLOUR_BLUE, @@ -498,47 +392,93 @@ typedef enum { MSG_COLOUR_YELLOW, MSG_COLOUR_COUNT } MsgColour; - -int rpanel_msg_info_colour[MSG_COLOUR_COUNT] = { - GPS_message_rpanel_msg_inforg_act, // pgreen is default - GPS_message_rpanel_msg_info_blue_act, // like blue icon but flashes - GPS_message_rpanel_msg_info_brown_act, - GPS_message_rpanel_msg_info_green_act, - GPS_message_rpanel_msg_info_grey_act, - GPS_message_rpanel_msg_info_orange_act, - GPS_message_rpanel_msg_inforg_act, // pgreen is default - GPS_message_rpanel_msg_info_purple_act, - GPS_message_rpanel_msg_info_red_act, - GPS_message_rpanel_msg_info_white_act, - GPS_message_rpanel_msg_info_yellow_act +typedef enum { + MSG_ICON_INFO, + MSG_ICON_EXCLAM, + MSG_ICON_QUESTN, + MSG_ICON_COUNT +} MsgIconType; + +// might need to move to somewhere else (i.e. where script command goes) +// interpret possible colour strings, otherwise fallback to default if not recognised. +const struct NamedCommand message_colour_desc[] = { + {"DEFAULT", MSG_COLOUR_DEFAULT}, + {"BLUE", MSG_COLOUR_BLUE}, + {"BROWN", MSG_COLOUR_BROWN}, + {"GREEN", MSG_COLOUR_GREEN}, + {"GREY", MSG_COLOUR_GREY}, + {"GRAY", MSG_COLOUR_GREY}, + {"ORANGE", MSG_COLOUR_ORANGE}, + {"PGREEN", MSG_COLOUR_PGREEN}, + {"PLAYERGREEN",MSG_COLOUR_PGREEN}, + {"GREEN2", MSG_COLOUR_PGREEN}, + {"PURPLE", MSG_COLOUR_PURPLE}, + {"RED", MSG_COLOUR_RED}, + {"WHITE", MSG_COLOUR_WHITE}, + {"YELLOW", MSG_COLOUR_YELLOW}, + {NULL, 0}, }; - -int rpanel_msg_exclam_colour[MSG_COLOUR_COUNT] = { - GPS_message_rpanel_msg_exclam_act, // blue is default - GPS_message_rpanel_msg_exclam_act, // blue is default - GPS_message_rpanel_msg_exclam_brown_act, - GPS_message_rpanel_msg_exclam_green_act, - GPS_message_rpanel_msg_exclam_grey_act, - GPS_message_rpanel_msg_exclam_orange_act, - GPS_message_rpanel_msg_exclam_pgreen_act, - GPS_message_rpanel_msg_exclam_purple_act, - GPS_message_rpanel_msg_exclam_red_act, // used for heart attack, probably best to avoid - GPS_message_rpanel_msg_exclam_white_act, - GPS_message_rpanel_msg_exclam_yellow_act +MsgColour get_colour(const char *input) +{ + if (!input) return MSG_COLOUR_DEFAULT; + for (int i = 0; message_colour_desc[i].name; i++) { + if (strcmp(input, message_colour_desc[i].name) == 0) { + return message_colour_desc[i].value; + } + } + return MSG_COLOUR_DEFAULT; +} + +int rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT] = { + // MSG_ICON_INFO (i) + { + GPS_message_rpanel_msg_inforg_act, // pgreen is default + GPS_message_rpanel_msg_info_blue_act, // like blue icon but flashes + GPS_message_rpanel_msg_info_brown_act, + GPS_message_rpanel_msg_info_green_act, + GPS_message_rpanel_msg_info_grey_act, + GPS_message_rpanel_msg_info_orange_act, + GPS_message_rpanel_msg_inforg_act, // pgreen is default + GPS_message_rpanel_msg_info_purple_act, + GPS_message_rpanel_msg_info_red_act, + GPS_message_rpanel_msg_info_white_act, + GPS_message_rpanel_msg_info_yellow_act + }, + //MSG_ICON_EXCLAM (!) + { + GPS_message_rpanel_msg_exclam_act, // blue is default + GPS_message_rpanel_msg_exclam_act, // blue is default + GPS_message_rpanel_msg_exclam_brown_act, + GPS_message_rpanel_msg_exclam_green_act, + GPS_message_rpanel_msg_exclam_grey_act, + GPS_message_rpanel_msg_exclam_orange_act, + GPS_message_rpanel_msg_exclam_pgreen_act, + GPS_message_rpanel_msg_exclam_purple_act, + GPS_message_rpanel_msg_exclam_red_act, // used for heart attack, probably best to avoid + GPS_message_rpanel_msg_exclam_white_act, + GPS_message_rpanel_msg_exclam_yellow_act + }, + //MSG_ICON_QUESTN (?) + { + GPS_message_rpanel_msg_questn_act, // pgreen is default + GPS_message_rpanel_msg_questn_blue_act, + GPS_message_rpanel_msg_questn_brown_act, + GPS_message_rpanel_msg_questn_green_act, + GPS_message_rpanel_msg_questn_grey_act, + GPS_message_rpanel_msg_questn_orange_act, + GPS_message_rpanel_msg_questn_act, // pgreen is default + GPS_message_rpanel_msg_questn_purple_act, + GPS_message_rpanel_msg_questn_red_act, + GPS_message_rpanel_msg_questn_white_act, + GPS_message_rpanel_msg_questn_yellow_act + } }; -int rpanel_msg_questn_colour[MSG_COLOUR_COUNT] = { - GPS_message_rpanel_msg_questn_act, // pgreen is default - GPS_message_rpanel_msg_questn_blue_act, - GPS_message_rpanel_msg_questn_brown_act, - GPS_message_rpanel_msg_questn_green_act, - GPS_message_rpanel_msg_questn_grey_act, - GPS_message_rpanel_msg_questn_orange_act, - GPS_message_rpanel_msg_questn_act, // pgreen is default - GPS_message_rpanel_msg_questn_purple_act, - GPS_message_rpanel_msg_questn_red_act, - GPS_message_rpanel_msg_questn_white_act, - GPS_message_rpanel_msg_questn_yellow_act +const unsigned long alliance_grid[4][4] = { + {0x00, 0x01, 0x02, 0x04,}, + {0x01, 0x00, 0x08, 0x10,}, + {0x02, 0x08, 0x00, 0x20,}, + {0x04, 0x10, 0x20, 0x00,}, }; #if (BFDEBUG_LEVEL > 0) diff --git a/src/frontmenu_ingame_tabs.c b/src/frontmenu_ingame_tabs.c index f944f5da88..fd8c60421f 100644 --- a/src/frontmenu_ingame_tabs.c +++ b/src/frontmenu_ingame_tabs.c @@ -2171,7 +2171,15 @@ void maintain_event_button(struct GuiButton *gbtn) { activate_event_box(evidx); } - gbtn->sprite_idx = event_button_info[event->kind].bttn_sprite; + // Override with chosen colour if set via script command. + if (((event->kind == EvKind_Objective) || (event->kind == EvKind_Information) || (event->kind == EvKind_QuickInformation)) && (event->icon != 0)) + { + gbtn->sprite_idx = event->icon; + } + else + { + gbtn->sprite_idx = event_button_info[event->kind].bttn_sprite; + } if (((event->kind == EvKind_FriendlyFight) || (event->kind == EvKind_EnemyFight)) && ((event->mappos_x != 0) || (event->mappos_y != 0)) && ((game.play_gameturn % (2 * gui_blink_rate)) >= gui_blink_rate)) { diff --git a/src/map_events.h b/src/map_events.h index ff4377ed6d..11b64843af 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -99,6 +99,7 @@ struct Event { int32_t target; /** Button lifespan, decreased over time. When reaches 0, the button disappears. */ unsigned long lifespan_turns; + unsigned long icon; // from GUIPanelSprite }; struct Bookmark { From 15c24f91cc1d5834dd701f29cb22269071ad60d6 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:47:27 +0000 Subject: [PATCH 08/27] Update map_events.h --- src/map_events.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map_events.h b/src/map_events.h index 11b64843af..825dbc219c 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -27,7 +27,7 @@ extern "C" { #endif /******************************************************************************/ #define EVENT_BUTTONS_COUNT 12 -#define EVENT_KIND_COUNT 144 +#define EVENT_KIND_COUNT 45 #define EVENTS_COUNT 200 #define INVALID_EVENT &game.event[0] @@ -68,6 +68,7 @@ enum EventKinds { EvKind_EnemyDoor, // ComputerKeeper: DoorAtck1 [event20] --> attacks enemy doors EvKind_SecretDoorDiscovered, EvKind_SecretDoorSpotted, + EvKind_Warning, EvKind_Objective2, EvKind_Objective3, EvKind_Objective4, From c764997ddd9472171e840d484ee72868614998ce Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Sun, 29 Mar 2026 00:35:07 +0000 Subject: [PATCH 09/27] made new commands instead of changing existing ones --- src/lvl_script_commands.c | 24 ++++++++++++++---------- src/lvl_script_lib.h | 15 +++++++++++---- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 2669248451..90a5fde341 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -6374,10 +6374,10 @@ const struct CommandDesc command_desc[] = { {"MAX_CREATURES", "PN ", Cmd_MAX_CREATURES, NULL, NULL}, {"NEXT_COMMAND_REUSABLE", " ", Cmd_NEXT_COMMAND_REUSABLE, NULL, NULL}, {"DOOR_AVAILABLE", "PANN ", Cmd_DOOR_AVAILABLE, NULL, NULL}, - {"DISPLAY_OBJECTIVE", "Nlan ", Cmd_DISPLAY_OBJECTIVE, &display_objective_check, &display_objective_process}, - {"DISPLAY_OBJECTIVE_WITH_POS", "NNNan ", Cmd_DISPLAY_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, - {"DISPLAY_INFORMATION", "Nla ", Cmd_DISPLAY_INFORMATION, NULL, NULL}, - {"DISPLAY_INFORMATION_WITH_POS", "NNNa ", Cmd_DISPLAY_INFORMATION_WITH_POS, NULL, NULL}, + {"DISPLAY_OBJECTIVE", "Nl ", Cmd_DISPLAY_OBJECTIVE, &display_objective_check, &display_objective_process}, + {"DISPLAY_OBJECTIVE_WITH_POS", "NNN ", Cmd_DISPLAY_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, + {"DISPLAY_INFORMATION", "Nl ", Cmd_DISPLAY_INFORMATION, NULL, NULL}, + {"DISPLAY_INFORMATION_WITH_POS", "NNN ", Cmd_DISPLAY_INFORMATION_WITH_POS, NULL, NULL}, {"ADD_TUNNELLER_PARTY_TO_LEVEL", "PAAANNN ", Cmd_ADD_TUNNELLER_PARTY_TO_LEVEL, NULL, NULL}, {"ADD_CREATURE_TO_POOL", "CN ", Cmd_ADD_CREATURE_TO_POOL, NULL, NULL}, {"RESET_ACTION_POINT", "Na ", Cmd_RESET_ACTION_POINT, &reset_action_point_check, &reset_action_point_process}, @@ -6400,10 +6400,10 @@ const struct CommandDesc command_desc[] = { {"ALLY_PLAYERS", "PPN ", Cmd_ALLY_PLAYERS, NULL, NULL}, {"DEAD_CREATURES_RETURN_TO_POOL", "B ", Cmd_DEAD_CREATURES_RETURN_TO_POOL, NULL, NULL}, {"BONUS_LEVEL_TIME", "Nb ", Cmd_BONUS_LEVEL_TIME, NULL, NULL}, - {"QUICK_OBJECTIVE", "NAla ", Cmd_QUICK_OBJECTIVE, NULL, NULL}, - {"QUICK_INFORMATION", "NAla ", Cmd_QUICK_INFORMATION, NULL, NULL}, - {"QUICK_OBJECTIVE_WITH_POS", "NANNa ", Cmd_QUICK_OBJECTIVE_WITH_POS, NULL, NULL}, - {"QUICK_INFORMATION_WITH_POS", "NANNa ", Cmd_QUICK_INFORMATION_WITH_POS, NULL, NULL}, + {"QUICK_OBJECTIVE", "NAl ", Cmd_QUICK_OBJECTIVE, NULL, NULL}, + {"QUICK_INFORMATION", "NAl ", Cmd_QUICK_INFORMATION, NULL, NULL}, + {"QUICK_OBJECTIVE_WITH_POS", "NANN ", Cmd_QUICK_OBJECTIVE_WITH_POS, NULL, NULL}, + {"QUICK_INFORMATION_WITH_POS", "NANN ", Cmd_QUICK_INFORMATION_WITH_POS, NULL, NULL}, {"SWAP_CREATURE", "CC ", Cmd_SWAP_CREATURE, &swap_creature_check, &swap_creature_process}, {"PRINT", "A ", Cmd_PRINT, NULL, NULL}, {"MESSAGE", "A ", Cmd_MESSAGE, NULL, NULL}, @@ -6510,9 +6510,13 @@ const struct CommandDesc command_desc[] = { {"LOCK_POSSESSION", "PB! ", Cmd_LOCK_POSSESSION, &lock_possession_check, &lock_possession_process}, {"SET_DIGGER", "PC ", Cmd_SET_DIGGER , &set_digger_check, &set_digger_process}, {"RUN_LUA_CODE", "A ", Cmd_RUN_LUA_CODE , &run_lua_code_check, &run_lua_code_process}, - {"DISPLAY_WARNING", "Nla ", Cmd_DISPLAY_WARNING, NULL, NULL}, + {"DISPLAY_BONUS_OBJECTIVE", "NLa ", Cmd_DISPLAY_OBJECTIVE, &display_objective_check, &display_objective_process}, + {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NNNa ", Cmd_DISPLAY_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, + {"DISPLAY_BONUS_INFORMATION", "NLa ", Cmd_DISPLAY_INFORMATION, NULL, NULL}, + {"DISPLAY_BONUS_INFORMATION_WITH_POS","NNNa ", Cmd_DISPLAY_INFORMATION_WITH_POS, NULL, NULL}, + {"DISPLAY_WARNING", "NLa ", Cmd_DISPLAY_WARNING, NULL, NULL}, {"DISPLAY_WARNING_WITH_POS", "NNNa ", Cmd_DISPLAY_WARNING, NULL, NULL}, - {"QUICK_WARNING", "NAla ", Cmd_QUICK_WARNING, NULL, NULL}, + {"QUICK_WARNING", "NALa ", Cmd_QUICK_WARNING, NULL, NULL}, {"QUICK_WARNING_WITH_POS", "NANNa ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, {NULL, " ", Cmd_NONE, NULL, NULL}, }; diff --git a/src/lvl_script_lib.h b/src/lvl_script_lib.h index dcf071ac33..769686ce31 100644 --- a/src/lvl_script_lib.h +++ b/src/lvl_script_lib.h @@ -197,10 +197,17 @@ enum TbScriptCommands { Cmd_SHOW_BONUS_LEVEL = 185, Cmd_HIDE_BONUS_LEVEL = 186, Cmd_HIDE_HERO_GATE = 187, - Cmd_DISPLAY_WARNING = 188, - Cmd_DISPLAY_WARNING_WITH_POS = 189, - Cmd_QUICK_WARNING = 190, - Cmd_QUICK_WARNING_WITH_POS = 191, + Cmd_DISPLAY_BONUS_OBJECTIVE = 188, + Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS = 189, + Cmd_DISPLAY_BONUS_INFORMATION = 190, + Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS = 191, + Cmd_DISPLAY_WARNING = 192, + Cmd_DISPLAY_WARNING_WITH_POS = 193, + Cmd_QUICK_BONUS_OBJECTIVE = 194, + Cmd_QUICK_BONUS_INFORMATION = 195, + Cmd_QUICK_WARNING = 196, + Cmd_QUICK_BONUS_OBJECTIVE_WITH_POS = 197, + Cmd_QUICK_BONUS_INFORMATION_WITH_POS = 198, }; struct ScriptLine { From b71bb3e15ff7a18bb387724a1633151424931a2d Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Mon, 30 Mar 2026 00:18:56 +0100 Subject: [PATCH 10/27] started adding icon field to event creation commands oh god do i have to add the extra argument to everything --- src/dungeon_data.c | 4 ++-- src/frontend.cpp | 6 +++--- src/main.cpp | 7 +++---- src/map_events.c | 25 +++++++++++++------------ src/map_events.h | 8 ++++---- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/dungeon_data.c b/src/dungeon_data.c index 31acac95a7..e7bd0d7e9d 100644 --- a/src/dungeon_data.c +++ b/src/dungeon_data.c @@ -226,7 +226,7 @@ void add_heart_health(PlayerNumber plyr_idx,HitPoints healthdelta,TbBool warn_on if (heartng->health < old_health) { event_create_event_or_update_nearby_existing_event(heartng->mappos.x.val, heartng->mappos.y.val, EvKind_HeartAttacked, heartng->owner, heartng->index); - if (is_my_player_number(heartng->owner)) + if (is_my_player_number(heartng->owner), 0) { output_message(SMsg_HeartUnderAttack, 400); controller_rumble(50); @@ -486,7 +486,7 @@ TbBool mark_creature_joined_dungeon(struct Thing *creatng) } if ((dungeon->owned_creatures_of_model[creatng->model] <= 1) && (dungeon->creature_models_joined[creatng->model] <= 0)) { - event_create_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_NewCreature, creatng->owner, creatng->index); + event_create_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_NewCreature, creatng->owner, creatng->index, 0); } if (dungeon->creature_models_joined[creatng->model] < 255) { diff --git a/src/frontend.cpp b/src/frontend.cpp index e6d0c043ef..261dae1e9e 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -3746,7 +3746,7 @@ void display_objectives(PlayerNumber plyr_idx, MapSubtlCoord x, MapSubtlCoord y) event = &game.event[evidx]; if (event->kind == EvKind_Objective) { - event_create_event_or_update_old_event(cor_x, cor_y, EvKind_Objective, plyr_idx, 0); + event_create_event_or_update_old_event(cor_x, cor_y, EvKind_Objective, plyr_idx, 0, 0); return; } } @@ -3758,10 +3758,10 @@ void display_objectives(PlayerNumber plyr_idx, MapSubtlCoord x, MapSubtlCoord y) cor_x = creatng->mappos.x.val; cor_y = creatng->mappos.y.val; } - event_create_event_or_update_nearby_existing_event(cor_x, cor_y, EvKind_Objective, plyr_idx, creatng->index); + event_create_event_or_update_nearby_existing_event(cor_x, cor_y, EvKind_Objective, plyr_idx, creatng->index, 0); } else { - event_create_event_or_update_nearby_existing_event(cor_x, cor_y, EvKind_Objective, plyr_idx, 0); + event_create_event_or_update_nearby_existing_event(cor_x, cor_y, EvKind_Objective, plyr_idx, 0, 0); } } diff --git a/src/main.cpp b/src/main.cpp index ed58be2dda..d1f4e4cf90 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1923,7 +1923,7 @@ void set_general_information(long msg_id, TbMapLocation target, MapSubtlCoord x, pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - event_create_event(pos_x, pos_y, EvKind_Information, player->id_number, -msg_id); + event_create_event(pos_x, pos_y, EvKind_Information, player->id_number, -msg_id, 0); } void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) @@ -1940,8 +1940,7 @@ void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, M pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - struct Event *event = event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id); - event->icon = 268; //GPS_message_rpanel_msg_inforg_act; + event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, 0); } void set_general_objective(long msg_id, TbMapLocation target, long x, long y) @@ -2313,7 +2312,7 @@ void process_payday(void) if (player_paid_creatures_count > 0) { struct Dungeon *dungeon = get_players_num_dungeon(plyr_idx); - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreaturePayday, plyr_idx, dungeon->creatures_total_pay); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreaturePayday, plyr_idx, dungeon->creatures_total_pay, 0); } } } diff --git a/src/map_events.c b/src/map_events.c index fa07ce61cc..751143c92e 100644 --- a/src/map_events.c +++ b/src/map_events.c @@ -106,18 +106,18 @@ struct Event *get_event_of_type_for_player(EventKind evkind, PlayerNumber plyr_i * @param target Event target identification parameter, its meaning depends on event kind. * @return Index of the new event, or negative index of updated event. Zero if no action was taken. */ -EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target) +EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target, int icon) { short range = (evkind == EvKind_HeartAttacked) ? 35 : 5; struct Event* event = get_event_nearby_of_type_for_player(map_x, map_y, subtile_coord(range, 0), evkind, dngn_id); if (!event_is_invalid(event)) { SYNCDBG(3,"Updating event %d to be kind %d at (%d,%d)",(int)event->index,(int)evkind,(int)coord_subtile(map_x),(int)coord_subtile(map_y)); - event_initialise_event(event, map_x, map_y, evkind, dngn_id, target); + event_initialise_event(event, map_x, map_y, evkind, dngn_id, target, icon); return -(EventIndex)event->index; } SYNCDBG(3,"Creating event kind %d at (%d,%d)",(int)evkind,(int)coord_subtile(map_x),(int)coord_subtile(map_y)); - event = event_create_event(map_x, map_y, evkind, dngn_id, target); + event = event_create_event(map_x, map_y, evkind, dngn_id, target, icon); if (event_is_invalid(event)) { return 0; } @@ -133,17 +133,17 @@ EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, Ma * @param target Event target identification parameter, its meaning depends on event kind. * @return Index of the new event, or negative index of updated event. Zero if no action was taken. */ -EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target) +EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target, int icon) { struct Event* event = get_event_of_target_and_type_for_player(target, evkind, dngn_id); if (!event_is_invalid(event)) { SYNCDBG(3,"Updating event %d to be kind %d at (%d,%d)",(int)event->index,(int)evkind,(int)coord_subtile(map_x),(int)coord_subtile(map_y)); - event_initialise_event(event, map_x, map_y, evkind, dngn_id, target); + event_initialise_event(event, map_x, map_y, evkind, dngn_id, target, icon); return -(EventIndex)event->index; } SYNCDBG(3,"Creating event kind %d at (%d,%d)",(int)evkind,(int)coord_subtile(map_x),(int)coord_subtile(map_y)); - event = event_create_event(map_x, map_y, evkind, dngn_id, target); + event = event_create_event(map_x, map_y, evkind, dngn_id, target, icon); if (event_is_invalid(event)) { return 0; } @@ -159,19 +159,19 @@ EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_ * @param target Event target identification parameter, its meaning depends on event kind. * @return Index of the new event, or negative index of updated event. Zero if no action was taken. */ -EventIndex event_create_event_or_update_old_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char plyr_idx, int32_t target) +EventIndex event_create_event_or_update_old_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char plyr_idx, int32_t target, int icon) { // Check if such event already exists struct Event* event = get_event_of_type_for_player(evkind, plyr_idx); // If we've found a matching event, replace it if (!event_is_invalid(event)) { - event_initialise_event(event, map_x, map_y, evkind, plyr_idx, target); + event_initialise_event(event, map_x, map_y, evkind, plyr_idx, target, icon); event_add_to_event_buttons_list_or_replace_button(event, get_dungeon(plyr_idx)); return -(EventIndex)event->index; } // If no matching event found, then create new one - event = event_create_event(map_x, map_y, evkind, plyr_idx, target); + event = event_create_event(map_x, map_y, evkind, plyr_idx, target, icon); if (event_is_invalid(event)) { return 0; } @@ -201,7 +201,7 @@ long event_move_player_towards_event(struct PlayerInfo *player, long event_idx) return 1; } -struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target) +struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target, int icon) { long i; if (dngn_id == game.neutral_player_num) { @@ -225,7 +225,7 @@ struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkin if (event_is_invalid(event)) { return INVALID_EVENT; } - event_initialise_event(event, map_x, map_y, evkind, dngn_id, target); + event_initialise_event(event, map_x, map_y, evkind, dngn_id, target, icon); event_add_to_event_buttons_list_or_replace_button(event, dungeon); return event; } @@ -245,7 +245,7 @@ struct Event *event_allocate_free_event_structure(void) return INVALID_EVENT; } -void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target) +void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target, int icon) { event->mappos_x = map_x; event->mappos_y = map_y; @@ -254,6 +254,7 @@ void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, event->lifespan_turns = event_button_info[evkind].lifespan_turns; event->target = target; event->flags |= EvF_BtnFirstFall; + event->icon = icon; } void event_delete_event_structure(long ev_idx) diff --git a/src/map_events.h b/src/map_events.h index 825dbc219c..4ab6dff582 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -119,12 +119,12 @@ struct Event *get_event_nearby_of_type_for_player(MapCoord map_x, MapCoord map_y TbBool event_is_invalid(const struct Event *event); TbBool event_exists(const struct Event* event); -EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target); -EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target); -EventIndex event_create_event_or_update_old_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target); +EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target, int icon); +EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target, int icon); +EventIndex event_create_event_or_update_old_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target, int icon); void event_initialise_all(void); long event_move_player_towards_event(struct PlayerInfo *player, long event_idx); -struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t msg_id); +struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t msg_id, int icon); struct Event *event_allocate_free_event_structure(void); void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t msg_id); void event_add_to_event_buttons_list_or_replace_button(struct Event *event, struct Dungeon *dungeon); From eb290f9b5d7c564e38c646ad8e15774e56f5106c Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Mon, 30 Mar 2026 00:38:47 +0100 Subject: [PATCH 11/27] vague idea for commands, no idea if this makes sense if commands only accept three inputs, we split location and coords commands to free up the slot for the colour. I don't think I understand how the commands work enough to know if this is even right though --- src/main.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index d1f4e4cf90..6a0803cb75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1943,6 +1943,83 @@ void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, M event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, 0); } +void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) +{ + struct PlayerInfo *player; + long pos_x; + long pos_y; + player = get_my_player(); + find_map_location_coords(target, &x, &y, my_player_number, __func__); + pos_x = 0; + pos_y = 0; + if ((x != 0) || (y != 0)) + { + pos_y = subtile_coord_center(y); + pos_x = subtile_coord_center(x); + } + MsgColour colour = get_colour(colour_value); + int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + event_create_event(pos_x, pos_y, EvKind_Information, player->id_number, -msg_id, icon); +} + +void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +{ + struct PlayerInfo *player; + long pos_x; + long pos_y; + player = get_my_player(); + find_map_location_coords(target, &x, &y, my_player_number, __func__); + pos_x = 0; + pos_y = 0; + if ((x != 0) || (y != 0)) + { + pos_y = subtile_coord_center(y); + pos_x = subtile_coord_center(x); + } + MsgColour colour = get_colour(colour_value); + int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + event_create_event(pos_x, pos_y, EvKind_Information, player->id_number, -msg_id, icon); +} + +void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +{ + struct PlayerInfo *player; + long pos_x; + long pos_y; + player = get_my_player(); + find_map_location_coords(target, &x, &y, my_player_number, __func__); + pos_x = 0; + pos_y = 0; + if ((x != 0) || (y != 0)) + { + pos_y = subtile_coord_center(y); + pos_x = subtile_coord_center(x); + } + MsgColour colour = get_colour(colour_value); + int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, icon); +} + + +void set_quick_bonus_information_at_coords(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +{ + struct PlayerInfo *player; + long pos_x; + long pos_y; + player = get_my_player(); + find_map_location_coords(target, &x, &y, my_player_number, __func__); + pos_x = 0; + pos_y = 0; + if ((x != 0) || (y != 0)) + { + pos_y = subtile_coord_center(y); + pos_x = subtile_coord_center(x); + } + MsgColour colour = get_colour(colour_value); + int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, icon); +} + void set_general_objective(long msg_id, TbMapLocation target, long x, long y) { process_objective(get_string(msg_id), target, x, y); From 4a64e43ad8b2ee45717aea21b1a30dab877ae175 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Mon, 30 Mar 2026 14:37:57 +0100 Subject: [PATCH 12/27] Added last argument to every event update command, added unique events, added BONUS_INFORMATION script commands with setup I've set up the four commands for bonus information (coloured info icons), their corresponding commands (I had to split location and coords so that param3 could be colour), and set events for them. DISPLAY_BONUS_INFORMATION set_general_bonus_information_at_location EvKind_BonusInformation DISPLAY_BONUS_INFORMATION_WITH_POS set_general_bonus_information_at_coords EvKind_BonusInformation QUICK_BONUS_INFORMATION set_quick_bonus_information_at_location EvKind_QuickBonusInformation QUICK_BONUS_INFORMATION_WITH_POS set_quick_bonus_information_at_coords EvKind_QuickBonusInformation I don't think the commands have actually grabbed the icon properly so I need help figuring out how to make them point to the right place correctly. I also think this means that when a new bonus information tab is made with a different colour, it will update all existing ones as well which is not ideal. But I don't know for sure. I did wonder if there was a way to directly overwrite the bttn_sprite in event_button_info, but I don't know if that's a worse idea. I think this is getting there at least! --- src/creature_instances.c | 10 +++++----- src/creature_states.c | 10 +++++----- src/creature_states_combt.c | 4 ++-- src/creature_states_gardn.c | 6 +++--- src/creature_states_hero.c | 4 ++-- src/creature_states_mood.c | 2 +- src/creature_states_prisn.c | 2 +- src/creature_states_scavn.c | 2 +- src/creature_states_spdig.c | 10 +++++----- src/dungeon_data.c | 2 +- src/frontend.cpp | 5 ++++- src/frontmenu_ingame_tabs.c | 8 +++++++- src/lvl_script_value.c | 16 ++++++++++++++++ src/main.cpp | 30 ++++++++++-------------------- src/map_events.c | 3 +++ src/map_events.h | 5 ++++- src/room_data.c | 6 +++--- src/room_entrance.c | 2 +- src/room_library.c | 8 ++++---- src/room_util.c | 10 +++++----- src/room_workshop.c | 8 ++++---- src/spdigger_stack.c | 6 +++--- src/thing_doors.c | 4 ++-- src/thing_effects.c | 2 +- src/thing_shots.c | 2 +- src/thing_traps.c | 4 ++-- 26 files changed, 96 insertions(+), 75 deletions(-) diff --git a/src/creature_instances.c b/src/creature_instances.c index 27f750e32e..63dbea0bf8 100644 --- a/src/creature_instances.c +++ b/src/creature_instances.c @@ -662,7 +662,7 @@ long instf_dig(struct Thing *creatng, int32_t *param) { EventIndex evidx = event_create_event_or_update_nearby_existing_event( subtile_coord_center(stl_x), subtile_coord_center(stl_y), - EvKind_AreaDiscovered, creatng->owner, 0); + EvKind_AreaDiscovered, creatng->owner, 0, 0); if ((evidx > 0) && is_my_player_number(creatng->owner)) output_message(SMsg_DugIntoNewArea, 0); } @@ -675,7 +675,7 @@ long instf_dig(struct Thing *creatng, int32_t *param) { EventIndex evidx = event_create_event_or_update_nearby_existing_event( subtile_coord_center(stl_x), subtile_coord_center(stl_y), - EvKind_AreaDiscovered, creatng->owner, 0); + EvKind_AreaDiscovered, creatng->owner, 0, 0); if ((evidx > 0) && is_my_player_number(creatng->owner)) output_message(SMsg_DugIntoNewArea, 0); } @@ -719,7 +719,7 @@ long instf_destroy(struct Thing *creatng, int32_t *param) { MapCoord ccor_x = subtile_coord_center(room->central_stl_x); MapCoord ccor_y = subtile_coord_center(room->central_stl_y); - event_create_event_or_update_nearby_existing_event(ccor_x, ccor_y, EvKind_RoomLost, room->owner, room->kind); + event_create_event_or_update_nearby_existing_event(ccor_x, ccor_y, EvKind_RoomLost, room->owner, room->kind, 0); claim_enemy_room(room, creatng); } thing_play_sample(creatng, 76, NORMAL_PITCH, 0, 3, 0, 2, FULL_LOUDNESS); @@ -783,7 +783,7 @@ long instf_attack_room_slab(struct Thing *creatng, int32_t *param) } if (count_slabs_of_room_type(room->owner, room->kind) <= 1) { - event_create_event_or_update_nearby_existing_event(coord_slab(creatng->mappos.x.val), coord_slab(creatng->mappos.y.val), EvKind_RoomLost, room->owner, room->kind); + event_create_event_or_update_nearby_existing_event(coord_slab(creatng->mappos.x.val), coord_slab(creatng->mappos.y.val), EvKind_RoomLost, room->owner, room->kind, 0); } long z = get_floor_filled_subtiles_at(creatng->mappos.x.stl.num, creatng->mappos.y.stl.num); if (!delete_room_slab(coord_slab(creatng->mappos.x.val), coord_slab(creatng->mappos.y.val), 1)) @@ -931,7 +931,7 @@ long instf_first_person_do_imp_task(struct Thing *creatng, int32_t *param) MapCoord coord_x = subtile_coord_center(room->central_stl_x); MapCoord coord_y = subtile_coord_center(room->central_stl_y); event_create_event_or_update_nearby_existing_event(coord_x, coord_y, - EvKind_RoomUnderAttack, room->owner, 0); + EvKind_RoomUnderAttack, room->owner, 0, 0); if (is_my_player_number(room->owner)) { output_message(SMsg_EnemyDestroyRooms, MESSAGE_DURATION_FIGHT); diff --git a/src/creature_states.c b/src/creature_states.c index ec3922c358..99c971ac4c 100644 --- a/src/creature_states.c +++ b/src/creature_states.c @@ -1093,7 +1093,7 @@ TbBool attempt_to_destroy_enemy_room(struct Thing *thing, MapSubtlCoord stl_x, M } event_create_event_or_update_nearby_existing_event( subtile_coord_center(room->central_stl_x), subtile_coord_center(room->central_stl_y), - EvKind_RoomUnderAttack, room->owner, 0); + EvKind_RoomUnderAttack, room->owner, 0, 0); if (is_my_player_number(room->owner)) output_message(SMsg_EnemyDestroyRooms, MESSAGE_DURATION_FIGHT); thing->continue_state = CrSt_CreatureAttackRooms; @@ -3355,7 +3355,7 @@ short creature_wait_at_treasure_room_door(struct Thing *creatng) return 1; } anger_apply_anger_to_creature(creatng, crconf->annoy_queue, AngR_NotPaid, 1); - EventIndex evidx = event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_WorkRoomUnreachable, creatng->owner, RoK_TREASURE); + EventIndex evidx = event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_WorkRoomUnreachable, creatng->owner, RoK_TREASURE, 0); if (evidx > 0) { output_room_message(creatng->owner, RoK_TREASURE, OMsg_RoomNoRoute); @@ -3972,7 +3972,7 @@ char new_slab_tunneller_check_for_breaches(struct Thing *creatng) set_flag(cctrl->party.player_broken_into_flags, to_flag(i)); ++dgn->times_broken_into; - event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_Breach, i, 0); + event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_Breach, i, 0, 0); if (is_my_player_number(i)) { output_message(SMsg_WallsBreach, 0); @@ -5257,12 +5257,12 @@ long process_creature_needs_to_eat(struct Thing *creatng, const struct CreatureM } } if (room_is_invalid(nroom)) { - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0, 0); anger_apply_anger_to_creature(creatng, crconf->annoy_no_hatchery, AngR_Hungry, 1); return 0; } if (!external_set_thing_state(creatng, CrSt_CreatureToGarden)) { - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0, 0); anger_apply_anger_to_creature(creatng, crconf->annoy_no_hatchery, AngR_Hungry, 1); return 0; } diff --git a/src/creature_states_combt.c b/src/creature_states_combt.c index e2e908a441..6657e7b461 100644 --- a/src/creature_states_combt.c +++ b/src/creature_states_combt.c @@ -648,9 +648,9 @@ void update_battle_events(BattleIndex battle_id) dungeon->last_combat_location.y.val = map_y; dungeon->last_combat_location.z.val = map_z; if (owner_flags == to_flag(i)) { // if the current player (i) is the only player in the fight - event_create_event_or_update_old_event(map_x, map_y, EvKind_FriendlyFight, i, battle_id); + event_create_event_or_update_old_event(map_x, map_y, EvKind_FriendlyFight, i, battle_id, 0); } else { - event_create_event_or_update_old_event(map_x, map_y, EvKind_EnemyFight, i, battle_id); + event_create_event_or_update_old_event(map_x, map_y, EvKind_EnemyFight, i, battle_id, 0); } } } diff --git a/src/creature_states_gardn.c b/src/creature_states_gardn.c index 985ea34c1c..f28d0b8b29 100644 --- a/src/creature_states_gardn.c +++ b/src/creature_states_gardn.c @@ -148,7 +148,7 @@ void person_search_for_food_again(struct Thing *creatng, struct Room *room) { RoomRole job_rrole = get_room_role_for_job(Job_TAKE_FEED); // Warn about no food in this room - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0, 0); output_room_message(creatng->owner, find_first_roomkind_with_role(job_rrole), OMsg_RoomTooSmall); // Check whether there's a room which does have food // Try to find one which has plenty of food @@ -267,7 +267,7 @@ short creature_to_garden(struct Thing *creatng) if (!player_has_room_of_role(creatng->owner, job_rrole)) { // No room for feeding creatures - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0, 0); output_room_message(creatng->owner, find_first_roomkind_with_role(job_rrole), OMsg_RoomNeeded); nroom = INVALID_ROOM; } else @@ -287,7 +287,7 @@ short creature_to_garden(struct Thing *creatng) } else { // The room is reachable, so it probably has just no food - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_CreatrHungry, creatng->owner, 0, 0); output_room_message(creatng->owner, find_first_roomkind_with_role(job_rrole), OMsg_RoomTooSmall); } } diff --git a/src/creature_states_hero.c b/src/creature_states_hero.c index e857589256..4c676c6a57 100644 --- a/src/creature_states_hero.c +++ b/src/creature_states_hero.c @@ -515,7 +515,7 @@ short good_arrived_at_attack_room(struct Thing *thing) internal_set_thing_state(thing, CrSt_GoodAttackRoom1); MapCoord ev_coord_x = subtile_coord_center(room->central_stl_x); MapCoord ev_coord_y = subtile_coord_center(room->central_stl_y); - event_create_event_or_update_nearby_existing_event(ev_coord_x, ev_coord_y, EvKind_RoomUnderAttack, room->owner, 0); + event_create_event_or_update_nearby_existing_event(ev_coord_x, ev_coord_y, EvKind_RoomUnderAttack, room->owner, 0, 0); if (is_my_player_number(room->owner)) output_message(SMsg_EnemyDestroyRooms, MESSAGE_DURATION_FIGHT); return 1; @@ -545,7 +545,7 @@ short good_attack_room(struct Thing *thing) set_creature_instance(thing, CrInst_ATTACK_ROOM_SLAB, 0, 0); MapCoord ev_coord_x = subtile_coord_center(room->central_stl_x); MapCoord ev_coord_y = subtile_coord_center(room->central_stl_y); - event_create_event_or_update_nearby_existing_event(ev_coord_x, ev_coord_y, EvKind_RoomUnderAttack, room->owner, 0); + event_create_event_or_update_nearby_existing_event(ev_coord_x, ev_coord_y, EvKind_RoomUnderAttack, room->owner, 0, 0); if (is_my_player_number(room->owner)) output_message(SMsg_EnemyDestroyRooms, MESSAGE_DURATION_FIGHT); } diff --git a/src/creature_states_mood.c b/src/creature_states_mood.c index f9bf5fb2e7..769ff287b2 100644 --- a/src/creature_states_mood.c +++ b/src/creature_states_mood.c @@ -287,7 +287,7 @@ void anger_set_creature_anger_f(struct Thing *creatng, long annoy_lv, AnnoyMotiv dungeon->creatures_annoyed++; event_create_event_or_update_nearby_existing_event( creatng->mappos.x.val, creatng->mappos.y.val, - EvKind_CreatrIsAnnoyed, creatng->owner, creatng->index); + EvKind_CreatrIsAnnoyed, creatng->owner, creatng->index, 0); } } else { diff --git a/src/creature_states_prisn.c b/src/creature_states_prisn.c index 23bcff4231..fbe3fc753b 100644 --- a/src/creature_states_prisn.c +++ b/src/creature_states_prisn.c @@ -277,7 +277,7 @@ CrStateRet process_prison_visuals(struct Thing *creatng, struct Room *room) if (game.play_gameturn - cctrl->turns_at_job < 250) { set_creature_instance(creatng, CrInst_MOAN, 0, 0); - event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_PrisonerStarving, room->owner, creatng->index); + event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_PrisonerStarving, room->owner, creatng->index, 0); if (game.play_gameturn - cctrl->imprison.last_mood_sound_turn > 32) { play_creature_sound(creatng, CrSnd_Sad, 2, 0); diff --git a/src/creature_states_scavn.c b/src/creature_states_scavn.c index 74a71030fb..0279029736 100644 --- a/src/creature_states_scavn.c +++ b/src/creature_states_scavn.c @@ -427,7 +427,7 @@ TbBool process_scavenge_creature_from_level(struct Thing *scavtng, struct Thing if (is_my_player_number(scavtng->owner)) { output_message(SMsg_CreatureScanvenged, 500); } - event_create_event(scavtng->mappos.x.val, scavtng->mappos.y.val, EvKind_CreatrScavenged, scavtng->owner, scavtng->index); + event_create_event(scavtng->mappos.x.val, scavtng->mappos.y.val, EvKind_CreatrScavenged, scavtng->owner, scavtng->index, 0); } else { calldngn->scavenge_turn_points[calltng->model] += work_value; diff --git a/src/creature_states_spdig.c b/src/creature_states_spdig.c index d68cf9d0f2..74ff2774d0 100644 --- a/src/creature_states_spdig.c +++ b/src/creature_states_spdig.c @@ -307,12 +307,12 @@ long check_out_unclaimed_spells(struct Thing *spdigtng, long range) if (thing_is_spellbook(thing)) { event_create_event_or_update_nearby_existing_event(thing->mappos.x.val, thing->mappos.y.val, - EvKind_SpellPickedUp, spdigtng->owner, thing->index); + EvKind_SpellPickedUp, spdigtng->owner, thing->index, 0); } else if (thing_is_special_box(thing)) { event_create_event_or_update_nearby_existing_event(thing->mappos.x.val, thing->mappos.y.val, - EvKind_DnSpecialFound, spdigtng->owner, thing->index); + EvKind_DnSpecialFound, spdigtng->owner, thing->index, 0); } spdigtng->continue_state = CrSt_CreaturePicksUpSpellObject; cctrl->pickup_object_id = thing->index; @@ -389,12 +389,12 @@ long check_out_unclaimed_traps(struct Thing *spdigtng, long range) if (thing_is_trap_crate(thing)) { event_create_event_or_update_nearby_existing_event(thing->mappos.x.val, thing->mappos.y.val, - EvKind_TrapCrateFound, spdigtng->owner, thing->index); + EvKind_TrapCrateFound, spdigtng->owner, thing->index, 0); } else if (thing_is_door_crate(thing)) { event_create_event_or_update_nearby_existing_event(thing->mappos.x.val, thing->mappos.y.val, - EvKind_DoorCrateFound, spdigtng->owner, thing->index); + EvKind_DoorCrateFound, spdigtng->owner, thing->index, 0); } spdigtng->continue_state = CrSt_CreaturePicksUpCrateForWorkshop; cctrl->pickup_object_id = thing->index; @@ -1056,7 +1056,7 @@ short imp_converts_dungeon(struct Thing *spdigtng) MapCoord coord_x = subtile_coord_center(room->central_stl_x); MapCoord coord_y = subtile_coord_center(room->central_stl_y); event_create_event_or_update_nearby_existing_event(coord_x, coord_y, - EvKind_RoomUnderAttack, room->owner, 0); + EvKind_RoomUnderAttack, room->owner, 0, 0); if (is_my_player_number(room->owner)) { output_message(SMsg_EnemyDestroyRooms, MESSAGE_DURATION_FIGHT); diff --git a/src/dungeon_data.c b/src/dungeon_data.c index e7bd0d7e9d..82448a8f5f 100644 --- a/src/dungeon_data.c +++ b/src/dungeon_data.c @@ -225,7 +225,7 @@ void add_heart_health(PlayerNumber plyr_idx,HitPoints healthdelta,TbBool warn_on { if (heartng->health < old_health) { - event_create_event_or_update_nearby_existing_event(heartng->mappos.x.val, heartng->mappos.y.val, EvKind_HeartAttacked, heartng->owner, heartng->index); + event_create_event_or_update_nearby_existing_event(heartng->mappos.x.val, heartng->mappos.y.val, EvKind_HeartAttacked, heartng->owner, heartng->index, 0); if (is_my_player_number(heartng->owner), 0) { output_message(SMsg_HeartUnderAttack, 400); diff --git a/src/frontend.cpp b/src/frontend.cpp index 261dae1e9e..2f18ae4e82 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -367,7 +367,10 @@ struct EventTypeInfo event_button_info[] = { {0, GUIStr_Empty, GUIStr_Empty, 1200, 50, EvKind_Nothing}, // EvKind_EnemyDoor {GPS_message_rpanel_msg_inforb_act, GUIStr_EventSecretDoorDiscovDesc, GUIStr_EventSecretDoorDiscovered,300, 200, EvKind_Nothing}, {GPS_message_rpanel_msg_exclam_act, GUIStr_EventSecretDoorSpottedDesc, GUIStr_EventSecretDoorSpotted, 300, 200, EvKind_Nothing}, - {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // EvKind_Warning - Information but with a ! + {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // EvKind_BonusInformation - Coloured i. + {GPS_message_rpanel_msg_inforg_act, GUIStr_EventInformationDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // EvKind_QuickBonusInformation - Coloured i. + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // EvKind_Warning - same but with a ! + {GPS_message_rpanel_msg_exclam_act, GUIStr_EventWarningDesc, GUIStr_Empty, 1200, 0, EvKind_Nothing}, // EvKind_QuickWarning - same but with a ! {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective2}, // Objective slot 2 {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective3}, // Objective slot 3 {GPS_message_rpanel_msg_questn_act, GUIStr_EventObjective, GUIStr_Empty, -1, 0, EvKind_Objective4}, // Objective slot 4 diff --git a/src/frontmenu_ingame_tabs.c b/src/frontmenu_ingame_tabs.c index fd8c60421f..e91557d004 100644 --- a/src/frontmenu_ingame_tabs.c +++ b/src/frontmenu_ingame_tabs.c @@ -2172,7 +2172,13 @@ void maintain_event_button(struct GuiButton *gbtn) activate_event_box(evidx); } // Override with chosen colour if set via script command. - if (((event->kind == EvKind_Objective) || (event->kind == EvKind_Information) || (event->kind == EvKind_QuickInformation)) && (event->icon != 0)) + // not sure if this is better or worse than trying to overwrite the value in event_button_info[] directly + // (but that would presumably update all instances at once, so only feasible for objectives) + if (((event->kind == EvKind_BonusInformation) || (event->kind == EvKind_QuickBonusInformation) + || (event->kind == EvKind_Warning) || (event->kind == EvKind_QuickWarning) + || (event->kind == EvKind_Objective) || (event->kind == EvKind_Objective2) || (event->kind == EvKind_Objective3) || (event->kind == EvKind_Objective4) + || (event->kind == EvKind_Objective5) || (event->kind == EvKind_Objective6) || (event->kind == EvKind_Objective7) || (event->kind == EvKind_Objective8)) + && (event->icon != 0)) { gbtn->sprite_idx = event->icon; } diff --git a/src/lvl_script_value.c b/src/lvl_script_value.c index 06fcc5cf27..32654bd64f 100644 --- a/src/lvl_script_value.c +++ b/src/lvl_script_value.c @@ -829,6 +829,22 @@ void script_process_value(unsigned long var_index, unsigned long plr_range_id, l } } break; + case Cmd_DISPLAY_BONUS_INFORMATION: + if ((my_player_number >= plr_start) && (my_player_number < plr_end)) + set_general_bonus_information_at_location(param1, param2, param3); + break; + case Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS: + if ((my_player_number >= plr_start) && (my_player_number < plr_end)) + set_general_bonus_information_at_coords(param1, stl_num_decode_x(param2), stl_num_decode_y(param2), param3); + break; + case Cmd_QUICK_BONUS_INFORMATION: + if ((my_player_number >= plr_start) && (my_player_number < plr_end)) + set_quick_bonus_information_at_location(param1, param2, param3); + break; + case Cmd_QUICK_BONUS_INFORMATION_WITH_POS: + if ((my_player_number >= plr_start) && (my_player_number < plr_end)) + set_quick_bonus_information_at_coords(param1, stl_num_decode_x(param2), stl_num_decode_y(param2), param3); + break; default: WARNMSG("Unsupported Game VALUE, command %lu.",var_index); break; diff --git a/src/main.cpp b/src/main.cpp index 6a0803cb75..095544f20d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1949,17 +1949,12 @@ void set_general_bonus_information_at_location(long msg_id, TbMapLocation target long pos_x; long pos_y; player = get_my_player(); - find_map_location_coords(target, &x, &y, my_player_number, __func__); + find_map_location_coords(target, 0, 0, my_player_number, __func__); pos_x = 0; pos_y = 0; - if ((x != 0) || (y != 0)) - { - pos_y = subtile_coord_center(y); - pos_x = subtile_coord_center(x); - } MsgColour colour = get_colour(colour_value); int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; - event_create_event(pos_x, pos_y, EvKind_Information, player->id_number, -msg_id, icon); + event_create_event(pos_x, pos_y, EvKind_BonusInformation, player->id_number, -msg_id, icon); } void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) @@ -1968,7 +1963,7 @@ void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSu long pos_x; long pos_y; player = get_my_player(); - find_map_location_coords(target, &x, &y, my_player_number, __func__); + find_map_location_coords(0, &x, &y, my_player_number, __func__); pos_x = 0; pos_y = 0; if ((x != 0) || (y != 0)) @@ -1978,36 +1973,31 @@ void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSu } MsgColour colour = get_colour(colour_value); int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; - event_create_event(pos_x, pos_y, EvKind_Information, player->id_number, -msg_id, icon); + event_create_event(pos_x, pos_y, EvKind_BonusInformation, player->id_number, -msg_id, icon); } -void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) { struct PlayerInfo *player; long pos_x; long pos_y; player = get_my_player(); - find_map_location_coords(target, &x, &y, my_player_number, __func__); + find_map_location_coords(target, 0, 0, my_player_number, __func__); pos_x = 0; pos_y = 0; - if ((x != 0) || (y != 0)) - { - pos_y = subtile_coord_center(y); - pos_x = subtile_coord_center(x); - } MsgColour colour = get_colour(colour_value); int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; - event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, icon); + event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } -void set_quick_bonus_information_at_coords(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) { struct PlayerInfo *player; long pos_x; long pos_y; player = get_my_player(); - find_map_location_coords(target, &x, &y, my_player_number, __func__); + find_map_location_coords(0, &x, &y, my_player_number, __func__); pos_x = 0; pos_y = 0; if ((x != 0) || (y != 0)) @@ -2017,7 +2007,7 @@ void set_quick_bonus_information_at_coords(long msg_id, TbMapLocation target, Ma } MsgColour colour = get_colour(colour_value); int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; - event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, icon); + event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } void set_general_objective(long msg_id, TbMapLocation target, long x, long y) diff --git a/src/map_events.c b/src/map_events.c index 751143c92e..5203166209 100644 --- a/src/map_events.c +++ b/src/map_events.c @@ -104,6 +104,7 @@ struct Event *get_event_of_type_for_player(EventKind evkind, PlayerNumber plyr_i * @param evkind Event kind to be searched or created. * @param dngn_id Owning dungeon index. * @param target Event target identification parameter, its meaning depends on event kind. + * @param icon Icon argument for specific event commands that accept a colour argument. 0 for unchanged. * @return Index of the new event, or negative index of updated event. Zero if no action was taken. */ EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t target, int icon) @@ -131,6 +132,7 @@ EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, Ma * @param evkind Event kind to be searched or created. * @param dngn_id Owning dungeon index. * @param target Event target identification parameter, its meaning depends on event kind. + * @param icon Icon argument for specific event commands that accept a colour argument. 0 for unchanged. * @return Index of the new event, or negative index of updated event. Zero if no action was taken. */ EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target, int icon) @@ -157,6 +159,7 @@ EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_ * @param evkind Event kind to be searched or created. * @param plyr_idx Owning player index. * @param target Event target identification parameter, its meaning depends on event kind. + * @param icon Icon argument for specific event commands that accept a colour argument. 0 for unchanged. * @return Index of the new event, or negative index of updated event. Zero if no action was taken. */ EventIndex event_create_event_or_update_old_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char plyr_idx, int32_t target, int icon) diff --git a/src/map_events.h b/src/map_events.h index 4ab6dff582..94de3698e6 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -68,7 +68,10 @@ enum EventKinds { EvKind_EnemyDoor, // ComputerKeeper: DoorAtck1 [event20] --> attacks enemy doors EvKind_SecretDoorDiscovered, EvKind_SecretDoorSpotted, + EvKind_BonusInformation, + EvKind_QuickBonusInformation, EvKind_Warning, + EvKind_QuickWarning, EvKind_Objective2, EvKind_Objective3, EvKind_Objective4, @@ -126,7 +129,7 @@ void event_initialise_all(void); long event_move_player_towards_event(struct PlayerInfo *player, long event_idx); struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t msg_id, int icon); struct Event *event_allocate_free_event_structure(void); -void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t msg_id); +void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, int32_t msg_id, int icon); void event_add_to_event_buttons_list_or_replace_button(struct Event *event, struct Dungeon *dungeon); void event_update_on_battle_removal(BattleIndex battle_idx); void event_delete_event(long plridx, EventIndex evidx); diff --git a/src/room_data.c b/src/room_data.c index dce48c8099..10c9e52df2 100644 --- a/src/room_data.c +++ b/src/room_data.c @@ -3843,7 +3843,7 @@ long claim_room(struct Room *room, struct Thing *claimtng) redraw_room_map_elements(room); do_room_unprettying(room, claimtng->owner); event_create_event(subtile_coord_center(room->central_stl_x), subtile_coord_center(room->central_stl_y), - EvKind_RoomTakenOver, claimtng->owner, room->kind); + EvKind_RoomTakenOver, claimtng->owner, room->kind, 0); do_room_integration(room); thing_play_sample(claimtng, 116, NORMAL_PITCH, 0, 3, 0, 4, FULL_LOUDNESS); output_room_takeover_message(room, oldowner, claimtng->owner); @@ -3875,7 +3875,7 @@ long claim_enemy_room(struct Room *room, struct Thing *claimtng) redraw_room_map_elements(room); do_room_unprettying(room, claimtng->owner); event_create_event(subtile_coord_center(room->central_stl_x), subtile_coord_center(room->central_stl_y), - EvKind_RoomTakenOver, claimtng->owner, room->kind); + EvKind_RoomTakenOver, claimtng->owner, room->kind, 0); do_room_integration(room); output_room_takeover_message(room, oldowner, claimtng->owner); return 1; @@ -3909,7 +3909,7 @@ long take_over_room(struct Room* room, PlayerNumber newowner) do_room_integration(room); MapCoord ccor_x = subtile_coord_center(room->central_stl_x); MapCoord ccor_y = subtile_coord_center(room->central_stl_y); - event_create_event_or_update_nearby_existing_event(ccor_x, ccor_y, EvKind_RoomLost, oldowner, room->kind); + event_create_event_or_update_nearby_existing_event(ccor_x, ccor_y, EvKind_RoomLost, oldowner, room->kind, 0); return 1; } else diff --git a/src/room_entrance.c b/src/room_entrance.c index 718605060f..e005895796 100644 --- a/src/room_entrance.c +++ b/src/room_entrance.c @@ -372,7 +372,7 @@ void generate_creature_for_dungeon(struct Dungeon * dungeon) rkind = find_first_roomkind_with_role(RoRoF_LairStorage); } if (dungeon_has_room_of_role(dungeon, RoRoF_LairStorage)) { - event_create_event_or_update_nearby_existing_event(0, 0, EvKind_NoMoreLivingSet, dungeon->owner, 0); + event_create_event_or_update_nearby_existing_event(0, 0, EvKind_NoMoreLivingSet, dungeon->owner, 0, 0); output_room_message(dungeon->owner, rkind, OMsg_RoomTooSmall); } else { output_room_message(dungeon->owner, rkind, OMsg_RoomNeeded); diff --git a/src/room_library.c b/src/room_library.c index d684cd32f4..8db5cc47aa 100644 --- a/src/room_library.c +++ b/src/room_library.c @@ -107,7 +107,7 @@ EventIndex update_library_object_pickup_event(struct Thing *creatng, struct Thin { evidx = event_create_event_or_update_nearby_existing_event( picktng->mappos.x.val, picktng->mappos.y.val, - EvKind_SpellPickedUp, creatng->owner, picktng->index); + EvKind_SpellPickedUp, creatng->owner, picktng->index, 0); // Only play speech message if new event was created if (evidx > 0) { @@ -139,7 +139,7 @@ EventIndex update_library_object_pickup_event(struct Thing *creatng, struct Thin { evidx = event_create_event_or_update_nearby_existing_event( picktng->mappos.x.val, picktng->mappos.y.val, - EvKind_DnSpecialFound, creatng->owner, picktng->index); + EvKind_DnSpecialFound, creatng->owner, picktng->index, 0); // Only play speech message if new event was created if (evidx > 0) { @@ -363,7 +363,7 @@ void process_player_research(PlayerNumber plyr_idx) { add_item_to_room_capacity(room, true); } - event_create_event(spelltng->mappos.x.val, spelltng->mappos.y.val, EvKind_NewSpellResrch, spelltng->owner, pwkind); + event_create_event(spelltng->mappos.x.val, spelltng->mappos.y.val, EvKind_NewSpellResrch, spelltng->owner, pwkind, 0); create_effect(&pos, TngEff_ResearchComplete, spelltng->owner); } else @@ -382,7 +382,7 @@ void process_player_research(PlayerNumber plyr_idx) { RoomKind rkind; rkind = rsrchval->rkind; - event_create_event(0, 0, EvKind_NewRoomResrch, plyr_idx, rkind); + event_create_event(0, 0, EvKind_NewRoomResrch, plyr_idx, rkind, 0); dungeon->room_buildable[rkind] |= 3; // Player may build room and may research it again if (is_my_player_number(plyr_idx)) output_message(SMsg_ResearchedRoom, 0); diff --git a/src/room_util.c b/src/room_util.c index 084cafcae5..20d448cff3 100644 --- a/src/room_util.c +++ b/src/room_util.c @@ -548,10 +548,10 @@ EventIndex update_cannot_find_room_of_role_wth_spare_capacity_event(PlayerNumber switch (rrole) { case RoRoF_LairStorage: - evidx = event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_NoMoreLivingSet, plyr_idx, creatng->index); + evidx = event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_NoMoreLivingSet, plyr_idx, creatng->index, 0); break; case RoRoF_GoldStorage: - evidx = event_create_event_or_update_nearby_existing_event(0, 0, EvKind_TreasureRoomFull, plyr_idx, 0); + evidx = event_create_event_or_update_nearby_existing_event(0, 0, EvKind_TreasureRoomFull, plyr_idx, 0, 0); break; default: evidx = 1; @@ -565,7 +565,7 @@ EventIndex update_cannot_find_room_of_role_wth_spare_capacity_event(PlayerNumber SYNCDBG(5,"Player %d has %s which cannot reach %s",(int)plyr_idx,thing_model_name(creatng),room_role_code_name(rrole)); RoomKind rkind = find_first_roomkind_with_role(rrole); evidx = event_create_event_or_update_nearby_existing_event( - creatng->mappos.x.val, creatng->mappos.y.val, EvKind_WorkRoomUnreachable, plyr_idx, rkind); + creatng->mappos.x.val, creatng->mappos.y.val, EvKind_WorkRoomUnreachable, plyr_idx, rkind, 0); if (evidx > 0) { output_room_message(plyr_idx, rkind, OMsg_RoomNoRoute); } @@ -578,10 +578,10 @@ EventIndex update_cannot_find_room_of_role_wth_spare_capacity_event(PlayerNumber switch (rrole) { case RoRoF_LairStorage: - evidx = event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_NoMoreLivingSet, plyr_idx, creatng->index); + evidx = event_create_event_or_update_nearby_existing_event(creatng->mappos.x.val, creatng->mappos.y.val, EvKind_NoMoreLivingSet, plyr_idx, creatng->index, 0); break; case RoRoF_GoldStorage: - evidx = event_create_event_or_update_nearby_existing_event(0, 0, EvKind_NeedTreasureRoom, plyr_idx, 0); + evidx = event_create_event_or_update_nearby_existing_event(0, 0, EvKind_NeedTreasureRoom, plyr_idx, 0, 0); break; default: evidx = 1; diff --git a/src/room_workshop.c b/src/room_workshop.c index ecb427b5cc..8fc8e9cb44 100644 --- a/src/room_workshop.c +++ b/src/room_workshop.c @@ -134,12 +134,12 @@ TbBool create_workshop_object_in_workshop_room(PlayerNumber plyr_idx, ThingClass { case TCls_Trap: if ((dungeon->mnfct_info.trap_build_flags[tngmodel] & MnfBldF_Built) == 0) { - event_create_event(cratetng->mappos.x.val, cratetng->mappos.y.val, EvKind_NewTrap, plyr_idx, tngmodel); + event_create_event(cratetng->mappos.x.val, cratetng->mappos.y.val, EvKind_NewTrap, plyr_idx, tngmodel, 0); } break; case TCls_Door: if ((dungeon->mnfct_info.door_build_flags[tngmodel] & MnfBldF_Built) == 0) { - event_create_event(cratetng->mappos.x.val, cratetng->mappos.y.val, EvKind_NewDoor, plyr_idx, tngmodel); + event_create_event(cratetng->mappos.x.val, cratetng->mappos.y.val, EvKind_NewDoor, plyr_idx, tngmodel, 0); } break; default: @@ -681,7 +681,7 @@ EventIndex update_workshop_object_pickup_event(struct Thing *creatng, struct Thi { evidx = event_create_event_or_update_nearby_existing_event( picktng->mappos.x.val, picktng->mappos.y.val, - EvKind_TrapCrateFound, creatng->owner, picktng->index); + EvKind_TrapCrateFound, creatng->owner, picktng->index, 0); if ( (is_my_player_number(picktng->owner)) && (!is_my_player_number(creatng->owner)) ) { output_message(SMsg_TrapStolen, 0); @@ -701,7 +701,7 @@ EventIndex update_workshop_object_pickup_event(struct Thing *creatng, struct Thi { evidx = event_create_event_or_update_nearby_existing_event( picktng->mappos.x.val, picktng->mappos.y.val, - EvKind_DoorCrateFound, creatng->owner, picktng->index); + EvKind_DoorCrateFound, creatng->owner, picktng->index, 0); if ( (is_my_player_number(picktng->owner)) && (!is_my_player_number(creatng->owner)) ) { output_message(SMsg_DoorStolen, 0); diff --git a/src/spdigger_stack.c b/src/spdigger_stack.c index 5726b3cb54..9d9eac48d6 100644 --- a/src/spdigger_stack.c +++ b/src/spdigger_stack.c @@ -1386,7 +1386,7 @@ long add_to_pretty_to_imp_stack_if_need_to(MapSlabCoord slb_x, MapSlabCoord slb_ { if ((players_are_enemies(doortng->owner, dungeon->owner)) && (slab_by_players_land(dungeon->owner, slb_x, slb_y))) { - event_create_event_or_update_same_target_existing_event(doortng->mappos.x.val, doortng->mappos.y.val, EvKind_EnemyDoor, dungeon->owner, doortng->index); + event_create_event_or_update_same_target_existing_event(doortng->mappos.x.val, doortng->mappos.y.val, EvKind_EnemyDoor, dungeon->owner, doortng->index, 0); } } } @@ -3291,7 +3291,7 @@ long check_out_worker_pickup_trap_for_workshop(struct Thing *thing, struct Digge { evidx = event_create_event_or_update_nearby_existing_event( subtile_coord_center(stl_x), subtile_coord_center(stl_y), - EvKind_TrapCrateFound, thing->owner, sectng->index); + EvKind_TrapCrateFound, thing->owner, sectng->index, 0); if (evidx > 0) { @@ -3308,7 +3308,7 @@ long check_out_worker_pickup_trap_for_workshop(struct Thing *thing, struct Digge { evidx = event_create_event_or_update_nearby_existing_event( subtile_coord_center(stl_x), subtile_coord_center(stl_y), - EvKind_DoorCrateFound, thing->owner, sectng->index); + EvKind_DoorCrateFound, thing->owner, sectng->index, 0); if (evidx > 0) { if ( (is_my_player_number(thing->owner)) && (!is_my_player_number(sectng->owner)) ) diff --git a/src/thing_doors.c b/src/thing_doors.c index fc704385a6..98f99bc192 100644 --- a/src/thing_doors.c +++ b/src/thing_doors.c @@ -474,8 +474,8 @@ void reveal_secret_door_to_player(struct Thing *doortng,PlayerNumber plyr_idx) } if (!players_are_mutual_allies(plyr_idx, doortng->owner)) { - event_create_event(doortng->mappos.x.val, doortng->mappos.y.val, EvKind_SecretDoorDiscovered, plyr_idx, 0); - event_create_event(doortng->mappos.x.val, doortng->mappos.y.val, EvKind_SecretDoorSpotted, doortng->owner, 0); + event_create_event(doortng->mappos.x.val, doortng->mappos.y.val, EvKind_SecretDoorDiscovered, plyr_idx, 0, 0); + event_create_event(doortng->mappos.x.val, doortng->mappos.y.val, EvKind_SecretDoorSpotted, doortng->owner, 0, 0); } set_flag(doortng->door.revealed,to_flag(plyr_idx)); MapSubtlCoord stl_x = doortng->mappos.x.stl.num; diff --git a/src/thing_effects.c b/src/thing_effects.c index 50b9e33cd6..9b25c1e1b1 100644 --- a/src/thing_effects.c +++ b/src/thing_effects.c @@ -1068,7 +1068,7 @@ TbBool explosion_affecting_thing(struct Thing *tngsrc, struct Thing *tngdst, con SYNCDBG(7,"Causing %d damage to %s at distance %d",(int)damage,thing_model_name(tngdst),(int)distance); apply_damage_to_thing(tngdst, damage, -1); affected = true; - event_create_event_or_update_nearby_existing_event(tngdst->mappos.x.val, tngdst->mappos.y.val,EvKind_HeartAttacked, tngdst->owner, 0); + event_create_event_or_update_nearby_existing_event(tngdst->mappos.x.val, tngdst->mappos.y.val,EvKind_HeartAttacked, tngdst->owner, 0, 0); if (is_my_player_number(tngdst->owner)) { output_message(SMsg_HeartUnderAttack, 400); diff --git a/src/thing_shots.c b/src/thing_shots.c index 822b44e654..875360dcd6 100644 --- a/src/thing_shots.c +++ b/src/thing_shots.c @@ -868,7 +868,7 @@ static TbBool shot_hit_object_at(struct Thing *shotng, struct Thing *target, str } if (shotng->owner != target->owner) { - event_create_event_or_update_nearby_existing_event(shootertng->mappos.x.val, shootertng->mappos.y.val, EvKind_HeartAttacked, target->owner, shootertng->index); + event_create_event_or_update_nearby_existing_event(shootertng->mappos.x.val, shootertng->mappos.y.val, EvKind_HeartAttacked, target->owner, shootertng->index, 0); if (is_my_player_number(target->owner)) { output_message(SMsg_HeartUnderAttack, 400); controller_rumble(50); diff --git a/src/thing_traps.c b/src/thing_traps.c index 379545990a..b6ca0cc18e 100644 --- a/src/thing_traps.c +++ b/src/thing_traps.c @@ -592,7 +592,7 @@ void activate_trap(struct Thing *traptng, struct Thing *creatng) struct TrapConfigStats *trapst = get_trap_model_stats(traptng->model); if (trapst->notify == true) { - event_create_event(traptng->mappos.x.val, traptng->mappos.y.val, EvKind_AlarmTriggered, traptng->owner, 0); + event_create_event(traptng->mappos.x.val, traptng->mappos.y.val, EvKind_AlarmTriggered, traptng->owner, 0, 0); } thing_play_sample(traptng, trapst->trigger_sound_idx, NORMAL_PITCH, 0, 3, 0, 2, FULL_LOUDNESS); switch (trapst->activation_type) @@ -656,7 +656,7 @@ void activate_trap_by_slap(struct PlayerInfo *player, struct Thing* traptng) traptng->trap.revealed = 1; if (trapst->notify == true) { - event_create_event(traptng->mappos.x.val, traptng->mappos.y.val, EvKind_AlarmTriggered, traptng->owner, 0); + event_create_event(traptng->mappos.x.val, traptng->mappos.y.val, EvKind_AlarmTriggered, traptng->owner, 0, 0); } thing_play_sample(traptng, trapst->trigger_sound_idx, NORMAL_PITCH, 0, 3, 0, 2, FULL_LOUDNESS); From a754691104393cd5d9102bf56a5e6a73fa8b9674 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Mon, 30 Mar 2026 16:45:46 +0100 Subject: [PATCH 13/27] tried setting up headers properly etc --- src/frontend.cpp | 21 +-------------------- src/frontend.h | 27 +++++++++++++++++++++++++++ src/main.cpp | 26 ++++++++++++++++++++------ 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index 2f18ae4e82..c7d95efd13 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -381,26 +381,7 @@ struct EventTypeInfo event_button_info[] = { }; // setup of message colours for i,!,? (icons and default vary) -typedef enum { - MSG_COLOUR_DEFAULT, - MSG_COLOUR_BLUE, - MSG_COLOUR_BROWN, - MSG_COLOUR_GREEN, - MSG_COLOUR_GREY, - MSG_COLOUR_ORANGE, - MSG_COLOUR_PGREEN, - MSG_COLOUR_PURPLE, - MSG_COLOUR_RED, - MSG_COLOUR_WHITE, - MSG_COLOUR_YELLOW, - MSG_COLOUR_COUNT -} MsgColour; -typedef enum { - MSG_ICON_INFO, - MSG_ICON_EXCLAM, - MSG_ICON_QUESTN, - MSG_ICON_COUNT -} MsgIconType; +// see MsgColour and MsgIconType // might need to move to somewhere else (i.e. where script command goes) // interpret possible colour strings, otherwise fallback to default if not recognised. diff --git a/src/frontend.h b/src/frontend.h index 7a8fef05bf..a99f105130 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -229,6 +229,33 @@ enum IngameButtonDesignationIDs { BID_ASSIST }; +typedef enum { + MSG_COLOUR_DEFAULT, + MSG_COLOUR_BLUE, + MSG_COLOUR_BROWN, + MSG_COLOUR_GREEN, + MSG_COLOUR_GREY, + MSG_COLOUR_ORANGE, + MSG_COLOUR_PGREEN, + MSG_COLOUR_PURPLE, + MSG_COLOUR_RED, + MSG_COLOUR_WHITE, + MSG_COLOUR_YELLOW, + MSG_COLOUR_COUNT +} MsgColour; + +typedef enum { + MSG_ICON_INFO, + MSG_ICON_EXCLAM, + MSG_ICON_QUESTN, + MSG_ICON_COUNT +} MsgIconType; + +MsgColour get_colour(const char *input); + +extern const struct NamedCommand message_colour_desc[]; +extern int rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT]; + struct GuiMenu; struct GuiButton; struct TbLoadFiles; diff --git a/src/main.cpp b/src/main.cpp index 095544f20d..c9275b3b17 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -131,6 +131,8 @@ #include "net_input_lag.h" #include "moonphase.h" #include "frontmenu_ingame_map.h" +#include "frontend.h" +#include "sprites.h" #include #ifdef FUNCTESTING @@ -1948,12 +1950,18 @@ void set_general_bonus_information_at_location(long msg_id, TbMapLocation target struct PlayerInfo *player; long pos_x; long pos_y; + long x, y; player = get_my_player(); - find_map_location_coords(target, 0, 0, my_player_number, __func__); + find_map_location_coords(target, &x, &y, my_player_number, __func__); pos_x = 0; pos_y = 0; + if ((x != 0) || (y != 0)) + { + pos_y = subtile_coord_center(y); + pos_x = subtile_coord_center(x); + } MsgColour colour = get_colour(colour_value); - int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_BonusInformation, player->id_number, -msg_id, icon); } @@ -1972,7 +1980,7 @@ void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSu pos_x = subtile_coord_center(x); } MsgColour colour = get_colour(colour_value); - int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_BonusInformation, player->id_number, -msg_id, icon); } @@ -1981,12 +1989,18 @@ void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, struct PlayerInfo *player; long pos_x; long pos_y; + long x, y; player = get_my_player(); - find_map_location_coords(target, 0, 0, my_player_number, __func__); + find_map_location_coords(target, &x, &y, my_player_number, __func__); pos_x = 0; pos_y = 0; + if ((x != 0) || (y != 0)) + { + pos_y = subtile_coord_center(y); + pos_x = subtile_coord_center(x); + } MsgColour colour = get_colour(colour_value); - int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } @@ -2006,7 +2020,7 @@ void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubt pos_x = subtile_coord_center(x); } MsgColour colour = get_colour(colour_value); - int icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; + GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } From 089f375c55ef1eab90fae2bcbbe1d3ec268b9a8a Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Tue, 31 Mar 2026 10:52:55 +0100 Subject: [PATCH 14/27] compiler fixes hopefully --- src/frontend.h | 3 ++- src/keeperfx.hpp | 4 ++++ src/lvl_script_lib.h | 9 +++++---- src/main.cpp | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/frontend.h b/src/frontend.h index a99f105130..7ad3cfec69 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -23,6 +23,7 @@ #include "bflib_guibtns.h" #include "gui_frontmenu.h" #include "game_saves.h" +#include "config.h" #ifdef __cplusplus extern "C" { @@ -254,7 +255,7 @@ typedef enum { MsgColour get_colour(const char *input); extern const struct NamedCommand message_colour_desc[]; -extern int rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT]; +extern GUIPanelSprite rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT]; struct GuiMenu; struct GuiButton; diff --git a/src/keeperfx.hpp b/src/keeperfx.hpp index 10719a3f99..b54c969810 100644 --- a/src/keeperfx.hpp +++ b/src/keeperfx.hpp @@ -275,6 +275,10 @@ short resign_level(struct PlayerInfo *player); short complete_level(struct PlayerInfo *player); void set_general_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); +void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) +void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) +void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) void process_objective(const char *msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_general_objective(long msg_id, TbMapLocation target, long x, long y); void turn_off_power_sight_of_evil(PlayerNumber plridx); diff --git a/src/lvl_script_lib.h b/src/lvl_script_lib.h index 769686ce31..d0505a256a 100644 --- a/src/lvl_script_lib.h +++ b/src/lvl_script_lib.h @@ -204,10 +204,11 @@ enum TbScriptCommands { Cmd_DISPLAY_WARNING = 192, Cmd_DISPLAY_WARNING_WITH_POS = 193, Cmd_QUICK_BONUS_OBJECTIVE = 194, - Cmd_QUICK_BONUS_INFORMATION = 195, - Cmd_QUICK_WARNING = 196, - Cmd_QUICK_BONUS_OBJECTIVE_WITH_POS = 197, - Cmd_QUICK_BONUS_INFORMATION_WITH_POS = 198, + Cmd_QUICK_BONUS_OBJECTIVE_WITH_POS = 195, + Cmd_QUICK_BONUS_INFORMATION = 196, + Cmd_QUICK_BONUS_INFORMATION_WITH_POS = 197, + Cmd_QUICK_WARNING = 198, + Cmd_QUICK_WARNING_WITH_POS = 199, }; struct ScriptLine { diff --git a/src/main.cpp b/src/main.cpp index c9275b3b17..e8e64d8d1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1950,7 +1950,7 @@ void set_general_bonus_information_at_location(long msg_id, TbMapLocation target struct PlayerInfo *player; long pos_x; long pos_y; - long x, y; + MapSubtlCoord x, y; player = get_my_player(); find_map_location_coords(target, &x, &y, my_player_number, __func__); pos_x = 0; @@ -1989,7 +1989,7 @@ void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, struct PlayerInfo *player; long pos_x; long pos_y; - long x, y; + MapSubtlCoord x, y; player = get_my_player(); find_map_location_coords(target, &x, &y, my_player_number, __func__); pos_x = 0; From 746c91cbb0fd65a19349da5da81ab47b4bcd853a Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Tue, 31 Mar 2026 11:04:29 +0100 Subject: [PATCH 15/27] semicolons lol --- src/keeperfx.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/keeperfx.hpp b/src/keeperfx.hpp index b54c969810..d9b742c13a 100644 --- a/src/keeperfx.hpp +++ b/src/keeperfx.hpp @@ -275,10 +275,10 @@ short resign_level(struct PlayerInfo *player); short complete_level(struct PlayerInfo *player); void set_general_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); -void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) -void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) -void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) -void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value); +void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value); +void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value); +void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value); void process_objective(const char *msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_general_objective(long msg_id, TbMapLocation target, long x, long y); void turn_off_power_sight_of_evil(PlayerNumber plridx); From 467c101b364a556e8ee3d5acc542ceeb1579cba7 Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Tue, 31 Mar 2026 13:43:21 +0100 Subject: [PATCH 16/27] more fixes for compiler --- src/frontend.cpp | 6 +++--- src/frontend.h | 3 ++- src/keeperfx.hpp | 8 ++++---- src/lvl_script_commands.c | 32 +++++++++----------------------- src/main.cpp | 28 ++++++++++++++++++++-------- src/map_events.h | 2 +- 6 files changed, 39 insertions(+), 40 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index c7d95efd13..67af827e54 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -402,18 +402,18 @@ const struct NamedCommand message_colour_desc[] = { {"YELLOW", MSG_COLOUR_YELLOW}, {NULL, 0}, }; -MsgColour get_colour(const char *input) +MsgColour get_colour_for_coloured_message(const char *input) { if (!input) return MSG_COLOUR_DEFAULT; for (int i = 0; message_colour_desc[i].name; i++) { if (strcmp(input, message_colour_desc[i].name) == 0) { - return message_colour_desc[i].value; + return message_colour_desc[i].num; } } return MSG_COLOUR_DEFAULT; } -int rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT] = { +GUIPanelSprite rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT] = { // MSG_ICON_INFO (i) { GPS_message_rpanel_msg_inforg_act, // pgreen is default diff --git a/src/frontend.h b/src/frontend.h index 7ad3cfec69..a37baf8c54 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -24,6 +24,7 @@ #include "gui_frontmenu.h" #include "game_saves.h" #include "config.h" +#include "sprites.h" #ifdef __cplusplus extern "C" { @@ -252,7 +253,7 @@ typedef enum { MSG_ICON_COUNT } MsgIconType; -MsgColour get_colour(const char *input); +MsgColour get_colour_for_coloured_message(const char *input); extern const struct NamedCommand message_colour_desc[]; extern GUIPanelSprite rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT]; diff --git a/src/keeperfx.hpp b/src/keeperfx.hpp index d9b742c13a..8fb9a3b518 100644 --- a/src/keeperfx.hpp +++ b/src/keeperfx.hpp @@ -275,10 +275,10 @@ short resign_level(struct PlayerInfo *player); short complete_level(struct PlayerInfo *player); void set_general_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); -void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value); -void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value); -void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value); -void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value); +void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, long colour_value); +void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, long colour_value); +void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, long colour_value); +void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, long colour_value); void process_objective(const char *msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_general_objective(long msg_id, TbMapLocation target, long x, long y); void turn_off_power_sight_of_evil(PlayerNumber plridx); diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 90a5fde341..e7672aa07f 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -458,24 +458,6 @@ const struct NamedCommand texture_pack_desc[] = { {NULL, 0}, }; -const struct NamedCommand message_colour_desc[] = { - {"DEFAULT", 0}, - {"BLUE", 1}, - {"BROWN", 2}, - {"GREEN", 3}, - {"GREY", 4}, - {"GRAY", 4}, - {"ORANGE", 5}, - {"PGREEN", 6}, - {"PLAYERGREEN",6}, - {"GREEN2", 6}, - {"PURPLE", 7}, - {"RED", 8}, - {"WHITE", 9}, - {"YELLOW", 10}, - {NULL, 0}, -}; - ThingModel parse_creature_name(const char *creature_name) { ThingModel ret = get_rid(creature_desc, creature_name); @@ -6510,12 +6492,16 @@ const struct CommandDesc command_desc[] = { {"LOCK_POSSESSION", "PB! ", Cmd_LOCK_POSSESSION, &lock_possession_check, &lock_possession_process}, {"SET_DIGGER", "PC ", Cmd_SET_DIGGER , &set_digger_check, &set_digger_process}, {"RUN_LUA_CODE", "A ", Cmd_RUN_LUA_CODE , &run_lua_code_check, &run_lua_code_process}, - {"DISPLAY_BONUS_OBJECTIVE", "NLa ", Cmd_DISPLAY_OBJECTIVE, &display_objective_check, &display_objective_process}, - {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NNNa ", Cmd_DISPLAY_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, - {"DISPLAY_BONUS_INFORMATION", "NLa ", Cmd_DISPLAY_INFORMATION, NULL, NULL}, - {"DISPLAY_BONUS_INFORMATION_WITH_POS","NNNa ", Cmd_DISPLAY_INFORMATION_WITH_POS, NULL, NULL}, + {"DISPLAY_BONUS_OBJECTIVE", "NLa ", Cmd_DISPLAY_BONUS_OBJECTIVE, &display_objective_check, &display_objective_process}, + {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NNNa ", Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, + {"DISPLAY_BONUS_INFORMATION", "NLa ", Cmd_DISPLAY_BONUS_INFORMATION, NULL, NULL}, + {"DISPLAY_BONUS_INFORMATION_WITH_POS","NNNa ", Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS, NULL, NULL}, + {"QUICK_BONUS_OBJECTIVE", "NALa ", Cmd_QUICK_BONUS_OBJECTIVE, NULL, NULL}, + {"QUICK_BONUS_INFORMATION", "NALa ", Cmd_QUICK_BONUS_INFORMATION, NULL, NULL}, + {"QUICK_BONUS_OBJECTIVE_WITH_POS", "NANNa ", Cmd_QUICK_BONUS_OBJECTIVE_WITH_POS, NULL, NULL}, + {"QUICK_BONUS_INFORMATION_WITH_POS", "NANNa ", Cmd_QUICK_BONUS_INFORMATION_WITH_POS, NULL, NULL}, {"DISPLAY_WARNING", "NLa ", Cmd_DISPLAY_WARNING, NULL, NULL}, - {"DISPLAY_WARNING_WITH_POS", "NNNa ", Cmd_DISPLAY_WARNING, NULL, NULL}, + {"DISPLAY_WARNING_WITH_POS", "NNNa ", Cmd_DISPLAY_WARNING_WITH_POS, NULL, NULL}, {"QUICK_WARNING", "NALa ", Cmd_QUICK_WARNING, NULL, NULL}, {"QUICK_WARNING_WITH_POS", "NANNa ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, {NULL, " ", Cmd_NONE, NULL, NULL}, diff --git a/src/main.cpp b/src/main.cpp index e8e64d8d1e..00075c0164 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1945,7 +1945,7 @@ void set_quick_information(long msg_id, TbMapLocation target, MapSubtlCoord x, M event_create_event(pos_x, pos_y, EvKind_QuickInformation, player->id_number, -msg_id, 0); } -void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) +void set_general_bonus_information_at_location(long msg_id, TbMapLocation target, long colour_value) { struct PlayerInfo *player; long pos_x; @@ -1960,12 +1960,15 @@ void set_general_bonus_information_at_location(long msg_id, TbMapLocation target pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - MsgColour colour = get_colour(colour_value); + if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) + colour = MSG_COLOUR_DEFAULT; + else + colour = (MsgColour)colour_value; GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_BonusInformation, player->id_number, -msg_id, icon); } -void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, long colour_value) { struct PlayerInfo *player; long pos_x; @@ -1979,12 +1982,15 @@ void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSu pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - MsgColour colour = get_colour(colour_value); + if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) + colour = MSG_COLOUR_DEFAULT; + else + colour = (MsgColour)colour_value; GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_BonusInformation, player->id_number, -msg_id, icon); } -void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, const char *colour_value) +void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, long colour_value) { struct PlayerInfo *player; long pos_x; @@ -1999,13 +2005,16 @@ void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - MsgColour colour = get_colour(colour_value); + if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) + colour = MSG_COLOUR_DEFAULT; + else + colour = (MsgColour)colour_value; GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } -void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, const char *colour_value) +void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, long colour_value) { struct PlayerInfo *player; long pos_x; @@ -2019,7 +2028,10 @@ void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubt pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } - MsgColour colour = get_colour(colour_value); + if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) + colour = MSG_COLOUR_DEFAULT; + else + colour = (MsgColour)colour_value; GUIPanelSprite icon = rpanel_msg_colour[MSG_ICON_INFO][colour]; event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } diff --git a/src/map_events.h b/src/map_events.h index 94de3698e6..0bd2e31e20 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -27,7 +27,7 @@ extern "C" { #endif /******************************************************************************/ #define EVENT_BUTTONS_COUNT 12 -#define EVENT_KIND_COUNT 45 +#define EVENT_KIND_COUNT 47 #define EVENTS_COUNT 200 #define INVALID_EVENT &game.event[0] From 25138931b3a3baeb0ecd89d84e72e3ba1e02583e Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:01:22 +0100 Subject: [PATCH 17/27] moar --- src/frontend.cpp | 2 +- src/frontend.h | 2 +- src/main.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index 67af827e54..3d432bcec1 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -407,7 +407,7 @@ MsgColour get_colour_for_coloured_message(const char *input) if (!input) return MSG_COLOUR_DEFAULT; for (int i = 0; message_colour_desc[i].name; i++) { if (strcmp(input, message_colour_desc[i].name) == 0) { - return message_colour_desc[i].num; + return (MsgColour)message_colour_desc[i].num; } } return MSG_COLOUR_DEFAULT; diff --git a/src/frontend.h b/src/frontend.h index a37baf8c54..af88887423 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -256,7 +256,7 @@ typedef enum { MsgColour get_colour_for_coloured_message(const char *input); extern const struct NamedCommand message_colour_desc[]; -extern GUIPanelSprite rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT]; +extern enum GUIPanelSprite rpanel_msg_colour[MSG_ICON_COUNT][MSG_COLOUR_COUNT]; struct GuiMenu; struct GuiButton; diff --git a/src/main.cpp b/src/main.cpp index 00075c0164..2e22aa55b9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1960,6 +1960,7 @@ void set_general_bonus_information_at_location(long msg_id, TbMapLocation target pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } + MsgColour colour; if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) colour = MSG_COLOUR_DEFAULT; else @@ -1982,6 +1983,7 @@ void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSu pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } + MsgColour colour; if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) colour = MSG_COLOUR_DEFAULT; else @@ -2005,6 +2007,7 @@ void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } + MsgColour colour; if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) colour = MSG_COLOUR_DEFAULT; else @@ -2028,6 +2031,7 @@ void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubt pos_y = subtile_coord_center(y); pos_x = subtile_coord_center(x); } + MsgColour colour; if (colour_value < 0 || colour_value >= MSG_COLOUR_COUNT) colour = MSG_COLOUR_DEFAULT; else From 45c8de8d5c1959bba8b1e1b27d70f7a3f9f769f1 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 16:12:21 +0200 Subject: [PATCH 18/27] Made a functional script command --- src/lvl_script_commands.c | 43 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index d13a4b13fa..dceee75b98 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -833,6 +833,45 @@ static void display_objective_process(struct ScriptContext *context) } } +static void display_bonus_objective_check(const struct ScriptLine* scline) +{ + long msg_num = scline->np[0]; + long x, y; + TbMapLocation location = 0; + if ((msg_num < 0) || (msg_num >= STRINGS_MAX)) + { + SCRPTERRLOG("Invalid TEXT number"); + return; + } + JUSTLOG("Spatulade wants to display icon %s", scline->tp[2]); + if (scline->command == Cmd_DISPLAY_BONUS_OBJECTIVE) + { + const char* where = scline->tp[2]; + if (!get_map_location_id(where, &location)) + { + return; + } + command_add_value(Cmd_DISPLAY_BONUS_OBJECTIVE, ALL_PLAYERS, msg_num, location, 0); + } + else + { + x = scline->np[1]; + y = scline->np[2]; + command_add_value(Cmd_DISPLAY_BONUS_OBJECTIVE, ALL_PLAYERS, msg_num, location, get_subtile_number(x, y)); + } +} + +static void display_bonus_objective_process(struct ScriptContext* context) +{ + if (my_player_number == context->player_idx) + { + set_general_objective(context->value->longs[0], + context->value->longs[1], + stl_num_decode_x(context->value->longs[2]), + stl_num_decode_y(context->value->longs[2])); + } +} + static void tag_map_rect_check(const struct ScriptLine* scline) { ALLOCATE_SCRIPT_VALUE(scline->command, scline->np[0]); @@ -6488,8 +6527,8 @@ const struct CommandDesc command_desc[] = { {"LOCK_POSSESSION", "PB! ", Cmd_LOCK_POSSESSION, &lock_possession_check, &lock_possession_process}, {"SET_DIGGER", "PC ", Cmd_SET_DIGGER , &set_digger_check, &set_digger_process}, {"RUN_LUA_CODE", "A ", Cmd_RUN_LUA_CODE , &run_lua_code_check, &run_lua_code_process}, - {"DISPLAY_BONUS_OBJECTIVE", "NLa ", Cmd_DISPLAY_BONUS_OBJECTIVE, &display_objective_check, &display_objective_process}, - {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NNNa ", Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS, &display_objective_check, &display_objective_process}, + {"DISPLAY_BONUS_OBJECTIVE", "NAl ", Cmd_DISPLAY_BONUS_OBJECTIVE, &display_bonus_objective_check, &display_bonus_objective_process}, + {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NNNa ", Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS, &display_bonus_objective_check, &display_bonus_objective_process }, {"DISPLAY_BONUS_INFORMATION", "NLa ", Cmd_DISPLAY_BONUS_INFORMATION, NULL, NULL}, {"DISPLAY_BONUS_INFORMATION_WITH_POS","NNNa ", Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS, NULL, NULL}, {"QUICK_BONUS_OBJECTIVE", "NALa ", Cmd_QUICK_BONUS_OBJECTIVE, NULL, NULL}, From b3f5380d81e4df70c78982b021c35994d4d7bb05 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 16:14:08 +0200 Subject: [PATCH 19/27] Correct param --- src/lvl_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index dceee75b98..264b02913c 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -843,7 +843,7 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) SCRPTERRLOG("Invalid TEXT number"); return; } - JUSTLOG("Spatulade wants to display icon %s", scline->tp[2]); + JUSTLOG("Spatulade wants to display icon `%s`", scline->tp[1]); if (scline->command == Cmd_DISPLAY_BONUS_OBJECTIVE) { const char* where = scline->tp[2]; From 98461c0c29c9131b21ed78b7267721197300fe0a Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 16:17:15 +0200 Subject: [PATCH 20/27] Helped get the number too --- src/lvl_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 264b02913c..be37d0ba78 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -843,7 +843,7 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) SCRPTERRLOG("Invalid TEXT number"); return; } - JUSTLOG("Spatulade wants to display icon `%s`", scline->tp[1]); + JUSTLOG("Spatulade wants to display icon `%s` which has number %ld", scline->tp[1], get_id(message_colour_desc, scline->tp[1])); if (scline->command == Cmd_DISPLAY_BONUS_OBJECTIVE) { const char* where = scline->tp[2]; From 9147fd91c0568c6e65b667a0fd32f806358378cf Mon Sep 17 00:00:00 2001 From: Spatulade <100633508+Spatulade@users.noreply.github.com> Date: Tue, 31 Mar 2026 15:50:24 +0100 Subject: [PATCH 21/27] moved arguments round if you want colour second after ID --- src/lvl_script_commands.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index be37d0ba78..5814ccd92c 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -6528,17 +6528,17 @@ const struct CommandDesc command_desc[] = { {"SET_DIGGER", "PC ", Cmd_SET_DIGGER , &set_digger_check, &set_digger_process}, {"RUN_LUA_CODE", "A ", Cmd_RUN_LUA_CODE , &run_lua_code_check, &run_lua_code_process}, {"DISPLAY_BONUS_OBJECTIVE", "NAl ", Cmd_DISPLAY_BONUS_OBJECTIVE, &display_bonus_objective_check, &display_bonus_objective_process}, - {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NNNa ", Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS, &display_bonus_objective_check, &display_bonus_objective_process }, - {"DISPLAY_BONUS_INFORMATION", "NLa ", Cmd_DISPLAY_BONUS_INFORMATION, NULL, NULL}, - {"DISPLAY_BONUS_INFORMATION_WITH_POS","NNNa ", Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS, NULL, NULL}, - {"QUICK_BONUS_OBJECTIVE", "NALa ", Cmd_QUICK_BONUS_OBJECTIVE, NULL, NULL}, - {"QUICK_BONUS_INFORMATION", "NALa ", Cmd_QUICK_BONUS_INFORMATION, NULL, NULL}, - {"QUICK_BONUS_OBJECTIVE_WITH_POS", "NANNa ", Cmd_QUICK_BONUS_OBJECTIVE_WITH_POS, NULL, NULL}, - {"QUICK_BONUS_INFORMATION_WITH_POS", "NANNa ", Cmd_QUICK_BONUS_INFORMATION_WITH_POS, NULL, NULL}, - {"DISPLAY_WARNING", "NLa ", Cmd_DISPLAY_WARNING, NULL, NULL}, - {"DISPLAY_WARNING_WITH_POS", "NNNa ", Cmd_DISPLAY_WARNING_WITH_POS, NULL, NULL}, - {"QUICK_WARNING", "NALa ", Cmd_QUICK_WARNING, NULL, NULL}, - {"QUICK_WARNING_WITH_POS", "NANNa ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, + {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NANN ", Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS, &display_bonus_objective_check, &display_bonus_objective_process }, + {"DISPLAY_BONUS_INFORMATION", "NAl ", Cmd_DISPLAY_BONUS_INFORMATION, NULL, NULL}, + {"DISPLAY_BONUS_INFORMATION_WITH_POS","NANN ", Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS, NULL, NULL}, + {"QUICK_BONUS_OBJECTIVE", "NAAl ", Cmd_QUICK_BONUS_OBJECTIVE, NULL, NULL}, + {"QUICK_BONUS_INFORMATION", "NAAl ", Cmd_QUICK_BONUS_INFORMATION, NULL, NULL}, + {"QUICK_BONUS_OBJECTIVE_WITH_POS", "NAANN ", Cmd_QUICK_BONUS_OBJECTIVE_WITH_POS, NULL, NULL}, + {"QUICK_BONUS_INFORMATION_WITH_POS", "NAANN ", Cmd_QUICK_BONUS_INFORMATION_WITH_POS, NULL, NULL}, + {"DISPLAY_WARNING", "NAl ", Cmd_DISPLAY_WARNING, NULL, NULL}, + {"DISPLAY_WARNING_WITH_POS", "NANN ", Cmd_DISPLAY_WARNING_WITH_POS, NULL, NULL}, + {"QUICK_WARNING", "NAAl ", Cmd_QUICK_WARNING, NULL, NULL}, + {"QUICK_WARNING_WITH_POS", "NAANN ", Cmd_QUICK_WARNING_WITH_POS, NULL, NULL}, {NULL, " ", Cmd_NONE, NULL, NULL}, }; From 463cb7a872222047556a9cf502dace25968a544f Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 17:42:53 +0200 Subject: [PATCH 22/27] Reworked DISPLAY_BONUS_OBJECTIVE to modern way --- src/lvl_script_commands.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 5814ccd92c..d774e1bb71 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -835,15 +835,26 @@ static void display_objective_process(struct ScriptContext *context) static void display_bonus_objective_check(const struct ScriptLine* scline) { - long msg_num = scline->np[0]; - long x, y; + ALLOCATE_SCRIPT_VALUE(scline->command, 0); + int16_t msg_num = scline->np[0]; + int16_t icon_idx = get_id(message_colour_desc, scline->tp[1]); + + if (icon_idx < 0) + { + SCRPTERRLOG("Invalid icon name %s", scline->tp[1]); + DEALLOCATE_SCRIPT_VALUE + return; + } + + MapSubtlCoord x, y; TbMapLocation location = 0; if ((msg_num < 0) || (msg_num >= STRINGS_MAX)) { - SCRPTERRLOG("Invalid TEXT number"); + SCRPTERRLOG("Invalid TEXT number %d", msg_num); + DEALLOCATE_SCRIPT_VALUE return; } - JUSTLOG("Spatulade wants to display icon `%s` which has number %ld", scline->tp[1], get_id(message_colour_desc, scline->tp[1])); + if (scline->command == Cmd_DISPLAY_BONUS_OBJECTIVE) { const char* where = scline->tp[2]; @@ -855,20 +866,29 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) } else { + //todo params still need to be corrected in script command Cmd_DISPLAY_BONUS_OBJECTIVE_FOR_POS x = scline->np[1]; y = scline->np[2]; - command_add_value(Cmd_DISPLAY_BONUS_OBJECTIVE, ALL_PLAYERS, msg_num, location, get_subtile_number(x, y)); } + + value->shorts[0] = msg_num; + value->shorts[1] = icon_idx; + value->shorts[2] = location; + value->shorts[3] = x; + value->shorts[4] = y; + + PROCESS_SCRIPT_VALUE(scline->command); } static void display_bonus_objective_process(struct ScriptContext* context) { if (my_player_number == context->player_idx) { - set_general_objective(context->value->longs[0], - context->value->longs[1], - stl_num_decode_x(context->value->longs[2]), - stl_num_decode_y(context->value->longs[2])); + JUSTLOG("Spatulade wants to display icon %d", context->value->shorts[1]); + set_general_objective(context->value->shorts[0], + context->value->shorts[2], + stl_num_decode_x(context->value->shorts[3]), + stl_num_decode_y(context->value->shorts[4])); } } From fd829ed8452a3d69ced058f468a27e8b90d2b986 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 17:45:10 +0200 Subject: [PATCH 23/27] No need for the decode --- src/lvl_script_commands.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index d774e1bb71..5514182b9e 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -885,10 +885,11 @@ static void display_bonus_objective_process(struct ScriptContext* context) if (my_player_number == context->player_idx) { JUSTLOG("Spatulade wants to display icon %d", context->value->shorts[1]); - set_general_objective(context->value->shorts[0], + set_general_objective( + context->value->shorts[0], context->value->shorts[2], - stl_num_decode_x(context->value->shorts[3]), - stl_num_decode_y(context->value->shorts[4])); + context->value->shorts[3], + context->value->shorts[4]); } } From 36b0a17b1eda26cc1a95393c16fc53d864a54bf0 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 20:56:21 +0200 Subject: [PATCH 24/27] Made it almost functional --- src/frontend.cpp | 42 +++++++++++++++++++++++++++++++++++++++ src/frontend.h | 1 + src/game_legacy.h | 3 +++ src/keeperfx.hpp | 3 ++- src/lvl_script_commands.c | 23 ++++++++++----------- src/lvl_script_lib.h | 1 - src/main.cpp | 17 +++++++++++++++- src/map_locations.c | 2 +- src/map_locations.h | 2 +- 9 files changed, 76 insertions(+), 18 deletions(-) diff --git a/src/frontend.cpp b/src/frontend.cpp index 6fa466ef54..0e5360b13f 100644 --- a/src/frontend.cpp +++ b/src/frontend.cpp @@ -3708,6 +3708,48 @@ void update_player_objectives(PlayerNumber plyr_idx) } } +void display_bonus_objectives(PlayerNumber plyr_idx, int icon, MapSubtlCoord x, MapSubtlCoord y) +{ + MapCoord cor_x; + MapCoord cor_y; + cor_y = 0; + cor_x = 0; + if ((x > 0) || (y > 0)) + { + cor_x = subtile_coord_center(x); + cor_y = subtile_coord_center(y); + } + int evbtn_idx; + for (evbtn_idx = 0; evbtn_idx < EVENT_BUTTONS_COUNT + 1; evbtn_idx++) + { + struct Dungeon* dungeon; + dungeon = get_players_num_dungeon(plyr_idx); + EventIndex evidx; + evidx = dungeon->event_button_index[evbtn_idx]; //todo bonus objective + struct Event* event; + event = &game.event[evidx]; + if (event->kind == EvKind_Objective) + { + event_create_event_or_update_old_event(cor_x, cor_y, EvKind_Objective, plyr_idx, 0, icon); + return; + } + } + if ((x == 255) && (y == 255)) + { + struct Thing* creatng = lord_of_the_land_find(); + if (thing_exists(creatng)) + { + cor_x = creatng->mappos.x.val; + cor_y = creatng->mappos.y.val; + } + event_create_event_or_update_nearby_existing_event(cor_x, cor_y, EvKind_Objective, plyr_idx, creatng->index, icon); + } + else + { + event_create_event_or_update_nearby_existing_event(cor_x, cor_y, EvKind_Objective, plyr_idx, 0, icon); + } +} + void display_objectives(PlayerNumber plyr_idx, MapSubtlCoord x, MapSubtlCoord y) { MapCoord cor_x; diff --git a/src/frontend.h b/src/frontend.h index af88887423..bf7f2ad02c 100644 --- a/src/frontend.h +++ b/src/frontend.h @@ -456,6 +456,7 @@ void toggle_gui_overlay_map(void); void update_player_objectives(PlayerNumber plyr_idx); void set_level_objective(const char *msg_text); +void display_bonus_objectives(PlayerNumber plyr_idx, int icon, MapSubtlCoord x, MapSubtlCoord y); void display_objectives(PlayerNumber plyr_idx,MapSubtlCoord x,MapSubtlCoord y); short toggle_main_cheat_menu(void); diff --git a/src/game_legacy.h b/src/game_legacy.h index 4eb281fb83..75c91a2e4d 100644 --- a/src/game_legacy.h +++ b/src/game_legacy.h @@ -40,6 +40,7 @@ #include "config_players.h" #include "config_slabsets.h" #include "dungeon_data.h" +#include "frontend.h" #include "thing_data.h" #include "thing_traps.h" #include "thing_doors.h" @@ -295,6 +296,8 @@ struct Game { struct CreatureBattle battles[BATTLES_COUNT]; char evntbox_text_objective[MESSAGE_TEXT_LEN]; char evntbox_text_buffer[MESSAGE_TEXT_LEN]; + char evntbox_text_bonus_objective[MSG_COLOUR_COUNT][MESSAGE_TEXT_LEN]; + char evntbox_text_bonus_buffer[MSG_COLOUR_COUNT][MESSAGE_TEXT_LEN]; struct TextScrollWindow evntbox_scroll_window; int32_t flash_button_index; /**< GUI Button Designation ID of a button which is supposed to flash, as part of tutorial. */ char loaded_swipe_idx; diff --git a/src/keeperfx.hpp b/src/keeperfx.hpp index 8fb9a3b518..2061a210a7 100644 --- a/src/keeperfx.hpp +++ b/src/keeperfx.hpp @@ -280,7 +280,8 @@ void set_general_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSu void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, long colour_value); void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, long colour_value); void process_objective(const char *msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); -void set_general_objective(long msg_id, TbMapLocation target, long x, long y); +void set_general_objective(TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); +void set_bonus_objective(PlayerNumber plyr_idx, int icon, TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void turn_off_power_sight_of_evil(PlayerNumber plridx); void turn_off_power_obey(PlayerNumber plyr_idx); diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 5514182b9e..a39e0fb3ab 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -835,13 +835,13 @@ static void display_objective_process(struct ScriptContext *context) static void display_bonus_objective_check(const struct ScriptLine* scline) { - ALLOCATE_SCRIPT_VALUE(scline->command, 0); - int16_t msg_num = scline->np[0]; - int16_t icon_idx = get_id(message_colour_desc, scline->tp[1]); + ALLOCATE_SCRIPT_VALUE(scline->command, scline->np[0]); + int16_t msg_num = scline->np[1]; + int16_t icon_idx = get_id(message_colour_desc, scline->tp[2]); if (icon_idx < 0) { - SCRPTERRLOG("Invalid icon name %s", scline->tp[1]); + SCRPTERRLOG("Invalid icon name %s", scline->tp[2]); DEALLOCATE_SCRIPT_VALUE return; } @@ -857,7 +857,7 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) if (scline->command == Cmd_DISPLAY_BONUS_OBJECTIVE) { - const char* where = scline->tp[2]; + const char* where = scline->tp[3]; if (!get_map_location_id(where, &location)) { return; @@ -867,8 +867,8 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) else { //todo params still need to be corrected in script command Cmd_DISPLAY_BONUS_OBJECTIVE_FOR_POS - x = scline->np[1]; - y = scline->np[2]; + x = scline->np[2]; + y = scline->np[3]; } value->shorts[0] = msg_num; @@ -882,15 +882,12 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) static void display_bonus_objective_process(struct ScriptContext* context) { - if (my_player_number == context->player_idx) - { - JUSTLOG("Spatulade wants to display icon %d", context->value->shorts[1]); - set_general_objective( + set_bonus_objective(context->player_idx, context->value->shorts[0], + context->value->shorts[1], context->value->shorts[2], context->value->shorts[3], context->value->shorts[4]); - } } static void tag_map_rect_check(const struct ScriptLine* scline) @@ -6548,7 +6545,7 @@ const struct CommandDesc command_desc[] = { {"LOCK_POSSESSION", "PB! ", Cmd_LOCK_POSSESSION, &lock_possession_check, &lock_possession_process}, {"SET_DIGGER", "PC ", Cmd_SET_DIGGER , &set_digger_check, &set_digger_process}, {"RUN_LUA_CODE", "A ", Cmd_RUN_LUA_CODE , &run_lua_code_check, &run_lua_code_process}, - {"DISPLAY_BONUS_OBJECTIVE", "NAl ", Cmd_DISPLAY_BONUS_OBJECTIVE, &display_bonus_objective_check, &display_bonus_objective_process}, + {"DISPLAY_BONUS_OBJECTIVE", "PNAl ", Cmd_DISPLAY_BONUS_OBJECTIVE, &display_bonus_objective_check, &display_bonus_objective_process}, {"DISPLAY_BONUS_OBJECTIVE_WITH_POS", "NANN ", Cmd_DISPLAY_BONUS_OBJECTIVE_WITH_POS, &display_bonus_objective_check, &display_bonus_objective_process }, {"DISPLAY_BONUS_INFORMATION", "NAl ", Cmd_DISPLAY_BONUS_INFORMATION, NULL, NULL}, {"DISPLAY_BONUS_INFORMATION_WITH_POS","NANN ", Cmd_DISPLAY_BONUS_INFORMATION_WITH_POS, NULL, NULL}, diff --git a/src/lvl_script_lib.h b/src/lvl_script_lib.h index d0505a256a..3ebe3a0e6f 100644 --- a/src/lvl_script_lib.h +++ b/src/lvl_script_lib.h @@ -89,7 +89,6 @@ enum TbScriptCommands { Cmd_DISPLAY_INFORMATION_WITH_POS = 74, Cmd_PRINT = 76, // from beta Cmd_SWAP_CREATURE = 77, - // New commands propositions - KeeperFX only Cmd_CHANGE_SLAB_TYPE = 78, Cmd_CHANGE_SLAB_OWNER = 79, Cmd_IF_SLAB_TYPE = 80, diff --git a/src/main.cpp b/src/main.cpp index 2e22aa55b9..a696fc295e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2040,10 +2040,25 @@ void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubt event_create_event(pos_x, pos_y, EvKind_QuickBonusInformation, player->id_number, -msg_id, icon); } -void set_general_objective(long msg_id, TbMapLocation target, long x, long y) +void process_bonus_objective(PlayerNumber plyr_idx, int icon, const char* msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) +{ + struct PlayerInfo* player = get_player(plyr_idx); + MapSubtlCoord pos_x = x; + MapSubtlCoord pos_y = y; + find_map_location_coords(target, &x, &y, plyr_idx, __func__); + + set_level_objective(msg_text); + display_bonus_objectives(player->id_number,icon, pos_x, pos_y); +} + +void set_general_objective(TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) { process_objective(get_string(msg_id), target, x, y); } +void set_bonus_objective(PlayerNumber plyr_idx, int icon, TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) +{ + process_bonus_objective(plyr_idx ,icon, get_string(msg_id), target, x, y); +} void process_objective(const char *msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) { diff --git a/src/map_locations.c b/src/map_locations.c index 3be73706a9..1340a64128 100644 --- a/src/map_locations.c +++ b/src/map_locations.c @@ -640,7 +640,7 @@ TbBool get_map_heading_id_f(const char *headname, long target, TbMapLocation *lo } // TODO: replace this function by find_location_pos -void find_map_location_coords(TbMapLocation location, MapSubtlCoord *x, MapSubtlCoord *y, int plyr_idx, const char *func_name) +void find_map_location_coords(TbMapLocation location, MapSubtlCoord *x, MapSubtlCoord *y, PlayerNumber plyr_idx, const char *func_name) { struct ActionPoint *apt; struct Thing *thing; diff --git a/src/map_locations.h b/src/map_locations.h index 28b67662ba..25b27dfad7 100644 --- a/src/map_locations.h +++ b/src/map_locations.h @@ -70,7 +70,7 @@ TbBool get_coords_at_dungeon_heart(struct Coord3d *pos, PlayerNumber plyr_idx); TbMapLocation get_coord_encoded_location(MapSubtlCoord stl_x,MapSubtlCoord stl_y); -void find_map_location_coords(TbMapLocation location, MapSubtlCoord *x, MapSubtlCoord *y, int plyr_idx, const char *func_name); +void find_map_location_coords(TbMapLocation location, MapSubtlCoord *x, MapSubtlCoord *y, PlayerNumber plyr_idx, const char *func_name); void find_location_pos(TbMapLocation location, PlayerNumber plyr_idx, struct Coord3d *pos, const char *func_name); From accce7e702514176eb62faef7c488163c4909860 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Tue, 31 Mar 2026 23:48:43 +0200 Subject: [PATCH 25/27] take correct icon ID --- src/lvl_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index a39e0fb3ab..6e2e30b060 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -872,7 +872,7 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) } value->shorts[0] = msg_num; - value->shorts[1] = icon_idx; + value->shorts[1] = rpanel_msg_colour[0][icon_idx]; value->shorts[2] = location; value->shorts[3] = x; value->shorts[4] = y; From ea725099f0d5facdee1eeb539dddc7a6d9298bc3 Mon Sep 17 00:00:00 2001 From: Loobinex Date: Wed, 1 Apr 2026 00:12:08 +0200 Subject: [PATCH 26/27] Fixed it to actually work --- src/keeperfx.hpp | 2 +- src/lvl_script_commands.c | 14 +++++++------- src/main.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/keeperfx.hpp b/src/keeperfx.hpp index 2061a210a7..7f024f04f4 100644 --- a/src/keeperfx.hpp +++ b/src/keeperfx.hpp @@ -281,7 +281,7 @@ void set_quick_bonus_information_at_location(long msg_id, TbMapLocation target, void set_quick_bonus_information_at_coords(long msg_id, MapSubtlCoord x, MapSubtlCoord y, long colour_value); void process_objective(const char *msg_text, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void set_general_objective(TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); -void set_bonus_objective(PlayerNumber plyr_idx, int icon, TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); +void set_bonus_objective(PlayerNumber plyr_idx, TextStringId msg_id, int icon, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y); void turn_off_power_sight_of_evil(PlayerNumber plridx); void turn_off_power_obey(PlayerNumber plyr_idx); diff --git a/src/lvl_script_commands.c b/src/lvl_script_commands.c index 6e2e30b060..e0b3475d89 100644 --- a/src/lvl_script_commands.c +++ b/src/lvl_script_commands.c @@ -872,7 +872,7 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) } value->shorts[0] = msg_num; - value->shorts[1] = rpanel_msg_colour[0][icon_idx]; + value->shorts[1] = rpanel_msg_colour[MSG_ICON_QUESTN][icon_idx]; value->shorts[2] = location; value->shorts[3] = x; value->shorts[4] = y; @@ -882,12 +882,12 @@ static void display_bonus_objective_check(const struct ScriptLine* scline) static void display_bonus_objective_process(struct ScriptContext* context) { - set_bonus_objective(context->player_idx, - context->value->shorts[0], - context->value->shorts[1], - context->value->shorts[2], - context->value->shorts[3], - context->value->shorts[4]); + set_bonus_objective(context->player_idx, + context->value->shorts[0], + context->value->shorts[1], + context->value->shorts[2], + context->value->shorts[3], + context->value->shorts[4]); } static void tag_map_rect_check(const struct ScriptLine* scline) diff --git a/src/main.cpp b/src/main.cpp index a696fc295e..ed0727fe69 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2055,7 +2055,7 @@ void set_general_objective(TextStringId msg_id, TbMapLocation target, MapSubtlCo { process_objective(get_string(msg_id), target, x, y); } -void set_bonus_objective(PlayerNumber plyr_idx, int icon, TextStringId msg_id, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) +void set_bonus_objective(PlayerNumber plyr_idx, TextStringId msg_id, int icon, TbMapLocation target, MapSubtlCoord x, MapSubtlCoord y) { process_bonus_objective(plyr_idx ,icon, get_string(msg_id), target, x, y); } From 0a8f3395d0f54424a94d7ff520b597e2c9fa25ab Mon Sep 17 00:00:00 2001 From: Loobinex Date: Wed, 1 Apr 2026 00:38:22 +0200 Subject: [PATCH 27/27] removed some unrelated longs --- src/map_events.c | 4 ++-- src/map_events.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/map_events.c b/src/map_events.c index 5203166209..fa2209be28 100644 --- a/src/map_events.c +++ b/src/map_events.c @@ -639,8 +639,8 @@ void maintain_my_event_list(struct Dungeon *dungeon) void kill_oldest_my_event(struct Dungeon *dungeon) { - long old_idx = -1; - long old_birth = 2147483647; + int32_t old_idx = -1; + int32_t old_birth = INT_MAX; for (long i = EVENT_BUTTONS_COUNT; i > 0; i--) { long k = dungeon->event_button_index[i]; diff --git a/src/map_events.h b/src/map_events.h index 0bd2e31e20..4e863e021e 100644 --- a/src/map_events.h +++ b/src/map_events.h @@ -102,8 +102,8 @@ struct Event { unsigned char kind; int32_t target; /** Button lifespan, decreased over time. When reaches 0, the button disappears. */ - unsigned long lifespan_turns; - unsigned long icon; // from GUIPanelSprite + uint32_t lifespan_turns; + int16_t icon; // from GUIPanelSprite }; struct Bookmark {