Skip to content

Commit

Permalink
Don't double offset for messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hubol committed Jul 23, 2024
1 parent 6c6404d commit 77999d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/igua/cutscene/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function objMessageBox(text: string) {
text2.mask = mask2;

const x = Math.round((renderer.width - width) / 2);
return c.at(x, layers.overlay.hud.effectiveHeight).show(layers.overlay.messages);
return c.at(x, 0).show(layers.overlay.messages);
}

let instance: ReturnType<typeof objMessageBox> | undefined;
Expand Down
4 changes: 3 additions & 1 deletion src/igua/objects/obj-hud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ export function objHud() {
.step(self => {
healthBarObj.width = RpgPlayer.Model.healthMax;
let y = 7;
let lastVisibleObj: Container = healthBarObj;
for (const statusObj of statusObjs) {
if (!statusObj.visible)
continue;
lastVisibleObj = statusObj;
y += 3
statusObj.y = y;
y += statusObj.height + (statusObj['advance'] ?? 0);
}

self.visible = !playerObj?.destroyed;
self.effectiveHeight = self.visible ? self.y + y : 0;
self.effectiveHeight = self.visible ? self.y + lastVisibleObj.y + lastVisibleObj.height : 0;
});
}

Expand Down

0 comments on commit 77999d2

Please sign in to comment.