From d5dd7102f0d4a3eab33fe60122a2591ec2b2426b Mon Sep 17 00:00:00 2001 From: Roms1383 Date: Sun, 14 Apr 2024 08:36:46 +0700 Subject: [PATCH 1/2] :bug: track another fact --- scripts/Addicted/ui/BiomonitorController.reds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Addicted/ui/BiomonitorController.reds b/scripts/Addicted/ui/BiomonitorController.reds index 25ddaa3a..eb401b54 100644 --- a/scripts/Addicted/ui/BiomonitorController.reds +++ b/scripts/Addicted/ui/BiomonitorController.reds @@ -732,7 +732,7 @@ public class BiomonitorController extends inkGameController { E(s"enter zone: \(ToString(IntEnum(value)))"); let quests = GameInstance.GetQuestsSystem(this.GetPlayerControlledObject().GetGame()); let safe: Bool = value == EnumInt(gamePSMZones.Safe); - let mission = Cast(quests.GetFact(n"mq055_active")); + let mission = Cast(quests.GetFact(n"mq055_apt_interactions_off")); let restricted = safe && mission; this.UpdateFlag(restricted, BiomonitorRestrictions.InMission); } From 27f898088a97dbf0b32497d1a5bbe3d3156eaf23 Mon Sep 17 00:00:00 2001 From: Roms1383 Date: Sun, 14 Apr 2024 08:56:57 +0700 Subject: [PATCH 2/2] :loud_sound: temporarily add quest logs --- scripts/Addicted/ui/BiomonitorController.reds | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/Addicted/ui/BiomonitorController.reds b/scripts/Addicted/ui/BiomonitorController.reds index eb401b54..b942fdcc 100644 --- a/scripts/Addicted/ui/BiomonitorController.reds +++ b/scripts/Addicted/ui/BiomonitorController.reds @@ -162,6 +162,8 @@ public class BiomonitorController extends inkGameController { private let interactionsListener: ref; private let safeAreaListener: ref; + private let journal: ref; + protected cb func OnInitialize() { E(s"on initialize controller"); @@ -370,6 +372,11 @@ public class BiomonitorController extends inkGameController { if IsDefined(safe) { this.safeAreaListener = interactions.RegisterListenerInt(definitions.PlayerStateMachine.Zones, this, n"OnZone"); } + + this.journal = GameInstance.GetJournalManager(this.GetPlayerControlledObject().GetGame()); + if IsDefined(this.journal) { + this.journal.RegisterScriptCallback(this, n"OnJournal", gameJournalListenerType.State); + } } protected func UnregisterListeners() -> Void { let system: ref = this.GetBlackboardSystem(); @@ -427,6 +434,11 @@ public class BiomonitorController extends inkGameController { if IsDefined(safe) && IsDefined(this.safeAreaListener) { safe.UnregisterListenerInt(definitions.PlayerStateMachine.Zones, this.safeAreaListener); } + + if IsDefined(this.journal) { + this.journal.UnregisterScriptCallback(this, n"OnJournal"); + this.journal = null; + } } protected cb func OnCrossThresholdEvent(evt: ref) -> Bool { @@ -737,6 +749,15 @@ public class BiomonitorController extends inkGameController { this.UpdateFlag(restricted, BiomonitorRestrictions.InMission); } + protected cb func OnJournal(hash: Uint32, className: CName, notifyOption: JournalNotifyOption, changeType: JournalChangeType) -> Bool { + let entry: wref = this.journal.GetEntry(hash); + let state: gameJournalEntryState = this.journal.GetEntryState(entry); + let ty: gameJournalQuestType = this.journal.GetQuestType(entry); + if Equals(ty, gameJournalQuestType.ApartmentQuest) { + E(s"apartment quest: id \(entry.GetId()) / state \(ToString(state)) / notify option \(ToString(notifyOption))"); + } + } + private func UpdateFlag(value: Bool, flag: BiomonitorRestrictions) -> Void { let current : Bool = Bits.Has(this.flags, EnumInt(flag)); if NotEquals(current, value) {