Added SuiWindowIntent and handling, added SuiMessageBox, updated SuiWindow class for extensibility along with a display method which sends an SuiWindowIntent to display the window

This commit is contained in:
Waverunner
2015-01-15 11:26:12 -05:00
parent b4ac72ddae
commit ffd459235f
4 changed files with 143 additions and 14 deletions
+45
View File
@@ -0,0 +1,45 @@
package resources.sui;
import resources.player.Player;
public class SuiMessageBox extends SuiWindow {
public SuiMessageBox(Player owner, MessageBoxType type, String title, String prompt) {
super("Script.messageBox", owner);
setProperty("bg.caption.lblTitle:Text", title);
setProperty("Prompt.lblPrompt:Text", prompt);
switch(type) {
case OK:
setProperty("btnOk:visible", "True");
setProperty("btnOk:Text", "@ok");
setProperty("btnCancel:visible", "False");
break;
case OK_CANCEL:
setProperty("btnOk:visible", "True");
setProperty("btnCancel:visible", "True");
setProperty("btnOk:Text", "@ok");
setProperty("btnCancel:Text", "@cancel");
break;
case YES_NO:
setProperty("btnOk:visible", "True");
setProperty("btnCancel:visible", "True");
setProperty("btnOk:Text", "@yes");
setProperty("btnCancel:Text", "@no");
break;
default: break;
}
}
public SuiMessageBox(Player owner, String title, String prompt) {
this(owner, MessageBoxType.OK_CANCEL, title, prompt);
}
public enum MessageBoxType {
OK,
OK_CANCEL,
YES_NO,
DEFAULT;
}
}