private void RefreshFlagsList() { IExtZone zone = (IExtZone)worldmap.GetSelectedZone(); lstFlags.Items.Clear(); if (zone.Flags != null) { lstFlags.Items.AddRange(zone.Flags.ToArray()); } }
private void RefreshGroupList() { IExtZone zone = (IExtZone)worldmap.GetSelectedZone(); lstGroups.ClearObjects(); if (zone.EncounterGroups != null) { lstGroups.AddObjects(zone.EncounterGroups); } }
private void RefreshLocationList() { IExtZone zone = (IExtZone)worldmap.GetSelectedZone(); lstLocations.ClearObjects(); if (zone.EncounterLocations != null) { lstLocations.AddObjects(zone.EncounterLocations); } numericDifficulty.Value = zone.Difficulty; }
private void btnRemoveMap_Click(object sender, EventArgs e) { IExtZone zone = (IExtZone)worldmap.GetSelectedZone(); ArrayList SLocs = (ArrayList)lstLocations.SelectedObjects; foreach (EncounterZoneLocation loc in SLocs.ToArray()) { zone.EncounterLocations.Remove(loc); } RefreshLocationList(); }
private void RefreshGroupList() { IExtZone zone = (IExtZone)worldmap.GetSelectedZone(); lstGroups.ClearObjects(); if (zone.EncounterGroups != null) { lstGroups.AddObjects(zone.EncounterGroups); //zone.Modified = true; } //fastObjectListView1.ClearObjects(); //if (zone.EncounterGroups != null) // fastObjectListView1.AddObjects(zone.EncounterGroups); }
public bool ModifyGroups(List <EncounterZoneGroup> groups) { if (SelectedZone == null) { return(false); } IExtZone ExtZone = (IExtZone)SelectedZone; if (ExtZone.EncounterGroups != groups) { SelectedZone.Modified = true; } ExtZone.EncounterGroups = groups; return(true); }
public bool ModifyLocation(List <EncounterZoneLocation> locations) { if (SelectedZone == null) { return(false); } IExtZone ExtZone = (IExtZone)SelectedZone; if (ExtZone.EncounterLocations != locations) { SelectedZone.Modified = true; } ExtZone.EncounterLocations = locations; return(true); }
public bool ModifyDifficulty(string value) { if (SelectedZone == null) { return(false); } IExtZone ExtZone = (IExtZone)SelectedZone; if (ExtZone.Difficulty != Int32.Parse(value)) { ExtZone.Modified = true; } ExtZone.Difficulty = Int32.Parse(value); return(true); }
private void btnAddMap_Click(object sender, EventArgs e) { IExtZone zone = (IExtZone)worldmap.GetSelectedZone(); frmLocation location = new frmLocation(zone.EncounterLocations); location.ShowDialog(); if (location.Locations.Count == 0) { return; } if (zone.EncounterLocations == null) { zone.EncounterLocations = new List <EncounterZoneLocation>(); } zone.EncounterLocations.AddRange(location.Locations); RefreshLocationList(); }
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(); } } }
public void ReplaceSelectedZone(IZone zone, ICopy ICopyParams) { int x = SelectedZone.X; int y = SelectedZone.Y; IZone copyzone = zone.Clone(); if (ICopyParams is Copy) { Copy CopyParams = (Copy)ICopyParams; IExtZone ExtSelectedZone = (IExtZone)SelectedZone; IExtZone ExtCopyZone = (IExtZone)copyzone; if (CopyParams.CopyDifficulty) { ExtSelectedZone.Difficulty = ExtCopyZone.Difficulty; } if (CopyParams.CopyGroups) { if (CopyParams.Overwrite) { ExtSelectedZone.EncounterGroups = ExtCopyZone.EncounterGroups; } else { ExtSelectedZone.EncounterGroups.AddRange(ExtCopyZone.EncounterGroups); ExtSelectedZone.EncounterGroups = Utils.RemoveDuplicates <EncounterZoneGroup>(ExtSelectedZone.EncounterGroups); } } if (CopyParams.CopyLocations) { if (CopyParams.Overwrite) { ExtSelectedZone.EncounterLocations = ExtCopyZone.EncounterLocations; } else { ExtSelectedZone.EncounterLocations.AddRange(ExtCopyZone.EncounterLocations); ExtSelectedZone.EncounterLocations = Utils.RemoveDuplicates <EncounterZoneLocation>(ExtCopyZone.EncounterLocations); } } if (ExtSelectedZone.EncounterGroups == null) { ExtSelectedZone.EncounterGroups = new List <EncounterZoneGroup>(); } if (ExtSelectedZone.EncounterLocations == null) { ExtSelectedZone.EncounterLocations = new List <EncounterZoneLocation>(); } } if (ICopyParams.CopyTerrain) { SelectedZone.Terrain = copyzone.Terrain; } if (ICopyParams.CopyChance) { SelectedZone.Chance = copyzone.Chance; } SelectedZone.Brushed = copyzone.Brushed; SelectedZone.X = x; SelectedZone.Y = y; SaveSelected(); }