+ add option to change first person pronouns in quest log

+ add missing font characters
^ currently only &
* move quest log display to uiTick
This commit is contained in:
alison wright 2022-07-10 09:20:24 -06:00
parent a22ae10d3b
commit 2716c32826
6 changed files with 39 additions and 16 deletions

View File

@ -5,4 +5,5 @@ server int vht_mfrost_damagefunc = 1;
server bool vht_mbloodscourge_foilinvul = false; server bool vht_mbloodscourge_foilinvul = false;
server bool vht_player_touchshatter = true; server bool vht_player_touchshatter = true;
server bool vht_player_questlog = true; server bool vht_player_questlog = true;
user int vht_player_questlogplural = 0;
server int vht_monster_centaur = 2; server int vht_monster_centaur = 2;

BIN
graphics/FONTA06.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

View File

@ -10,6 +10,7 @@ VHT_MFROST_DAMAGEFUNC = "Frost Shards Damage Function";
VHT_MBLOODSCOURGE_FOILINVUL = "Bloodscourge Foils Invulnerability"; VHT_MBLOODSCOURGE_FOILINVUL = "Bloodscourge Foils Invulnerability";
VHT_PLAYER_TOUCHSHATTER = "Shatter Frozen Enemies On Touch"; VHT_PLAYER_TOUCHSHATTER = "Shatter Frozen Enemies On Touch";
VHT_PLAYER_QUESTLOG = "Enable Quest Log"; VHT_PLAYER_QUESTLOG = "Enable Quest Log";
VHT_PLAYER_QUESTLOGPLURAL = "Quest Log First-Person Pronouns (English)";
VHT_MONSTER_CENTAUR = "Centaur Behaviour"; VHT_MONSTER_CENTAUR = "Centaur Behaviour";
VHT_OPT_CONSTANT = "Constant"; VHT_OPT_CONSTANT = "Constant";
@ -17,6 +18,9 @@ VHT_OPT_MODIFIED = "Modified";
VHT_OPT_VANILLA = "Vanilla"; VHT_OPT_VANILLA = "Vanilla";
VHT_OPT_NOREFLECT = "No Projectile Reflection"; VHT_OPT_NOREFLECT = "No Projectile Reflection";
VHT_OPT_ANGLED = "No Reflection, Back is Vulnerable"; 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 = VHT_QST_1_0 =
"@ must find the emerald key\n" "@ must find the emerald key\n"

View File

@ -1,3 +1,9 @@
OptionValue "VhtPlural" {
0, "$VHT_OPT_SINGULAR"
1, "$VHT_OPT_PLURAL"
2, "$VHT_OPT_PLURAL2"
}
OptionValue "VhtDamageFunc" { OptionValue "VhtDamageFunc" {
0, "$VHT_OPT_VANILLA" 0, "$VHT_OPT_VANILLA"
1, "$VHT_OPT_MODIFIED" 1, "$VHT_OPT_MODIFIED"
@ -30,6 +36,7 @@ OptionMenu "VhtMenu" {
StaticText "Players" StaticText "Players"
Option "$VHT_PLAYER_TOUCHSHATTER", "vht_player_touchshatter", "OnOff" Option "$VHT_PLAYER_TOUCHSHATTER", "vht_player_touchshatter", "OnOff"
Option "$VHT_PLAYER_QUESTLOG", "vht_player_questlog", "OnOff" Option "$VHT_PLAYER_QUESTLOG", "vht_player_questlog", "OnOff"
Option "$VHT_PLAYER_QUESTLOGPLURAL", "vht_player_questlogplural", "VhtPlural"
StaticText "Monsters" StaticText "Monsters"
Option "$VHT_MONSTER_CENTAUR", "vht_monster_centaur", "VhtCentaurBehaviour" Option "$VHT_MONSTER_CENTAUR", "vht_monster_centaur", "VhtCentaurBehaviour"
} }

View File

@ -1,6 +1,6 @@
class VhtEvents : StaticEventHandler { class VhtEvents : StaticEventHandler {
bool m_useQuestLog; ui bool m_useQuestLog;
string m_questLog; ui string m_questLog;
VhtFnPlayerInv m_fGetQuests; VhtFnPlayerInv m_fGetQuests;
VhtQuestHolder vhtGetQuests() const { VhtQuestHolder vhtGetQuests() const {
return m_fGetQuests.vhtRun() ? VhtQuestHolder(m_fGetQuests.m_result) : null; 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; m_useQuestLog = vht_player_questlog;
if(m_useQuestLog) {
let qh = vhtGetQuests();
if(qh) {
m_questLog = qh.vhtDescribe();
}
}
}
override void worldTick() {
let qh = vhtGetQuests(); let qh = vhtGetQuests();
if(qh) { if(qh) {
qh.vhtTick(); qh.vhtTick();
if(m_useQuestLog) {
m_questLog = qh.vhtDescribe();
}
} }
} }
override void renderUnderlay(RenderEvent e) { override void renderUnderlay(RenderEvent e) {

View File

@ -1,6 +1,11 @@
class VhtQuest abstract play { class VhtQuest abstract play {
int m_mapNum, m_step; int m_mapNum, m_step;
VhtHubQuest m_hubQuest; VhtHubQuest m_hubQuest;
static const string m_pronouns[] = {
"I", "me", "my",
"we", "our", "us",
"we&", "our&", "us&"
};
virtual VhtQuest vhtInit(VhtHubQuest hubQuest) { virtual VhtQuest vhtInit(VhtHubQuest hubQuest) {
m_mapNum = level.levelNum; m_mapNum = level.levelNum;
m_hubQuest = hubQuest; m_hubQuest = hubQuest;
@ -9,11 +14,11 @@ class VhtQuest abstract play {
virtual void vhtTick() {} virtual void vhtTick() {}
virtual void vhtTravelled() {} virtual void vhtTravelled() {}
virtual void vhtPreTravelled() {} virtual void vhtPreTravelled() {}
virtual string vhtDescribe() { virtual ui string vhtDescribe(int pronouns) {
let s = StringTable.localize("$VHT_QST_" .. m_mapNum .. "_" .. m_step); let s = StringTable.localize("$VHT_QST_" .. m_mapNum .. "_" .. m_step);
s.replace("@=", multiplayer ? "us" : "me"); s.replace("@=", m_pronouns[2 + 3 * pronouns]);
s.replace("@'", multiplayer ? "our" : "my"); s.replace("@'", m_pronouns[1 + 3 * pronouns]);
s.replace("@", multiplayer ? "we" : "i"); s.replace("@", m_pronouns[0 + 3 * pronouns]);
return s; return s;
} }
LevelInfo vhtLevelInfo() const { LevelInfo vhtLevelInfo() const {
@ -90,8 +95,8 @@ class VhtQuest2 : VhtHubQuest {
m_step = 1; m_step = 1;
} }
} }
override string vhtDescribe() { override string vhtDescribe(int pronouns) {
let s = super.vhtDescribe(); let s = super.vhtDescribe(pronouns);
if(m_step == 1) { if(m_step == 1) {
s = string.format(s, m_guardianOfFire, m_guardianOfSteel); s = string.format(s, m_guardianOfFire, m_guardianOfSteel);
} }
@ -128,8 +133,8 @@ class VhtQuest4 : VhtQuest {
} }
} }
} }
override string vhtDescribe() { override string vhtDescribe(int pronouns) {
let s = super.vhtDescribe(); let s = super.vhtDescribe(pronouns);
if(!VhtQuest2(m_hubQuest).m_fFlameMask.m_result) { if(!VhtQuest2(m_hubQuest).m_fFlameMask.m_result) {
s = s .. StringTable.localize("$VHT_QST_4_FireMask"); s = s .. StringTable.localize("$VHT_QST_4_FireMask");
} }
@ -215,8 +220,9 @@ class VhtQuestHolder : Inventory {
} }
} }
} }
string vhtDescribe() { ui string vhtDescribe() {
string s = ""; 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) { for(int i = 0, j = m_quests.size(); i < j; ++i) {
if(m_quests[i]) { if(m_quests[i]) {
s.appendFormat( s.appendFormat(
@ -225,7 +231,7 @@ class VhtQuestHolder : Inventory {
m_quests[i].vhtLevelInfo().levelName, m_quests[i].vhtLevelInfo().levelName,
false false
), ),
m_quests[i].vhtDescribe() m_quests[i].vhtDescribe(pronouns)
); );
} }
} }