예제 #1
0
        public void Select()
        {
            CheatSheet.instance.paintToolsUI.infoPanel.Visible   = false;
            CheatSheet.instance.paintToolsUI.submitPanel.Visible = false;
            CheatSheet.instance.paintToolsUI.submitInput.Text    = "";
            if (CurrentSelect != null)
            {
                CurrentSelect.isSelect = false;
            }
            if (CurrentSelect == this)
            {
                CurrentSelect = null;
                CheatSheet.instance.paintToolsHotbar.StampTiles = new Tile[0, 0];
                CheatSheet.instance.paintToolsHotbar.stampInfo  = null;
            }
            else
            {
                isSelect      = true;
                CurrentSelect = this;
                CheatSheet.instance.paintToolsHotbar.StampTiles = stampInfo.Tiles;
                CheatSheet.instance.paintToolsHotbar.stampInfo  = stampInfo;

                // Update UI;
                if (CurrentSelect.browserID > 0)
                {
                    CheatSheet.instance.paintToolsUI.infoPanel.Visible              = true;
                    CheatSheet.instance.paintToolsUI.infoMessage.Text               = browserName + ": " + rating;
                    CheatSheet.instance.paintToolsUI.upVoteButton.ForegroundColor   = Color.White;
                    CheatSheet.instance.paintToolsUI.downVoteButton.ForegroundColor = Color.White;

                    if (CurrentSelect.vote == 1)
                    {
                        CheatSheet.instance.paintToolsUI.upVoteButton.ForegroundColor = Color.Gray;
                    }
                    if (CurrentSelect.vote == -1)
                    {
                        CheatSheet.instance.paintToolsUI.downVoteButton.ForegroundColor = Color.Gray;
                    }
                }
                else if (CurrentSelect.browserID == 0)
                {
                    CheatSheet.instance.paintToolsUI.submitPanel.Visible = true;
                }
            }
        }
예제 #2
0
 public void ReorderSlots()
 {
     base.ScrollPosition = 0f;
     base.ClearContent();
     for (int i = 0; i < slotList.Count; i++)
     {
         int            num  = i;
         PaintToolsSlot slot = this.slotList[num];
         int            num2 = i % this.slotColumns;
         int            num3 = i / this.slotColumns;
         float          x    = (float)this.slotSpace + (float)num2 * (slot.Width + (float)this.slotSpace);
         float          y    = (float)this.slotSpace + (float)num3 * (slot.Height + (float)this.slotSpace);
         slot.Position = new Vector2(x, y);
         slot.Offset   = Vector2.Zero;
         this.AddChild(slot);
     }
     base.ContentHeight = base.GetLastChild().Y + base.GetLastChild().Height + this.spacing;
 }
예제 #3
0
 public void Select()
 {
     if (CurrentSelect != null)
     {
         CurrentSelect.isSelect = false;
     }
     if (CurrentSelect == this)
     {
         CurrentSelect = null;
         CheatSheet.instance.paintToolsHotbar.StampTiles = new Tile[0, 0];
         CheatSheet.instance.paintToolsHotbar.stampInfo  = null;
     }
     else
     {
         isSelect      = true;
         CurrentSelect = this;
         CheatSheet.instance.paintToolsHotbar.StampTiles = stampInfo.Tiles;
         CheatSheet.instance.paintToolsHotbar.stampInfo  = stampInfo;
     }
 }
예제 #4
0
 public void Add(PaintToolsSlot slot)
 {
     slotList.Insert(0, slot);
     slot.Select();
     ReorderSlots();
 }
예제 #5
0
 public void AddEndDontSelect(PaintToolsSlot slot)
 {
     slotList.Add(slot);
     //slot.Select();
     ReorderSlots();
 }