Exemple #1
0
        private void btnAddGroup_Click(object sender, EventArgs e)
        {
            IExtZone    zone  = (IExtZone)worldmap.GetSelectedZone();
            frmAddGroup group = new frmAddGroup(worldmap.GroupParser.GetGroups(), zone.EncounterGroups);

            group.ShowDialog();
            if (group.SelectedGroups.Count == 0)
            {
                return;
            }

            if (zone.EncounterGroups == null)
            {
                zone.EncounterGroups = new List <EncounterZoneGroup>();
            }

            zone.EncounterGroups.AddRange(group.SelectedGroups);
            RefreshGroupList();
        }
        private void pctWorldMap_MouseClick(object sender, MouseEventArgs e)
        {
            if (worldmap == null)
            {
                return;
            }

            this.ActiveControl = null;

            if (Config.ScriptingEnabled)
            {
                if (Scripting.Host.ScriptHost.worldmap_coords_clicked(e, e.X, e.Y))
                {
                    return;
                }
            }

            if (e.Button == MouseButtons.Right)
            {
                if (AddLocation.Loc != null)
                {
                    AddLocation.Selected       = false;
                    AddLocation.Loc.OnWorldmap = false;
                    AddLocation.Loc            = null;
                }
                worldmap.SetSelectedZone(-1, -1);
                pctWorldMap.Focus();
                pctWorldMap.Refresh();
                ChangeEnableStateOfZonePropertyControls(false);
                RefreshZoneProperties();
                return;
            }

            if (e.Button == MouseButtons.Left)
            {
                if (AddLocation.Selected)
                {
                    AddLocation.Loc.X          = Display.PixelToGameCoords(e.X);
                    AddLocation.Loc.Y          = Display.PixelToGameCoords(e.Y);
                    AddLocation.Loc.OnWorldmap = true;
                    AddLocation.Loc.Modified   = true;
                    AddLocation.Selected       = false;
                    AddLocation.Loc            = null;
                }
                else
                {
                    int ZoneX = Display.PixelToZoneCoord(e.X);
                    int ZoneY = Display.PixelToZoneCoord(e.Y);

                    if (Config.ScriptingEnabled)
                    {
                        if (Scripting.Host.ScriptHost.zone_activated(ZoneX, ZoneY))
                        {
                            return;
                        }
                    }

                    worldmap.SetSelectedZone(ZoneX, ZoneY);
                    ChangeEnableStateOfZonePropertyControls(true);
                    RefreshZoneProperties();
                    pctWorldMap.Refresh();
                }

                if (checkBox2.Checked == true)
                {
                    IExtZone    zone  = (IExtZone)worldmap.GetSelectedZone();
                    frmAddGroup group = new frmAddGroup(worldmap.GroupParser.GetGroups(), zone.EncounterGroups);
                    group.ShowDialog();
                    //group.Show();
                    if (group.SelectedGroups.Count == 0)
                    {
                        return;
                    }

                    if (zone.EncounterGroups == null)
                    {
                        zone.EncounterGroups = new List <EncounterZoneGroup>();
                    }

                    zone.EncounterGroups.AddRange(group.SelectedGroups);
                    zone.Modified = true;
                    RefreshGroupList();
                }
            }
        }
Exemple #3
0
        private void btnAddGroup_Click(object sender, EventArgs e)
        {
            IExtZone zone = (IExtZone)worldmap.GetSelectedZone();
            frmAddGroup group = new frmAddGroup(worldmap.GroupParser.GetGroups(), zone.EncounterGroups);
            group.ShowDialog();
            if (group.SelectedGroups.Count == 0)
                return;

            if (zone.EncounterGroups == null)
                zone.EncounterGroups = new List<EncounterZoneGroup>();

            zone.EncounterGroups.AddRange(group.SelectedGroups);
            RefreshGroupList();
        }