From b1d0f252f3828a5d3035e90997d1fa81a67c639b Mon Sep 17 00:00:00 2001 From: Ondrej Novak Date: Tue, 22 Apr 2025 19:53:51 +0200 Subject: [PATCH] fix crash while clickmap is used in save dialog --- game/gamesave.c | 1 + game/interfac.c | 25 +++++++++++++++ lang/en/end_titles.txt | 44 +++++++++++++-------------- lang/en/epilog.txt | 69 +++++++++++++++++++++--------------------- lang/en/ui.csv | 5 +-- 5 files changed, 86 insertions(+), 58 deletions(-) diff --git a/game/gamesave.c b/game/gamesave.c index f3c75bd..6a7f969 100644 --- a/game/gamesave.c +++ b/game/gamesave.c @@ -1744,6 +1744,7 @@ void unwire_save_load(void) send_message(E_DONE,E_KEYBOARD,saveload_keyboard); send_message(E_DONE,E_KEYBOARD,saveload_keyboard_menu); free_savegame_list(¤t_game_slot_list); + change_click_map(0,0); } diff --git a/game/interfac.c b/game/interfac.c index 28b1975..c241815 100644 --- a/game/interfac.c +++ b/game/interfac.c @@ -1602,6 +1602,27 @@ THAGGLERESULT smlouvat_dlg(int cena,int puvod,int pocet,int posledni, int money, return res; } + + static void save_dialog_keyboards(EVENT_MSG *msg,OBJREC *o) + { + o; + if (msg->msg==E_KEYBOARD) + { + int c = va_arg(msg->data, int); + switch(c & 0xFF) + { + case 13:goto_control(30);terminate_gui();break; + case 27:goto_control(20);terminate_gui();break; + } + } + if (msg->msg == E_MOUSE) { + const MS_EVENT *ev = va_arg(msg->data, MS_EVENT *); + if (ev->event_type & MS_EVENT_MOUSE_RRELEASE) { + goto_control(20);terminate_gui(); + } + } + } + char ask_save_dialog(char *name_buffer, size_t name_size, char allow_remove) { const char *str_label = texty[98]; @@ -1618,7 +1639,11 @@ char ask_save_dialog(char *name_buffer, size_t name_size, char allow_remove) { } redraw_window(); goto_control(10); + send_message(E_ADD,E_KEYBOARD,save_dialog_keyboards); + send_message(E_ADD,E_MOUSE,save_dialog_keyboards); escape(); + send_message(E_DONE,E_KEYBOARD,save_dialog_keyboards); + send_message(E_DONE,E_MOUSE,save_dialog_keyboards); get_value(0,10,name_buffer); char ret = o_aktual->id==40?2:o_aktual->id==30?1:0; close_current(); diff --git a/lang/en/end_titles.txt b/lang/en/end_titles.txt index e3a5924..2e63d63 100644 --- a/lang/en/end_titles.txt +++ b/lang/en/end_titles.txt @@ -7,12 +7,12 @@ Jan Virt *head Game design and Story *name -Jinřich Rohlík +JinŠich RohlĄk *head Program *name -Ondřej Novák +OndŠej Nov k *head Environment concept art @@ -27,71 +27,71 @@ Daniel Falta *head 2D Graphics *name -Karel Matějka +Karel Matˆjka Peter Koubek *head 3D Graphics *name -Karel Matějka +Karel Matˆjka *head Animations *name Daniel Falta -Karel Matějka +Karel Matˆjka *head Illustrations *name Daniel Falta -Karel Matějka +Karel Matˆjka *head Fonts *name -Ondřej Novák -Karel Matějka +OndŠej Nov k +Karel Matˆjka *head Music *name Michal Stupka -Jakub Preclík -Petr Třebický -Martin Matějka (outro) +Jakub PreclĄk +Petr TŠebick˜ +Martin Matˆjka (outro) *head Sound effects *name -Jindřich Rohlík +JindŠich RohlĄk *head Level design *name -Jindřich Rohlík +JindŠich RohlĄk *head Production *name -Jindřich Rohlík +JindŠich RohlĄk *head Betatesting *name -Michal Maršál -TomᚠTřebický -Jakub Motyčka -Jan Císař -Michal Máčel -Zbyněk Pochman +Michal Mar¨ l +Tom ¨ TŠebick˜ +Jakub Moty‡ka +Jan CĄsaŠ +Michal M ‡el +Zbynˆk Pochman *head Special thanks *name -Jan Virt and Václav Provazník +Jan Virt and V clav ProvaznĄk for their help during level design -Marek Vondrák for graphics library in DOS version +Marek Vondr k for graphics library in DOS version Dalibor Strak for lending us Gravis Ultrasound FTL for first real square-based dungeon *konec \ No newline at end of file diff --git a/lang/en/epilog.txt b/lang/en/epilog.txt index abaefcb..a20c15f 100644 --- a/lang/en/epilog.txt +++ b/lang/en/epilog.txt @@ -2,39 +2,40 @@ *line 10 *TEXT *SPEED 8 -You ascended to the highest floor of Skeldal, the magical -tower built by five fallen mages, former -disciples of the mage Nimeth, to protect themselves while -immersed in the preparation of their ultimate spell, which -is to open the gates to forbidden dimensions. -Your party, with the Sword of Retribution, forged for them by a demon -dwelling in the midst of the Labyrinth of Singing Waters, stormed into -the guarded chamber, on whose purple stone floor a -pentagram was carved, and caused a massacre among the mages, exhausted -by the preparation of the demanding spell. You disrupted -the circle, which had been maintained for many months by the slain mages, -and which was essential for the spell's completion. -It was, however, at the last moment. The spell was practically -finished at the time of your intrusion, and the mana-soaked ground -began to crack under the pressure of the monsters trying -to break through from the underground spaces. Your strongest warrior -raised the Sword of Retribution for the last time and with a mighty throw plunged it -hilt-deep into the chest of the first demon that burst through from another -dimension. -Thus you completed your mission and restored hope for the future to this world. -Life began to return to Rovenland, -and this small island in the middle of the Dragon Sea once again became -an important trading center. The three heroes who emerged -from the Krow-Kane ritual returned to where they were summoned from. -Roland became a respected merchant in Caredbar, Gralt journeyed -after another obscure legend to the fire land of Hadim, and Erik returned -to his father, whom he helped in the library for several years -before departing with a merchant ship to the -great continent. -The great adventure, destined from the beginning of ages, -has ended. The endless battle of good and evil, the forces -of light and darkness, which creatures of all races and nations will +You ascended to the highest floor of Skeldal, the magical tower +built by five fallen mages, former disciples of the mage Nimeth, +to protect themselves while immersed in the preparation +of their ultimate spell, which is to open the gates to forbidden +dimensions. Your party, with the Sword of Retribution, forged +for them by a demon dwelling in the midst of the Labyrinth +of Singing Waters, stormed into the guarded chamber, on whose +purple stone floor a pentagram was carved, and caused +a massacre among the mages, exhausted by the preparation of +the demanding spell. You disrupted the circle, which had been +maintained for many months by the slain mages, and which was +essential for the spell's completion. It was, however, at +the last moment. The spell was practically finished at the time +of your intrusion, and the mana-soaked ground began to crack +under the pressure of the monsters trying to break through +from the underground spaces. Your strongest warrior raised +the Sword of Retribution for the last time and with a mighty +throw plunged it hilt-deep into the chest of the first demon +that burst through from another dimension. Thus you completed +your mission and restored hope for the future to this world. + +Life began to return to Rovenland, and this small island in +the middle of the Dragon Sea once again became an important +trading center. The three heroes who emerged from +the Krow-Kane ritual returned to where they were summoned +from. Roland became a respected merchant in Caredbar, Gralt +journeyed after another obscure legend to the fire land of +Hadim, and Erik returned to his father, whom he helped in +the library for several years before departing with a merchant +ship to the great continent. + +The great adventure, destined from the beginning of ages, has +ended. The endless battle of good and evil, the forces of light +and darkness, which creatures of all races and nations will have to wage until the very end of eternity. -And by the way, the password for the maps is: Věk novĂ˝ch BohĹŻ -*KONECSUB \ No newline at end of file +*KONECSUB diff --git a/lang/en/ui.csv b/lang/en/ui.csv index 2d8e83c..7703124 100644 --- a/lang/en/ui.csv +++ b/lang/en/ui.csv @@ -1,5 +1,6 @@ id,string -0,"A connected controller has been found|To activate the controller, press any button on the controller" +0,"A connected controller has been found +To activate the controller, press any button on the controller" 1,FORWARD TRACK06.MUS TRACK07.MUS 2,STRENGTH: %d-%d 3,MAGIC: %d-%d @@ -44,7 +45,7 @@ id,string 48,Start 49,Throw 50,Combat in Progress -51,Overall Music Sounds Treble Bass XBass +51,Overall Music Sounds Treble Bass 52,Stereo Settings (Ultrasound) 53,Swap Sides 54,Output Filter (SBPro)