Skip to content

Commit

Permalink
♻️ improve dismiss detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Feb 18, 2023
1 parent b3d288b commit af85950
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/Addicted/Tweaks.reds
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ protected cb func OnStatusEffectRemoved(evt: ref<RemoveStatusEffect>) -> Bool {
protected cb func OnAction(action: ListenerAction, consumer: ListenerActionConsumer) -> Bool {
wrappedMethod(action, consumer);
let pressed = Equals(EnumInt(ListenerAction.GetType(action)), EnumInt(gameinputActionType.BUTTON_PRESSED));
let chosen = Equals(ListenerAction.GetName(action), n"Choice1_Release");
if pressed && chosen {
E(s"pressed F to interact");
let chosen = Equals(ListenerAction.GetName(action), n"UI_Apply");
let interactions = GameInstance.GetBlackboardSystem(this.GetGame()).Get(GetAllBlackboardDefs().UIInteractions);
let choice = interactions.GetInt(GetAllBlackboardDefs().UIInteractions.ActiveChoiceHubID);
let dismiss = Equals(choice, -1001);
if pressed && chosen && dismiss {
E(s"pressed F to dismiss biomonitor");
let system = AddictedSystem.GetInstance(this.GetGame());
system.DismissBiomonitor();
}
Expand Down

0 comments on commit af85950

Please sign in to comment.