Beispiel #1
0
        public static void HookMainMenuGuiInit(Game.GUI.MainMenuWindow window, Game.GUI.Controls.Manager manager)
        {
            Game.GUI.Controls.Button aboutButton = window.method_39(manager, "About " + name);

            aboutButton.Click += (object sender, Game.GUI.Controls.EventArgs e) =>
            {
                var dialog = new GUI.AboutModLoaderDialog(Game.GnomanEmpire.Instance.GuiManager.Manager);
                dialog.Init();
                dialog.ShowModal();
                Game.GnomanEmpire.Instance.GuiManager.Add(dialog);
            };

            window.panel_0.Add(aboutButton);
        }
Beispiel #2
0
 public static void On_GnomanEmpire_PlayGame(GnomanEmpire self)
 {
     lbl = new Game.GUI.Controls.Label(self.GuiManager.Manager);
     lbl.Init();
     lbl.Top    = 200;
     lbl.Left   = 5;
     lbl.Width  = 1000;
     lbl.Height = 100;
     refresh();
     self.GuiManager.Add(lbl);
     btn = new Game.GUI.Controls.Button(self.GuiManager.Manager);
     btn.Init();
     btn.Top    = 300;
     btn.Left   = 5;
     btn.Text   = "Dump";
     btn.Click += new Game.GUI.Controls.EventHandler(btn_Click);
     self.GuiManager.Add(btn);
 }
Beispiel #3
0
 public static void On_GnomanEmpire_PlayGame(GnomanEmpire self)
 {
     lbl = new Game.GUI.Controls.Label(self.GuiManager.Manager);
     lbl.Init();
     lbl.Top = 200;
     lbl.Left = 5;
     lbl.Width = 1000;
     lbl.Height = 100;
     refresh();
     self.GuiManager.Add(lbl);
     btn = new Game.GUI.Controls.Button(self.GuiManager.Manager);
     btn.Init();
     btn.Top = 300;
     btn.Left = 5;
     btn.Text = "Dump";
     btn.Click += new Game.GUI.Controls.EventHandler(btn_Click);
     self.GuiManager.Add(btn);
 }
Beispiel #4
0
        public static int HookImportExportListInit(int Y, Game.GUI.ImportExportMenu importExportMenu, Game.GUI.Controls.Manager manager)
        {
            AddButton addButton = (string label) =>
            {
                var button = new Game.GUI.Controls.Button(importExportMenu.Manager);
                button.Init();
                Y           += button.Margins.Top;
                button.Width = 200;
                button.Top   = Y;
                button.Text  = label;
                importExportMenu.panel_0.Add(button);
                Y += button.Height + button.Margins.Bottom;
                return(button);
            };

            if (instance.ExportMenuListInit != null)
            {
                instance.ExportMenuListInit(importExportMenu, manager, addButton);
            }

            return(Y);
        }