Skip to content

Commit

Permalink
fix(flash): flash wasn't working if icons were hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidoine committed Jan 20, 2021
1 parent ab20023 commit b81daf8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/scripts/ovale_warlock_spells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ Define(lead_by_example_soulbind 342156)
// END
code += `
#grimoire_of_sacrifice
SpellRequire(grimoire_of_sacrifice unusable set=1 enabled=(not pet.present()))
SpellRequire(grimoire_of_sacrifice unusable set=1 enabled=(not pet.present()))
#soul_strike
SpellRequire(soul_strike unusable set=1 enabled=(not pet.present() or not pet.creaturefamily("Felguard")))
SpellRequire(soul_strike unusable set=1 enabled=(not pet.present() or not pet.creaturefamily("Felguard")))
`;
OvaleScripts.RegisterScript(
"WARLOCK",
Expand Down
19 changes: 12 additions & 7 deletions src/ui/Frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
start = element.timeSpan.NextTime(atTime);
}
if (profile.apparence.enableIcons) {
this.UpdateActionIcon(icon, element, start || 0);
this.updateActionIcon(icon, element, start || 0);
}
if (profile.apparence.spellFlash.enabled) {
this.ovaleSpellFlash.Flash(
Expand All @@ -294,7 +294,7 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
}
}

UpdateActionIcon(
private updateActionIcon(
action: Action,
element: AstNodeSnapshot,
start: number,
Expand Down Expand Up @@ -383,7 +383,7 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
}
icons.SetPoint(
"TOPLEFT",
this.updateFrame,
this.iconsFrame,
"TOPLEFT",
(action.left + ratio * action.dx) / action.scale,
(action.top + ratio * action.dy) / action.scale
Expand All @@ -394,7 +394,7 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
if (!profile.apparence.moving) {
icons.SetPoint(
"TOPLEFT",
this.updateFrame,
this.iconsFrame,
"TOPLEFT",
action.left / action.scale,
action.top / action.scale -
Expand Down Expand Up @@ -646,8 +646,11 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
localstatus = {};
actions: LuaArray<Action> = {};

/** Only used to know the update interval */
iconsFrame: UIFrame;

/** Only used to know the update interval, must be visible */
updateFrame: UIFrame;

timeSinceLastUpdate: number;

/** Used to drag the frame */
Expand Down Expand Up @@ -693,10 +696,12 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
// this.hider = hider;
this.updateFrame = CreateFrame(
"Frame",
`${ovale.GetName()}UpdateFrame`,
this.frame
`${ovale.GetName()}UpdateFrame`
);
this.updateFrame.SetAllPoints(this.frame);
this.updateFrame.Show();
this.iconsFrame = CreateFrame("Frame", undefined, this.frame);
this.iconsFrame.SetAllPoints(this.frame);
this.dragHandleTexture = this.frame.CreateTexture();
if (Masque) {
this.skinGroup = Masque.Group(ovale.GetName());
Expand Down
4 changes: 2 additions & 2 deletions src/ui/Icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const COOLDOWN_THRESHOLD = 0.1;
export interface IconParent {
checkBoxWidget: LuaObj<AceGUIWidgetCheckBox>;
listWidget: LuaObj<AceGUIWidgetDropDown>;
updateFrame: UIFrame;
iconsFrame: UIFrame;
ToggleOptions(): void;
debugIcon(index: number): void;
}
Expand Down Expand Up @@ -80,7 +80,7 @@ export class OvaleIcon {
this.frame = CreateFrame(
"CheckButton",
name,
parent.updateFrame,
parent.iconsFrame,
(secure && "SecureActionButtonTemplate, ActionButtonTemplate") ||
"ActionButtonTemplate"
);
Expand Down

0 comments on commit b81daf8

Please sign in to comment.