Ejemplo n.º 1
0
        /// <summary>
        /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
        /// </summary>
        protected override void ActionPerformed(GuiButton par1GuiButton)
        {
            if (!par1GuiButton.Enabled)
            {
                return;
            }

            if (par1GuiButton.Id == 0)
            {
                Mc.DisplayGuiScreen(ParentGui);
            }
            else if (par1GuiButton.Id == 1)
            {
                SelectedSlot = SlotGeneral;
            }
            else if (par1GuiButton.Id == 3)
            {
                SelectedSlot = SlotItem;
            }
            else if (par1GuiButton.Id == 2)
            {
                SelectedSlot = SlotBlock;
            }
            else
            {
                SelectedSlot.ActionPerformed(par1GuiButton);
            }
        }
Ejemplo n.º 2
0
 public GuiStats(GuiScreen par1GuiScreen, StatFileWriter par2StatFileWriter)
 {
     StatsTitle     = "Select world";
     SelectedSlot   = null;
     ParentGui      = par1GuiScreen;
     StatFileWriter = par2StatFileWriter;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds the buttons (and other controls) to the screen in question.
 /// </summary>
 public override void InitGui()
 {
     StatsTitle  = StatCollector.TranslateToLocal("gui.stats");
     SlotGeneral = new GuiSlotStatsGeneral(this);
     SlotGeneral.RegisterScrollButtons(ControlList, 1, 1);
     SlotItem = new GuiSlotStatsItem(this);
     SlotItem.RegisterScrollButtons(ControlList, 1, 1);
     SlotBlock = new GuiSlotStatsBlock(this);
     SlotBlock.RegisterScrollButtons(ControlList, 1, 1);
     SelectedSlot = SlotGeneral;
     AddHeaderButtons();
 }