Exemple #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Groups.Clear();
            Locations.Clear();
            Flags.Clear();

            OverwriteChance = chkOverwriteChance.Checked;
            EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value);

            foreach (object o in lstGroups.SelectedItems)
            {
                EncounterZoneGroup group = new EncounterZoneGroup();
                group.Name     = o.ToString();
                group.Quantity = Decimal.ToInt32(numEncounterQuantity.Value);
                Groups.Add(group);
            }

            foreach (object o in lstLocations.SelectedItems)
            {
                EncounterZoneLocation location = new EncounterZoneLocation();
                location.Name = o.ToString();
                Locations.Add(location);
            }

            foreach (object o in lstFlags.SelectedItems)
            {
                string flag;
                flag = o.ToString();
                Flags.Add(flag);
            }

            Cancelled = false;
            this.Close();
        }
Exemple #2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Groups.Clear();
            Locations.Clear();
            Flags.Clear();

            OverwriteChance = chkOverwriteChance.Checked;
            EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value);

            foreach (object o in lstGroups.SelectedItems)
            {
                EncounterZoneGroup group = new EncounterZoneGroup();
                group.Name = o.ToString();
                group.Quantity = Decimal.ToInt32(numEncounterQuantity.Value);
                Groups.Add(group);
            }

            foreach (object o in lstLocations.SelectedItems)
            {
                EncounterZoneLocation location = new EncounterZoneLocation();
                location.Name = o.ToString();
                Locations.Add(location);
            }

            foreach (object o in lstFlags.SelectedItems)
            {
                string flag;
                flag = o.ToString();
                Flags.Add(flag);
            }

            Cancelled = false;
            this.Close();
        }
Exemple #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            ArrayList SGroups = (ArrayList)lstGroups.SelectedObjects;
            SGroups.Cast<EncounterGroup>();
            foreach (EncounterGroup group in SGroups.ToArray())
            {
                EncounterZoneGroup NewGroup = new EncounterZoneGroup();
                NewGroup.Name = group.Name;
                NewGroup.Quantity = Decimal.ToInt32(numEncounterQuantity.Value);
                SelectedGroups.Add(NewGroup);
            }

            EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value);
            this.Close();
        }
Exemple #4
0
        private void lstGroups_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            EncounterZoneGroup group = (EncounterZoneGroup)lstGroups.SelectedObject;

            if (group == null)
            {
                return;
            }

            frmEditGroup EditGroup = new frmEditGroup();

            EditGroup.group = group;
            EditGroup.ShowDialog();
            RefreshGroupList();
        }
Exemple #5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            ArrayList SGroups = (ArrayList)lstGroups.SelectedObjects;

            SGroups.Cast <EncounterGroup>();
            foreach (EncounterGroup group in SGroups.ToArray())
            {
                EncounterZoneGroup NewGroup = new EncounterZoneGroup();
                NewGroup.Name     = group.Name;
                NewGroup.Quantity = Decimal.ToInt32(numEncounterQuantity.Value);
                SelectedGroups.Add(NewGroup);
            }

            EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value);
            this.Close();
        }
        private List <EncounterZoneGroup> ParseGroups(String[] Groups, EncounterGroupParser GroupParser, string Pos)
        {
            List <EncounterZoneGroup> Grps = new List <EncounterZoneGroup>();

            if (Groups.Length > 1 || Groups[0] != "")
            {
                foreach (string i in Groups)
                {
                    if (i.Length < 5 || i.Substring(0, 5) != "GROUP")
                    {
                        Message.Show("Invalid group " + i + " at " + Pos + ".", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    String[]           toks  = i.Split(':');
                    EncounterZoneGroup group = new EncounterZoneGroup(toks[0], Int32.Parse(toks[1]), GroupParser.GetGroupByName(toks[0]));
                    Grps.Add(group);
                }
            }
            return(Grps);
        }
Exemple #7
0
        private List<EncounterZoneGroup> ParseGroups(String[] Groups, EncounterGroupParser GroupParser, string Pos)
        {
            List<EncounterZoneGroup> Grps = new List<EncounterZoneGroup>();

            if (Groups.Length > 1 || Groups[0] != "")
                foreach (string i in Groups)
                {
                    if (i.Length < 5 || i.Substring(0, 5) != "GROUP") Message.Show("Invalid group " + i + " at " + Pos + ".", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    String[] toks = i.Split(':');
                    EncounterZoneGroup group = new EncounterZoneGroup(toks[0], Int32.Parse(toks[1]), GroupParser.GetGroupByName(toks[0]));
                    Grps.Add(group);
                }
            return Grps;
        }