Skip to content

Commit

Permalink
fix(ui): ovale was not hidding out of combat
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidoine committed Jan 14, 2021
1 parent e1e836c commit 4e151d7
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/ui/Frame.ts
Expand Up @@ -175,7 +175,7 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
const profile = this.ovaleOptions.db.profile;
if (!profile.apparence.enableIcons) {
this.visible = false;
} else if (!this.frame.IsVisible()) {
} else if (!this.petFrame.IsVisible()) {
this.visible = false;
} else {
if (profile.apparence.hideVehicule && UnitHasVehicleUI("player")) {
Expand Down Expand Up @@ -673,16 +673,10 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
private runner: Runner,
private controls: Controls,
private scripts: OvaleScriptsClass,
private actionBar: OvaleActionBarClass
private actionBar: OvaleActionBarClass,
private petFrame: UIFrame
) {
super(
CreateFrame(
"Frame",
undefined,
UIParent,
"SecureHandlerStateTemplate"
)
);
super(CreateFrame("Frame", undefined, petFrame));

this.traceLog = LibTextDump.New(`Ovale - ${L.icon_snapshot}`, 750, 500);

Expand All @@ -694,7 +688,6 @@ class OvaleFrame extends WidgetContainer<UIFrame> implements IconParent {
// );
// const newFrame = ;
// hider.SetAllPoints(UIParent);
RegisterStateDriver(this.frame, "visibility", "[petbattle] hide; show");
this.tracer = ovaleDebug.create("OvaleFrame");
// this.frame = newFrame;
// this.hider = hider;
Expand Down Expand Up @@ -917,6 +910,14 @@ export class OvaleFrameModuleClass {
scripts: OvaleScriptsClass,
actionBar: OvaleActionBarClass
) {
const petFrame = CreateFrame(
"Frame",
undefined,
UIParent,
"SecureHandlerStateTemplate"
);
RegisterStateDriver(petFrame, "visibility", "[petbattle] hide; show");
petFrame.SetAllPoints(UIParent);
this.module = ovale.createModule(
"OvaleFrame",
this.OnInitialize,
Expand All @@ -940,7 +941,8 @@ export class OvaleFrameModuleClass {
runner,
controls,
scripts,
actionBar
actionBar,
petFrame
);
}
}

0 comments on commit 4e151d7

Please sign in to comment.