forked from arianne/stendhal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add quick menu button to toggle chat panel visibility
- Loading branch information
1 parent
02c1ff8
commit 5c04fb6
Showing
10 changed files
with
270 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*************************************************************************** | ||
* Copyright © 2024 - Stendhal * | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU Affero General Public License as * | ||
* published by the Free Software Foundation; either version 3 of the * | ||
* License, or (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
import { ButtonBase } from "./ButtonBase"; | ||
import { ui } from "../UI"; | ||
import { UIComponentEnum } from "../UIComponentEnum"; | ||
|
||
|
||
export class ChatButton extends ButtonBase { | ||
|
||
constructor() { | ||
super("chat"); | ||
} | ||
|
||
/** | ||
* Updates button icon. | ||
*/ | ||
public override update() { | ||
const chatPanel = ui.get(UIComponentEnum.BottomPanel); | ||
if (chatPanel) { | ||
this.setImageBasename(chatPanel.isVisible() ? "chat" : "chat-disabled"); | ||
} | ||
} | ||
|
||
protected override onClick(evt: Event) { | ||
// update panel visibility | ||
const chatPanel = ui.get(UIComponentEnum.BottomPanel); | ||
if (chatPanel) { | ||
chatPanel.setVisible(!chatPanel.isVisible()); | ||
this.update(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters