diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/scape/ChangeAvatarDialog.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/scape/ChangeAvatarDialog.java')
| -rw-r--r-- | NET/worlds/scape/ChangeAvatarDialog.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/NET/worlds/scape/ChangeAvatarDialog.java b/NET/worlds/scape/ChangeAvatarDialog.java new file mode 100644 index 0000000..9843b44 --- /dev/null +++ b/NET/worlds/scape/ChangeAvatarDialog.java @@ -0,0 +1,60 @@ +package NET.worlds.scape; + +import NET.worlds.console.Console; +import NET.worlds.console.DialogReceiver; +import NET.worlds.console.ImageButtons; +import NET.worlds.console.ImageButtonsCallback; +import NET.worlds.console.PolledDialog; +import NET.worlds.core.IniFile; +import java.awt.Component; +import java.awt.Rectangle; +import java.awt.Window; +import java.text.MessageFormat; + +public class ChangeAvatarDialog extends PolledDialog implements ImageButtonsCallback { + private ImageButtons ib; + + public ChangeAvatarDialog(Window parent, DialogReceiver receiver, String name) { + super(parent, receiver, Console.message("Change-Avatar"), false); + this.setAlignment(1); + Rectangle[] rects = new Rectangle[2]; + int yesX = IniFile.override().getIniInt("changeavYesX", 39); + int yesY = IniFile.override().getIniInt("changeavYesY", 23); + int yesW = IniFile.override().getIniInt("changeavYesW", 48); + int yesH = IniFile.override().getIniInt("changeavYesH", 18); + rects[0] = new Rectangle(yesX, yesY, yesW, yesH); + int noX = IniFile.override().getIniInt("changeavNoX", 96); + int noY = IniFile.override().getIniInt("changeavNoY", 23); + int noW = IniFile.override().getIniInt("changeavNoW", 42); + int noH = IniFile.override().getIniInt("changeavnoH", 18); + rects[1] = new Rectangle(noX, noY, noW, noH); + Object[] arguments = new Object[]{new String(name)}; + this.ib = new ChangeAvatarImageButtons( + IniFile.override().getIniString("changeAvDlg", Console.message("changeav.gif")), + rects, + this, + MessageFormat.format(Console.message("Change-avatar-to"), arguments) + ); + this.ready(); + } + + @Override + protected void build() { + this.add("Center", this.ib); + } + + @Override + public Object imageButtonsCallback(Component who, int which) { + this.done(which == 0); + return null; + } + + @Override + public boolean keyDown(java.awt.Event event, int key) { + if (key == 27) { + return this.done(false); + } else { + return key == 10 ? this.done(true) : super.keyDown(event, key); + } + } +} |