mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 14:55:22 +01:00
[Beta] [Bug] Show correct username in title ui (#6710)
fix title username
This commit is contained in:
parent
ea7a1c9a74
commit
bc79a2490b
@ -47,6 +47,10 @@ export class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
return i18next.t("menu:loggedInAs", { username: displayName });
|
return i18next.t("menu:loggedInAs", { username: displayName });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateUsername() {
|
||||||
|
this.usernameLabel.setText(this.getUsername());
|
||||||
|
}
|
||||||
|
|
||||||
constructor(mode: UiMode = UiMode.TITLE) {
|
constructor(mode: UiMode = UiMode.TITLE) {
|
||||||
super(mode);
|
super(mode);
|
||||||
}
|
}
|
||||||
@ -167,6 +171,8 @@ export class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
const scaledHeight = globalScene.scaledCanvas.height;
|
const scaledHeight = globalScene.scaledCanvas.height;
|
||||||
const windowHeight = this.getWindowHeight();
|
const windowHeight = this.getWindowHeight();
|
||||||
|
|
||||||
|
this.updateUsername();
|
||||||
|
|
||||||
// Moving username and player count to top of the menu
|
// Moving username and player count to top of the menu
|
||||||
// and sorting it, to display the shorter one on top
|
// and sorting it, to display the shorter one on top
|
||||||
const UPPER_LABEL = scaledHeight - 23 - windowHeight;
|
const UPPER_LABEL = scaledHeight - 23 - windowHeight;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { MessageUiHandler } from "#ui/message-ui-handler";
|
|||||||
import { NavigationManager, NavigationMenu } from "#ui/navigation-menu";
|
import { NavigationManager, NavigationMenu } from "#ui/navigation-menu";
|
||||||
import { ScrollBar } from "#ui/scroll-bar";
|
import { ScrollBar } from "#ui/scroll-bar";
|
||||||
import { addTextObject, getTextColor } from "#ui/text";
|
import { addTextObject, getTextColor } from "#ui/text";
|
||||||
|
import type { TitleUiHandler } from "#ui/title-ui-handler";
|
||||||
import { addWindow } from "#ui/ui-theme";
|
import { addWindow } from "#ui/ui-theme";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
@ -497,6 +498,7 @@ export class AbstractSettingsUiHandler extends MessageUiHandler {
|
|||||||
this.setScrollCursor(0);
|
this.setScrollCursor(0);
|
||||||
this.eraseCursor();
|
this.eraseCursor();
|
||||||
this.getUi().bgmBar.toggleBgmBar(globalScene.showBgmBar);
|
this.getUi().bgmBar.toggleBgmBar(globalScene.showBgmBar);
|
||||||
|
(this.getUi().handlers[UiMode.TITLE] as TitleUiHandler)?.updateUsername();
|
||||||
if (this.reloadRequired) {
|
if (this.reloadRequired) {
|
||||||
this.reloadRequired = false;
|
this.reloadRequired = false;
|
||||||
globalScene.reset(true, false, true);
|
globalScene.reset(true, false, true);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user