Ejemplo n.º 1
0
 private void PopulateList()
 {
     if (assignedComp == null) return;
     components.Clear();
     int pos_y = 10;
     foreach (PlayerAction act in assignedComp.Actions)
     {
         var newButt = new PlayerActionButton(act, _resourceManager);
         newButt.Position = new Point(10, pos_y);
         newButt.Update(0);
         var newLabel = new Label(act.Name, "CALIBRI", _resourceManager);
         newLabel.Update(0);
         newLabel.Position = new Point(10 + newButt.ClientArea.Width + 5,
                                       pos_y + (int) (newButt.ClientArea.Height/2f) -
                                       (int) (newLabel.ClientArea.Height/2f));
         components.Add(newButt);
         components.Add(newLabel);
         pos_y += 5 + newButt.ClientArea.Height;
     }
 }
Ejemplo n.º 2
0
        private void PopulateList()
        {
            if (assignedComp == null)
            {
                return;
            }
            components.Clear();
            int pos_y = 10;

            foreach (PlayerAction act in assignedComp.Actions)
            {
                var newButt = new PlayerActionButton(act, _resourceManager);
                newButt.Position = new Point(10, pos_y);
                newButt.Update(0);
                var newLabel = new Label(act.Name, "CALIBRI", _resourceManager);
                newLabel.Update(0);
                newLabel.Position = new Point(10 + newButt.ClientArea.Width + 5,
                                              pos_y + (int)(newButt.ClientArea.Height / 2f) -
                                              (int)(newLabel.ClientArea.Height / 2f));
                components.Add(newButt);
                components.Add(newLabel);
                pos_y += 5 + newButt.ClientArea.Height;
            }
        }
Ejemplo n.º 3
0
 private void assignAction(int slot, IPlayerAction act)
 {
     slots[slot] = new PlayerActionButton(act, _resourceManager);
     slots[slot].UserData = slot;
 }
Ejemplo n.º 4
0
 private void assignAction(int slot, IPlayerAction act)
 {
     slots[slot]          = new PlayerActionButton(act, _resourceManager);
     slots[slot].UserData = slot;
 }