Skip to content

Commit 1b755e1

Browse files
committed
Revert "Menu text revision (diasurgical#3902)"
This reverts commit 673f119.
1 parent 086ccbb commit 1b755e1

9 files changed

Lines changed: 27 additions & 100 deletions

File tree

CMake/Assets.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ set(devilutionx_assets
9999
fonts/30-03.clx
100100
fonts/30-04.clx
101101
fonts/30-20.clx
102-
fonts/30-e0.clx
103102
fonts/42-00.clx
104103
fonts/42-01.clx
105104
fonts/42-02.clx

Source/control.cpp

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include "panels/spell_book.hpp"
4545
#include "panels/spell_icons.hpp"
4646
#include "panels/spell_list.hpp"
47-
#include "pfile.h"
4847
#include "playerdat.hpp"
4948
#include "qol/stash.h"
5049
#include "qol/xpbar.h"
@@ -1181,19 +1180,6 @@ void CheckMainPanelButtonUp()
11811180
DoAutoMap();
11821181
break;
11831182
case PanelButtonMainmenu:
1184-
if (MyPlayerIsDead) {
1185-
if (!gbIsMultiplayer) {
1186-
if (gbValidSaveFile)
1187-
gamemenu_load_game(false);
1188-
else
1189-
gamemenu_exit_game(false);
1190-
} else {
1191-
NetSendCmd(true, CMD_RETOWN);
1192-
}
1193-
break;
1194-
} else if (MyPlayer->_pHitPoints == 0) {
1195-
break;
1196-
}
11971183
qtextflag = false;
11981184
gamemenu_handle_previous();
11991185
gamemenuOff = false;
@@ -1428,52 +1414,6 @@ void RedBack(const Surface &out)
14281414
}
14291415
}
14301416

1431-
void DrawDeathText(const Surface &out)
1432-
{
1433-
const TextRenderOptions largeTextOptions {
1434-
.flags = UiFlags::FontSize42 | UiFlags::ColorGold | UiFlags::AlignCenter | UiFlags::VerticalCenter,
1435-
.spacing = 2
1436-
};
1437-
const TextRenderOptions smallTextOptions {
1438-
.flags = UiFlags::FontSize30 | UiFlags::ColorGold | UiFlags::AlignCenter | UiFlags::VerticalCenter,
1439-
.spacing = 2
1440-
};
1441-
std::string text;
1442-
int verticalPadding = 42;
1443-
Point linePosition { 0, gnScreenHeight / 2 - (verticalPadding * 2) };
1444-
1445-
text = _("You have died");
1446-
DrawString(out, text, linePosition, largeTextOptions);
1447-
linePosition.y += verticalPadding;
1448-
1449-
std::string buttonText;
1450-
1451-
switch (ControlMode) {
1452-
case ControlTypes::KeyboardAndMouse:
1453-
buttonText = _("ESC");
1454-
break;
1455-
case ControlTypes::Gamepad:
1456-
buttonText = ToString(GamepadType, ControllerButton_BUTTON_START);
1457-
break;
1458-
case ControlTypes::VirtualGamepad:
1459-
buttonText = _("Menu Button");
1460-
break;
1461-
default:
1462-
break;
1463-
}
1464-
1465-
if (!gbIsMultiplayer) {
1466-
if (gbValidSaveFile)
1467-
text = fmt::format(fmt::runtime(_("Press {} to load last save.")), buttonText);
1468-
else
1469-
text = fmt::format(fmt::runtime(_("Press {} to return to Main Menu.")), buttonText);
1470-
1471-
} else {
1472-
text = fmt::format(fmt::runtime(_("Press {} to restart in town.")), buttonText);
1473-
}
1474-
DrawString(out, text, linePosition, smallTextOptions);
1475-
}
1476-
14771417
void DrawGoldSplit(const Surface &out)
14781418
{
14791419
const int dialogX = 30;

Source/control.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ void CheckChrBtns();
175175
void ReleaseChrBtns(bool addAllStatPoints);
176176
void DrawDurIcon(const Surface &out);
177177
void RedBack(const Surface &out);
178-
void DrawDeathText(const Surface &out);
179178
void DrawSpellBook(const Surface &out);
180179
void DrawGoldSplit(const Surface &out);
181180
void control_drop_gold(SDL_Keycode vkey);

Source/diablo.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -490,17 +490,6 @@ void PressKey(SDL_Keycode vkey, uint16_t modState)
490490
}
491491

492492
if (MyPlayerIsDead) {
493-
if (vkey == SDLK_ESCAPE) {
494-
if (!gbIsMultiplayer) {
495-
if (gbValidSaveFile)
496-
gamemenu_load_game(false);
497-
else
498-
gamemenu_exit_game(false);
499-
} else {
500-
NetSendCmd(true, CMD_RETOWN);
501-
}
502-
return;
503-
}
504493
if (sgnTimeoutCurs != CURSOR_NONE) {
505494
return;
506495
}
@@ -517,8 +506,7 @@ void PressKey(SDL_Keycode vkey, uint16_t modState)
517506
return;
518507
}
519508
}
520-
// Disallow player from accessing escape menu during the frames before the death message appears
521-
if (vkey == SDLK_ESCAPE && MyPlayer->_pHitPoints > 0) {
509+
if (vkey == SDLK_ESCAPE) {
522510
if (!PressEscKey()) {
523511
LastMouseButtonAction = MouseActionType::None;
524512
gamemenu_on();

Source/engine/render/scrollrt.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,15 +1286,14 @@ void DrawView(const Surface &out, Point startPosition)
12861286
if (ChatLogFlag) {
12871287
DrawChatLog(out);
12881288
}
1289+
if (IsDiabloMsgAvailable()) {
1290+
DrawDiabloMsg(out.subregionY(0, out.h() - GetMainPanel().size.height));
1291+
}
12891292
if (MyPlayerIsDead) {
12901293
RedBack(out);
1291-
DrawDeathText(out);
12921294
} else if (PauseMode != 0) {
12931295
gmenu_draw_pause(out);
12941296
}
1295-
if (IsDiabloMsgAvailable()) {
1296-
DrawDiabloMsg(out.subregionY(0, out.h() - GetMainPanel().size.height));
1297-
}
12981297

12991298
DrawControllerModifierHints(out);
13001299
DrawPlrMsg(out);

Source/gamemenu.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@ void GamemenuSpeed(bool bActivate);
4343
/** Contains the game menu items of the single player menu. */
4444
TMenuItem sgSingleMenu[] = {
4545
// clang-format off
46-
// dwFlags, pszStr, fnMenu
47-
{ GMENU_ENABLED, N_("Options"), &GamemenuOptions },
48-
{ GMENU_ENABLED, N_("Save Game"), &gamemenu_save_game },
49-
{ GMENU_ENABLED, N_("Load Game"), &gamemenu_load_game },
50-
{ GMENU_ENABLED, N_("Exit to Main Menu"), &GamemenuNewGame },
51-
{ GMENU_ENABLED, N_("Quit Game"), &gamemenu_quit_game },
52-
{ GMENU_ENABLED, nullptr, nullptr },
46+
// dwFlags, pszStr, fnMenu
47+
{ GMENU_ENABLED, N_("Save Game"), &gamemenu_save_game },
48+
{ GMENU_ENABLED, N_("Options"), &GamemenuOptions },
49+
{ GMENU_ENABLED, N_("New Game"), &GamemenuNewGame },
50+
{ GMENU_ENABLED, N_("Load Game"), &gamemenu_load_game },
51+
{ GMENU_ENABLED, N_("Quit Game"), &gamemenu_quit_game },
52+
{ GMENU_ENABLED, nullptr, nullptr }
5353
// clang-format on
5454
};
5555
/** Contains the game menu items of the multi player menu. */
5656
TMenuItem sgMultiMenu[] = {
5757
// clang-format off
58-
// dwFlags, pszStr, fnMenu
59-
{ GMENU_ENABLED, N_("Options"), &GamemenuOptions },
60-
{ GMENU_ENABLED, N_("Exit to Main Menu"), &GamemenuNewGame },
61-
{ GMENU_ENABLED, N_("Quit Game"), &gamemenu_quit_game },
62-
{ GMENU_ENABLED, nullptr, nullptr },
58+
// dwFlags, pszStr, fnMenu
59+
{ GMENU_ENABLED, N_("Options"), &GamemenuOptions },
60+
{ GMENU_ENABLED, N_("New Game"), &GamemenuNewGame },
61+
{ GMENU_ENABLED, N_("Restart In Town"), &GamemenuRestartTown },
62+
{ GMENU_ENABLED, N_("Quit Game"), &gamemenu_quit_game },
63+
{ GMENU_ENABLED, nullptr, nullptr },
6364
// clang-format on
6465
};
6566
TMenuItem sgOptionsMenu[] = {
@@ -86,13 +87,18 @@ const char *const SoundToggleNames[] = {
8687

8788
void GamemenuUpdateSingle()
8889
{
89-
sgSingleMenu[2].setEnabled(gbValidSaveFile);
90+
sgSingleMenu[3].setEnabled(gbValidSaveFile);
9091

9192
bool enable = MyPlayer->_pmode != PM_DEATH && !MyPlayerIsDead;
9293

9394
sgSingleMenu[0].setEnabled(enable);
9495
}
9596

97+
void GamemenuUpdateMulti()
98+
{
99+
sgMultiMenu[2].setEnabled(MyPlayerIsDead);
100+
}
101+
96102
void GamemenuPrevious(bool /*bActivate*/)
97103
{
98104
gamemenu_on();
@@ -274,11 +280,6 @@ void GamemenuSpeed(bool bActivate)
274280

275281
} // namespace
276282

277-
void gamemenu_exit_game(bool bActivate)
278-
{
279-
GamemenuNewGame(bActivate);
280-
}
281-
282283
void gamemenu_quit_game(bool bActivate)
283284
{
284285
GamemenuNewGame(bActivate);
@@ -361,7 +362,7 @@ void gamemenu_on()
361362
if (!gbIsMultiplayer) {
362363
gmenu_set_items(sgSingleMenu, GamemenuUpdateSingle);
363364
} else {
364-
gmenu_set_items(sgMultiMenu, nullptr);
365+
gmenu_set_items(sgMultiMenu, GamemenuUpdateMulti);
365366
}
366367
PressEscKey();
367368
}

Source/gamemenu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ namespace devilution {
1010
void gamemenu_on();
1111
void gamemenu_off();
1212
void gamemenu_handle_previous();
13-
void gamemenu_exit_game(bool bActivate);
1413
void gamemenu_quit_game(bool bActivate);
1514
void gamemenu_load_game(bool bActivate);
1615
void gamemenu_save_game(bool bActivate);

Source/player.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,9 @@ bool DoDeath(Player &player)
10341034
dFlags[player.position.tile.x][player.position.tile.y] |= DungeonFlag::DeadPlayer;
10351035
} else if (&player == MyPlayer && player.AnimInfo.tickCounterOfCurrentFrame == 30) {
10361036
MyPlayerIsDead = true;
1037+
if (!gbIsMultiplayer) {
1038+
gamemenu_on();
1039+
}
10371040
}
10381041
}
10391042

@@ -2613,7 +2616,6 @@ StartPlayerKill(Player &player, DeathReason deathReason)
26132616

26142617
if (&player == MyPlayer) {
26152618
NetSendCmdParam1(true, CMD_PLRDEAD, static_cast<uint16_t>(deathReason));
2616-
gamemenu_off();
26172619
}
26182620

26192621
const bool dropGold = !gbIsMultiplayer || !(player.isOnLevel(16) || player.isOnArenaLevel());

assets/fonts/30-e0.clx

-29.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)