I_GRIN_I

main2.js

Jan 4th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var _;
  2.  
  3. (function() {
  4.  
  5.     _ = GameUI.CustomUIConfig().UtilLibrary;
  6.  
  7.     function Dialog(options) {
  8.         //$.Msg("Dialog constructor");
  9.         this.controls = [];
  10.         _.Panel.call(this, options);
  11.         if (this.controls.length) this.controls[0].panel.SetFocus();
  12.     }
  13.     _.inherits(Dialog, _.Panel);
  14.     Dialog.prototype.close = function() {
  15.         this.panel.DeleteAsync(0);
  16.     }
  17.     Dialog.prototype.getControl = function(input) {
  18.         return this.controls.indexOf(input);
  19.     }
  20.     Dialog.prototype.focusNextInput = function(input) {
  21.         this.controls[(this.getControl(input) + 1) % this.controls.length].panel.SetFocus();
  22.     }
  23.  
  24.     GameUI.CustomUIConfig().DialogLibrary = {
  25.         contextPanel: $.GetContextPanel(),
  26.         Dialog: Dialog
  27.     };
  28.  
  29.     $.Msg("dialog/main.js");
  30. })();
Add Comment
Please, Sign In to add comment