Esempio n. 1
0
        /** Creates buttons for each party, allowing the user to select one of them. */
        private void updatePartyList()
        {
            CoM.CleanParties();
            partyList.Clear();
            int yPos = 0;

            foreach (MDRParty party in CoM.PartyList)
            {
                var partyButton = new GuiPartySpan(party)
                {
                    X = 0, Y = yPos
                };
                partyButton.OnMouseClicked += delegate {
                    selectParty(partyButton.Party);
                };
                partyList.Add(partyButton);
                yPos += partyButton.Height;
            }

            if (AllowCreateParty)
            {
                //var createButton = new GuiButton("Create New Party", GuiPartySpan.WIDTH, GuiPartySpan.HEIGHT) { X = 0, Y = yPos };
                var createButton = new GuiPartySpan(null)
                {
                    X = 0, Y = yPos
                };
                createButton.Editable        = false;
                createButton.Caption         = "Create New Party";
                createButton.Color           = Color.gray;
                createButton.OnMouseClicked += delegate {
                    var party = MDRParty.Create();
                    CoM.PartyList.Add(party);
                    var state = new EditPartyState(party, true);
                    Engine.PushState(state);
                };
                partyList.Add(createButton);
                yPos += createButton.Height;
            }

            partyList.FitToChildren();
        }
Esempio n. 2
0
 /** Removes all characters from party, and dispands it. */
 public void Dispand()
 {
     RemoveAll();
     CoM.CleanParties();
 }