From 695eced81a91e6a4166efa5f07020a2ef33f6cb6 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Fri, 1 Feb 2019 11:07:36 -0600 Subject: [PATCH 1/4] Added Inventory UNCLEARABLE flag. - Allows prevention of ClearInventory without stopping it from being dropped. --- wadsrc/static/zscript/actor_inventory.txt | 2 +- wadsrc/static/zscript/inventory/inventory.txt | 1 + wadsrc/static/zscript/shared/player.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/actor_inventory.txt b/wadsrc/static/zscript/actor_inventory.txt index 8fc3c6d5cb..837184dd13 100644 --- a/wadsrc/static/zscript/actor_inventory.txt +++ b/wadsrc/static/zscript/actor_inventory.txt @@ -336,7 +336,7 @@ extend class Actor while (last.inv != NULL) { let inv = last.inv; - if (!inv.bUndroppable) + if (!inv.bUndroppable && !inv.bUnclearable) { inv.DepleteOrDestroy(); if (!inv.bDestroyed) last = inv; // was only depleted so advance the pointer manually. diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index f89bb74938..9c977d36b1 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -64,6 +64,7 @@ class Inventory : Actor flagdef IsArmor: ItemFlags, 21; flagdef IsHealth: ItemFlags, 22; flagdef AlwaysPickup: ItemFlags, 23; + flagdef Unclearable: ItemFlags, 24; flagdef ForceRespawnInSurvival: none, 0; flagdef PickupFlash: none, 6; diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index cdcfccf135..3e3bd2e564 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -2042,7 +2042,7 @@ class PlayerPawn : Actor if (item.bINVBAR && item.Amount > item.InterHubAmount) { item.Amount = item.InterHubAmount; - if (level.REMOVEITEMS && !item.bUNDROPPABLE) + if (level.REMOVEITEMS && !item.bUNDROPPABLE && !item.bUNCLEARABLE) { todelete.Push(item); } From fa53ae21e615e78b66c941ae7daa0d1ad278ca6f Mon Sep 17 00:00:00 2001 From: Nemrtvi <26684396+Nemrtvi@users.noreply.github.com> Date: Sat, 2 Feb 2019 09:08:33 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Localized=20=E2=80=9CFIND=20HELP=E2=80=9D?= =?UTF-8?q?=20in=20Strife?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The very first quest log that appears in Strife, “FIND HELP”, is located in a source file. This moves it to the language files. --- src/g_level.cpp | 2 +- wadsrc/static/language.enu | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 99be28e05e..e1d8fc322b 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -471,7 +471,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel) for (i = 0; i < MAXPLAYERS; ++i) { if (playeringame[i]) - players[i].SetLogText ("Find help"); + players[i].SetLogText ("$TXT_FINDHELP"); } } diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index f620abfc1b..54cb51ef14 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1464,6 +1464,8 @@ TXT_DOES_NOT_WORK = "That doesn't seem to work"; // Strife Quest messages +TXT_FINDHELP = "FIND HELP"; + TXT_QUEST_14 = "You've Blown Up the Crystal"; TXT_QUEST_16 = "You've Blown Up the Gates"; TXT_QUEST_27 = "You've Blown Up the Computer"; From 64476cde7e22a6ed9f66783c70737f9a150dea82 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 2 Feb 2019 16:51:54 +0100 Subject: [PATCH 3/4] - fixed: Retriving a key's color did not work. --- src/g_inventory/a_keys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_inventory/a_keys.cpp b/src/g_inventory/a_keys.cpp index 8173405791..bd44828a53 100644 --- a/src/g_inventory/a_keys.cpp +++ b/src/g_inventory/a_keys.cpp @@ -555,7 +555,7 @@ int P_GetMapColorForKey (AActor * key) foundlock = pair->Key; } } - return 0; + return rgb; } From 235c4c0499442e64c39a1e1a8d7d79e76b27b936 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 2 Feb 2019 16:56:58 +0100 Subject: [PATCH 4/4] - allow localization of Strife's log text. --- src/g_statusbar/sbarinfo_commands.cpp | 2 +- src/g_statusbar/shared_sbar.cpp | 3 ++- src/p_user.cpp | 3 ++- wadsrc/static/zscript/statusbar/strife_sbar.txt | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/g_statusbar/sbarinfo_commands.cpp b/src/g_statusbar/sbarinfo_commands.cpp index cc0c8a5cf2..ac66ddf94a 100644 --- a/src/g_statusbar/sbarinfo_commands.cpp +++ b/src/g_statusbar/sbarinfo_commands.cpp @@ -923,7 +923,7 @@ class CommandDrawString : public SBarInfoCommand break; } case LOGTEXT: - str = statusBar->CPlayer->LogText; + str = GStrings(statusBar->CPlayer->LogText); break; default: break; diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index f9ccf79786..76c8ec20ad 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -55,6 +55,7 @@ #include "vm.h" #include "p_acs.h" #include "sbarinfo.h" +#include "gstrings.h" #include "events.h" #include "../version.h" @@ -1064,7 +1065,7 @@ void DBaseStatusBar::DrawLog () hudheight = SCREENHEIGHT / scale; int linelen = hudwidth<640? Scale(hudwidth,9,10)-40 : 560; - auto lines = V_BreakLines (SmallFont, linelen, CPlayer->LogText); + auto lines = V_BreakLines (SmallFont, linelen, GStrings(CPlayer->LogText)); int height = 20; for (unsigned i = 0; i < lines.Size(); i++) height += SmallFont->GetHeight () + 1; diff --git a/src/p_user.cpp b/src/p_user.cpp index 55f643783a..d1e20266d1 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -89,6 +89,7 @@ #include "actorinlines.h" #include "p_acs.h" #include "events.h" +#include "gstrings.h" static FRandom pr_skullpop ("SkullPop"); @@ -441,7 +442,7 @@ void player_t::SetLogText (const char *text) { // Print log text to console AddToConsole(-1, TEXTCOLOR_GOLD); - AddToConsole(-1, LogText); + AddToConsole(-1, GStrings(LogText)); AddToConsole(-1, "\n"); } } diff --git a/wadsrc/static/zscript/statusbar/strife_sbar.txt b/wadsrc/static/zscript/statusbar/strife_sbar.txt index 866c4a32a3..e10e9f2ab5 100644 --- a/wadsrc/static/zscript/statusbar/strife_sbar.txt +++ b/wadsrc/static/zscript/statusbar/strife_sbar.txt @@ -432,7 +432,8 @@ class StrifeStatusBar : BaseStatusBar if (CPlayer.LogText.Length() > 0) { - BrokenLines lines = SmallFont2.BreakLines(CPlayer.LogText, 272); + let text = Stringtable.Localize(CPlayer.LogText); + BrokenLines lines = SmallFont2.BreakLines(text, 272); for (i = 0; i < lines.Count(); ++i) { screen.DrawText(SmallFont2, Font.CR_UNTRANSLATED, left + 24 * xscale, top + (18 + i * 12)*yscale,