From 2716c32826de2afa92878796a24c6c8266cbbcbf Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Sun, 10 Jul 2022 09:20:24 -0600 Subject: [PATCH] + add option to change first person pronouns in quest log + add missing font characters ^ currently only & * move quest log display to uiTick --- cvarinfo.txt | 1 + graphics/FONTA06.png | Bin 0 -> 907 bytes language.txt | 4 ++++ menudef.txt | 7 +++++++ vhtzs/events.zsc | 17 +++++++++++------ vhtzs/quest.zsc | 26 ++++++++++++++++---------- 6 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 graphics/FONTA06.png diff --git a/cvarinfo.txt b/cvarinfo.txt index b36ac63..dcb9f56 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -5,4 +5,5 @@ server int vht_mfrost_damagefunc = 1; server bool vht_mbloodscourge_foilinvul = false; server bool vht_player_touchshatter = true; server bool vht_player_questlog = true; +user int vht_player_questlogplural = 0; server int vht_monster_centaur = 2; diff --git a/graphics/FONTA06.png b/graphics/FONTA06.png new file mode 100644 index 0000000000000000000000000000000000000000..7ad59f3d251752302a71ce64635eb0cf3495ac41 GIT binary patch literal 907 zcmV;619bd}P)Sgrlzp4u(`Rp!otGK%gfZ%)ZN|P=H})dARQ(sB{DKH zJ3Ko@NJLIhO;}x4VPs!zaABP%y6FF!9cM>9K1H$PK5Lt8^jUq?@8OIL4CTXR!idskeOD1kpFMD4% ziEBQVc1xpyRI7|bV{^-QNV{=%#U5wmuJ|YbKIwX->-_}x0NLn z1TPo_IUEK=Ap}e$15_vgVJ`x5HUND;28~Mzn^O^@Ulplm8nkgBynGbQh#1_I9PFSM z^sF!ZyE**AM*GQA`_N(g-FpHADFOvC1_(I<1wjG@PXGj100dwF1ZV^Xc>)EA6c?B# zDW^C)wMtFITVB&`aN>W0@R5}N9|Qy^001ul05<>tLjV9z003J60A~OIa{vH;004^s z0Gj{+rvL!C007DW0Nelo?EnD(0093kF8^Cw|A~qJtE&_c1PvGo5g`l}DGnGi5ga)b zAVC--NgO9oA1qcSE?*`yXe&H=GenCzO`Sqju1Q|NQJpgcszCy|Rs_{|2I`Xq|FQ=E z!y5nCEd+%G2(JhN*8&6T11kI~dH;C>1Go<<+#FEiDR=2Mp6^4&_E7Bn^bQ06KLGz< z0RMjg|DOQ=!y5nJ04ohZJq}q~4|;eIoRtv0vJu|JO6b>t^XjSnJrEFDBq4SdFbS%1HGXak{p1Gega_C){y002ovPDHLkV1kwqKso>b literal 0 HcmV?d00001 diff --git a/language.txt b/language.txt index ff9169d..45fe8ca 100644 --- a/language.txt +++ b/language.txt @@ -10,6 +10,7 @@ VHT_MFROST_DAMAGEFUNC = "Frost Shards Damage Function"; VHT_MBLOODSCOURGE_FOILINVUL = "Bloodscourge Foils Invulnerability"; VHT_PLAYER_TOUCHSHATTER = "Shatter Frozen Enemies On Touch"; VHT_PLAYER_QUESTLOG = "Enable Quest Log"; +VHT_PLAYER_QUESTLOGPLURAL = "Quest Log First-Person Pronouns (English)"; VHT_MONSTER_CENTAUR = "Centaur Behaviour"; VHT_OPT_CONSTANT = "Constant"; @@ -17,6 +18,9 @@ VHT_OPT_MODIFIED = "Modified"; VHT_OPT_VANILLA = "Vanilla"; VHT_OPT_NOREFLECT = "No Projectile Reflection"; VHT_OPT_ANGLED = "No Reflection, Back is Vulnerable"; +VHT_OPT_SINGULAR = "I/me/my"; +VHT_OPT_PLURAL = "we/our/us"; +VHT_OPT_PLURAL2 = "we&/our&/us&"; VHT_QST_1_0 = "@ must find the emerald key\n" diff --git a/menudef.txt b/menudef.txt index 968cbcf..23ba6d6 100644 --- a/menudef.txt +++ b/menudef.txt @@ -1,3 +1,9 @@ +OptionValue "VhtPlural" { + 0, "$VHT_OPT_SINGULAR" + 1, "$VHT_OPT_PLURAL" + 2, "$VHT_OPT_PLURAL2" +} + OptionValue "VhtDamageFunc" { 0, "$VHT_OPT_VANILLA" 1, "$VHT_OPT_MODIFIED" @@ -30,6 +36,7 @@ OptionMenu "VhtMenu" { StaticText "Players" Option "$VHT_PLAYER_TOUCHSHATTER", "vht_player_touchshatter", "OnOff" Option "$VHT_PLAYER_QUESTLOG", "vht_player_questlog", "OnOff" + Option "$VHT_PLAYER_QUESTLOGPLURAL", "vht_player_questlogplural", "VhtPlural" StaticText "Monsters" Option "$VHT_MONSTER_CENTAUR", "vht_monster_centaur", "VhtCentaurBehaviour" } diff --git a/vhtzs/events.zsc b/vhtzs/events.zsc index 399fb94..28bc4ad 100644 --- a/vhtzs/events.zsc +++ b/vhtzs/events.zsc @@ -1,6 +1,6 @@ class VhtEvents : StaticEventHandler { - bool m_useQuestLog; - string m_questLog; + ui bool m_useQuestLog; + ui string m_questLog; VhtFnPlayerInv m_fGetQuests; VhtQuestHolder vhtGetQuests() const { return m_fGetQuests.vhtRun() ? VhtQuestHolder(m_fGetQuests.m_result) : null; @@ -30,14 +30,19 @@ class VhtEvents : StaticEventHandler { } } } - override void worldTick() { + override void uiTick() { m_useQuestLog = vht_player_questlog; + if(m_useQuestLog) { + let qh = vhtGetQuests(); + if(qh) { + m_questLog = qh.vhtDescribe(); + } + } + } + override void worldTick() { let qh = vhtGetQuests(); if(qh) { qh.vhtTick(); - if(m_useQuestLog) { - m_questLog = qh.vhtDescribe(); - } } } override void renderUnderlay(RenderEvent e) { diff --git a/vhtzs/quest.zsc b/vhtzs/quest.zsc index 6308c87..0e7d840 100644 --- a/vhtzs/quest.zsc +++ b/vhtzs/quest.zsc @@ -1,6 +1,11 @@ class VhtQuest abstract play { int m_mapNum, m_step; VhtHubQuest m_hubQuest; + static const string m_pronouns[] = { + "I", "me", "my", + "we", "our", "us", + "we&", "our&", "us&" + }; virtual VhtQuest vhtInit(VhtHubQuest hubQuest) { m_mapNum = level.levelNum; m_hubQuest = hubQuest; @@ -9,11 +14,11 @@ class VhtQuest abstract play { virtual void vhtTick() {} virtual void vhtTravelled() {} virtual void vhtPreTravelled() {} - virtual string vhtDescribe() { + virtual ui string vhtDescribe(int pronouns) { let s = StringTable.localize("$VHT_QST_" .. m_mapNum .. "_" .. m_step); - s.replace("@=", multiplayer ? "us" : "me"); - s.replace("@'", multiplayer ? "our" : "my"); - s.replace("@", multiplayer ? "we" : "i"); + s.replace("@=", m_pronouns[2 + 3 * pronouns]); + s.replace("@'", m_pronouns[1 + 3 * pronouns]); + s.replace("@", m_pronouns[0 + 3 * pronouns]); return s; } LevelInfo vhtLevelInfo() const { @@ -90,8 +95,8 @@ class VhtQuest2 : VhtHubQuest { m_step = 1; } } - override string vhtDescribe() { - let s = super.vhtDescribe(); + override string vhtDescribe(int pronouns) { + let s = super.vhtDescribe(pronouns); if(m_step == 1) { s = string.format(s, m_guardianOfFire, m_guardianOfSteel); } @@ -128,8 +133,8 @@ class VhtQuest4 : VhtQuest { } } } - override string vhtDescribe() { - let s = super.vhtDescribe(); + override string vhtDescribe(int pronouns) { + let s = super.vhtDescribe(pronouns); if(!VhtQuest2(m_hubQuest).m_fFlameMask.m_result) { s = s .. StringTable.localize("$VHT_QST_4_FireMask"); } @@ -215,8 +220,9 @@ class VhtQuestHolder : Inventory { } } } - string vhtDescribe() { + ui string vhtDescribe() { string s = ""; + int pronouns = multiplayer ? 1 : clamp(CVar.getCVar('vht_player_questlogplural', players[consolePlayer]).getInt(), 0, 2); for(int i = 0, j = m_quests.size(); i < j; ++i) { if(m_quests[i]) { s.appendFormat( @@ -225,7 +231,7 @@ class VhtQuestHolder : Inventory { m_quests[i].vhtLevelInfo().levelName, false ), - m_quests[i].vhtDescribe() + m_quests[i].vhtDescribe(pronouns) ); } }