Ejemplo n.º 1
0
 /** builds and calls a dialog from a Message table */
 public static void message(LuaTable message) {
   String[] texts = {removeHtml((String) message.rawget("Text"))};
   log("CALL: MessageBox - " + texts[0].substring(0, Math.min(100, texts[0].length())), LOG_CALL);
   Media[] media = {(Media) message.rawget("Media")};
   String button1 = null, button2 = null;
   LuaTable buttons = (LuaTable) message.rawget("Buttons");
   if (buttons != null) {
     button1 = (String) buttons.rawget(new Double(1));
     button2 = (String) buttons.rawget(new Double(2));
   }
   LuaClosure callback = (LuaClosure) message.rawget("Callback");
   ui.pushDialog(texts, media, button1, button2, callback);
 }
Ejemplo n.º 2
0
 /** builds and calls a dialog from a Dialog table */
 public static void dialog(String[] texts, Media[] media) {
   if (texts.length > 0) {
     log("CALL: Dialog - " + texts[0].substring(0, Math.min(100, texts[0].length())), LOG_CALL);
   }
   ui.pushDialog(texts, media, null, null, null);
 }