Exemple #1
0
        protected override void Func_27260_a(int par1, int par2, Tessellator par3Tessellator)
        {
            base.Func_27260_a(par1, par2, par3Tessellator);

            if (Field_27268_b == 0)
            {
                GuiStats.DrawSprite(Field_27275_a, ((par1 + 115) - 18) + 1, par2 + 1 + 1, 72, 18);
            }
            else
            {
                GuiStats.DrawSprite(Field_27275_a, (par1 + 115) - 18, par2 + 1, 72, 18);
            }

            if (Field_27268_b == 1)
            {
                GuiStats.DrawSprite(Field_27275_a, ((par1 + 165) - 18) + 1, par2 + 1 + 1, 18, 18);
            }
            else
            {
                GuiStats.DrawSprite(Field_27275_a, (par1 + 165) - 18, par2 + 1, 18, 18);
            }

            if (Field_27268_b == 2)
            {
                GuiStats.DrawSprite(Field_27275_a, ((par1 + 215) - 18) + 1, par2 + 1 + 1, 36, 18);
            }
            else
            {
                GuiStats.DrawSprite(Field_27275_a, (par1 + 215) - 18, par2 + 1, 36, 18);
            }
        }
 protected GuiSlotStats(GuiStats par1GuiStats)
     : base(GuiStats.GetMinecraft(par1GuiStats), par1GuiStats.Width, par1GuiStats.Height, 32, par1GuiStats.Height - 64, 20)
 {
     Field_27269_g = par1GuiStats;
     Field_27268_b = -1;
     Field_27271_e = -1;
     Field_27270_f = 0;
     Func_27258_a(false);
     Func_27259_a(true, 20);
 }
Exemple #3
0
        protected override void DrawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
        {
            StatCrafting statcrafting = Func_27264_b(par1);
            int          i            = statcrafting.GetItemID();

            GuiStats.DrawItemSprite(Field_27275_a, par2 + 40, par3, i);
            Func_27265_a((StatCrafting)StatList.ObjectBreakStats[i], par2 + 115, par3, par1 % 2 == 0);
            Func_27265_a((StatCrafting)StatList.ObjectCraftStats[i], par2 + 165, par3, par1 % 2 == 0);
            Func_27265_a(statcrafting, par2 + 215, par3, par1 % 2 == 0);
        }
        protected override void Func_27260_a(int par1, int par2, Tessellator par3Tessellator)
        {/*
          * if (Mouse.GetState().LeftButton != ButtonState.Pressed)
          * {
          *     Field_27268_b = -1;
          * }
          */
            if (Field_27268_b == 0)
            {
                GuiStats.DrawSprite(Field_27269_g, (par1 + 115) - 18, par2 + 1, 0, 0);
            }
            else
            {
                GuiStats.DrawSprite(Field_27269_g, (par1 + 115) - 18, par2 + 1, 0, 18);
            }

            if (Field_27268_b == 1)
            {
                GuiStats.DrawSprite(Field_27269_g, (par1 + 165) - 18, par2 + 1, 0, 0);
            }
            else
            {
                GuiStats.DrawSprite(Field_27269_g, (par1 + 165) - 18, par2 + 1, 0, 18);
            }

            if (Field_27268_b == 2)
            {
                GuiStats.DrawSprite(Field_27269_g, (par1 + 215) - 18, par2 + 1, 0, 0);
            }
            else
            {
                GuiStats.DrawSprite(Field_27269_g, (par1 + 215) - 18, par2 + 1, 0, 18);
            }

            if (Field_27271_e != -1)
            {
                char  c     = 'O';
                sbyte byte0 = 18;

                if (Field_27271_e == 1)
                {
                    c = '\u0201';
                }
                else if (Field_27271_e == 2)
                {
                    c = '\u0263';
                }
                if (Field_27270_f == 1)
                {
                    byte0 = 36;
                }
                GuiStats.DrawSprite(Field_27269_g, par1 + c, par2 + 1, byte0, 0);
            }
        }
 protected void Func_27265_a(StatCrafting par1StatCrafting, int par2, int par3, bool par4)
 {
     if (par1StatCrafting != null)
     {
         string s = par1StatCrafting.Func_27084_a(GuiStats.GetStatsFileWriter(Field_27269_g).WriteStat(par1StatCrafting));
         Field_27269_g.DrawString(GuiStats.GetFontRenderer(Field_27269_g), s, par2 - (int)GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s), par3 + 5, par4 ? 0xffffff : 0x909090);
     }
     else
     {
         string s1 = "-";
         Field_27269_g.DrawString(GuiStats.GetFontRenderer(Field_27269_g), s1, par2 - (int)GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s1), par3 + 5, par4 ? 0xffffff : 0x909090);
     }
 }
        protected override void Func_27257_b(int par1, int par2)
        {
            if (par2 < Top || par2 > Bottom)
            {
                return;
            }
            int i = Func_27256_c(par1, par2);
            int j = Field_27269_g.Width / 2 - 92 - 16;

            if (i >= 0)
            {
                if (par1 < j + 40 || par1 > j + 40 + 20)
                {
                    return;
                }
                StatCrafting statcrafting = Func_27264_b(i);
                Func_27267_a(statcrafting, par1, par2);
            }
            else
            {
                string s = "";
                if (par1 >= (j + 115) - 18 && par1 <= j + 115)
                {
                    s = Func_27263_a(0);
                }
                else if (par1 >= (j + 165) - 18 && par1 <= j + 165)
                {
                    s = Func_27263_a(1);
                }
                else if (par1 >= (j + 215) - 18 && par1 <= j + 215)
                {
                    s = Func_27263_a(2);
                }
                else
                {
                    return;
                }
                s = (new StringBuilder()).Append("").Append(StringTranslate.GetInstance().TranslateKey(s)).ToString().Trim();
                if (s.Length > 0)
                {
                    int k  = par1 + 12;
                    int l  = par2 - 12;
                    int i1 = GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s);
                    GuiStats.DrawGradientRect(Field_27269_g, k - 3, l - 3, k + i1 + 3, l + 8 + 3, 0xc000000, 0xc000000);
                    GuiStats.GetFontRenderer(Field_27269_g).DrawStringWithShadow(s, k, l, -1);
                }
            }
        }
        public virtual int Func_27297_a(StatCrafting par1StatCrafting, StatCrafting par2StatCrafting)
        {
            int      i         = par1StatCrafting.GetItemID();
            int      j         = par2StatCrafting.GetItemID();
            StatBase statbase  = null;
            StatBase statbase1 = null;

            if (SlotStatsBlockGUI.Field_27271_e == 2)
            {
                statbase  = StatList.MineBlockStatArray[i];
                statbase1 = StatList.MineBlockStatArray[j];
            }
            else if (SlotStatsBlockGUI.Field_27271_e == 0)
            {
                statbase  = StatList.ObjectCraftStats[i];
                statbase1 = StatList.ObjectCraftStats[j];
            }
            else if (SlotStatsBlockGUI.Field_27271_e == 1)
            {
                statbase  = StatList.ObjectUseStats[i];
                statbase1 = StatList.ObjectUseStats[j];
            }

            if (statbase != null || statbase1 != null)
            {
                if (statbase == null)
                {
                    return(1);
                }

                if (statbase1 == null)
                {
                    return(-1);
                }

                int k = GuiStats.GetStatsFileWriter(SlotStatsBlockGUI.Field_27274_a).WriteStat(statbase);
                int l = GuiStats.GetStatsFileWriter(SlotStatsBlockGUI.Field_27274_a).WriteStat(statbase1);

                if (k != l)
                {
                    return((k - l) * SlotStatsBlockGUI.Field_27270_f);
                }
            }

            return(i - j);
        }
        protected void Func_27267_a(StatCrafting par1StatCrafting, int par2, int par3)
        {
            if (par1StatCrafting == null)
            {
                return;
            }
            Item   item = Item.ItemsList[par1StatCrafting.GetItemID()];
            string s    = new StringBuilder().Append("").Append(StringTranslate.GetInstance().TranslateNamedKey(item.GetItemName())).ToString().Trim();

            if (s.Length > 0)
            {
                int i = par2 + 12;
                int j = par3 - 12;
                int k = GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s);
                GuiStats.DrawGradientRect(Field_27269_g, i - 3, j - 3, i + k + 3, j + 8 + 3, 0xc000000, 0xc000000);
                GuiStats.GetFontRenderer(Field_27269_g).DrawStringWithShadow(s, i, j, -1);
            }
        }
 protected override void Func_27255_a(int par1, int par2)
 {
     Field_27268_b = -1;
     if (par1 >= 79 && par1 < 115)
     {
         Field_27268_b = 0;
     }
     else if (par1 >= 129 && par1 < 165)
     {
         Field_27268_b = 1;
     }
     else if (par1 >= 179 && par1 < 215)
     {
         Field_27268_b = 2;
     }
     if (Field_27268_b >= 0)
     {
         Func_27266_c(Field_27268_b);
         GuiStats.GetMinecraft(Field_27269_g).SndManager.PlaySoundFX("random.click", 1.0F, 1.0F);
     }
 }
Exemple #10
0
        public GuiSlotStatsItem(GuiStats par1GuiStats) : base(par1GuiStats)
        {
            Field_27275_a = par1GuiStats;
            Field_27273_c = new List <StatCrafting>();

            IEnumerator <StatCrafting> iterator = StatList.ItemStats.GetEnumerator();

            do
            {
                if (!iterator.MoveNext())
                {
                    break;
                }

                StatCrafting statcrafting = (StatCrafting)iterator.Current;
                bool         flag         = false;
                int          i            = statcrafting.GetItemID();

                if (GuiStats.GetStatsFileWriter(par1GuiStats).WriteStat(statcrafting) > 0)
                {
                    flag = true;
                }
                else if (StatList.ObjectBreakStats[i] != null && GuiStats.GetStatsFileWriter(par1GuiStats).WriteStat(StatList.ObjectBreakStats[i]) > 0)
                {
                    flag = true;
                }
                else if (StatList.ObjectCraftStats[i] != null && GuiStats.GetStatsFileWriter(par1GuiStats).WriteStat(StatList.ObjectCraftStats[i]) > 0)
                {
                    flag = true;
                }

                if (flag)
                {
                    Field_27273_c.Add(statcrafting);
                }
            }while (true);

            Field_27272_d = new SorterStatsItem(this, par1GuiStats);
        }
 public static FontRenderer GetFontRenderer(GuiStats par0GuiStats)
 {
     return(par0GuiStats.FontRenderer);
 }
 public SorterStatsBlock(GuiSlotStatsBlock par1GuiSlotStatsBlock, GuiStats par2GuiStats)
 {
     SlotStatsBlockGUI = par1GuiSlotStatsBlock;
     StatsGUI          = par2GuiStats;
 }
 public static StatFileWriter GetStatsFileWriter(GuiStats par0GuiStats)
 {
     return(par0GuiStats.StatFileWriter);
 }
 public static Minecraft GetMinecraft(GuiStats par0GuiStats)
 {
     return(par0GuiStats.Mc);
 }
 public SorterStatsItem(GuiSlotStatsItem par1GuiSlotStatsItem, GuiStats par2GuiStats)
 {
     SlotStatsItemGUI = par1GuiSlotStatsItem;
     StatsGUI         = par2GuiStats;
 }
 /// <summary>
 /// Draws the item sprite on top of the background sprite.
 /// </summary>
 public static void DrawItemSprite(GuiStats par0GuiStats, int par1, int par2, int par3)
 {
     par0GuiStats.DrawItemSprite(par1, par2, par3);
 }
 public static void DrawGradientRect(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6)
 {
     par0GuiStats.DrawGradientRect(par1, par2, par3, par4, par5, par6);
 }
 /// <summary>
 /// Draws a sprite from /gui/slot.png.
 /// </summary>
 public static void DrawSprite(GuiStats par0GuiStats, int par1, int par2, int par3, int par4)
 {
     par0GuiStats.DrawSprite(par1, par2, par3, par4);
 }