public ItemButton(int i, ADAMenu inst) { this.i = i; btn = new Button(); btn.Area = new Rectangle(244 + (i > 9 ? 240 : 0), 90 + ((i % 10) * 31), 234, 24); btn.OnMouseDown = delegate { if (inst.CDB == -1) { inst.CDB = i; } }; btn.OnMouseUp = delegate { if (inst.CDB != i) { DarosGame.Inventory.Pocket pkt = inst.CurrPkt; Item.Item temp = pkt[i]; pkt[i] = pkt[inst.CDB]; pkt[inst.CDB] = temp; temp = null; } inst.CDB = -1; }; }
public void Draw(SpriteBatch sb) { menu.Draw(sb); if (currSlide != 0.00f) { foreach (int alpha in new int[] { 463, 508, 554 }) { currencyBack.Draw(sb, new Point(800 - (int)(251f * currSlide), alpha)); } } if (invSlide != 0.00f) { invBack.Draw(sb, new Point(800 - (int)(600f * invSlide), -3)); for (int i = 0; i < 6; i++) { Button alpha = pktButtons[i]; if (alpha.Visible) { alpha.Draw(sb); if (i != 0 && i != 5) { sb.DrawString(Resources.fonts["04b03s"], "Pocket " + (pktCenter + i - 1), new Vector2(alpha.Area.X + 10, alpha.Area.Y + 4), new Color(200, 200, 200)); } } } DarosGame.Inventory.Pocket pkt = StaticVars.player.Stats.Inv.Pockets[currPkt]; for (int i = 0; i < 20; i++) { Button alpha = itemButtons[i].Btn; alpha.Draw(sb); if (pkt[i] != null && invSlide == 1f) { sb.DrawString(Resources.fonts["04b03s"], i + ": " + pkt[i].Name, new Vector2(alpha.Area.X + 10, alpha.Area.Y + 6), new Color(200, 200, 200)); } } } if (statSlide != 0.00f) { // N/A } if (skillSlide != 0.00f) { // N/A } MouseState ms = Mouse.GetState(); if (ms.LeftButton == ButtonState.Released) { Resources.curs.Draw(sb, new Point(ms.X, ms.Y)); } else if (currDragButton != -1) { Resources.cursDrag.Draw(sb, new Point(ms.X, ms.Y)); } else { Resources.cursClick.Draw(sb, new Point(ms.X, ms.Y)); } }