private void UIPlayers_DoubleClick(object sender, System.EventArgs e) { if (selectedX == -1) { return; } var wmc = (WorldMapCreature)UIPlayers.SelectedItem; var form = new CreatureViewer(); form.Definition = definition; form.MapCreature = wmc; form.Show(); }
private void UIResidentCreatures_DoubleClick(object sender, System.EventArgs e) { if (selectedX == -1) { return; } var creature = (Creature)UIResidentCreatures.SelectedItem; var form = new CreatureViewer(); form.Definition = definition; WorldMapCreature MapCreature = new WorldMapCreature(); MapCreature.Creature = creature; MapCreature.AppearingIn = room.Name; MapCreature.ChanceAppearing = (byte)100; //form.Creature = creature; form.MapCreature = MapCreature; form.Show(); }
private void UIRandomCreature_DoubleClick(object sender, System.EventArgs e) { if (UIRandomCreature.TextLength == 0) { return; } var form = new CreatureViewer(); form.Definition = definition; WorldMapCreature MapCreature = new WorldMapCreature(); MapCreature.Creature = region.RandomCreatures[room.RandomCreatureNumber]; MapCreature.AppearingIn = room.Name; MapCreature.ChanceAppearing = room.RandomCreatureChance; //form.Creature = region.RandomCreatures[room.RandomCreatureNumber]; form.MapCreature = MapCreature; form.MdiParent = this.MdiParent; form.Show(); }
private void UIItemTree_DoubleClick(object sender, EventArgs e) { if (UIItemTree.SelectedNode == null || UIItemTree.SelectedNode.Tag == null) { return; } if (UIItemTree.SelectedNode.Tag is string) { var t = (string)UIItemTree.SelectedNode.Tag; switch (t) { case "graphics": var grViewer = new GraphicsViewer { MdiParent = this, Definition = definition }; grViewer.Show(); grViewer.UpdateSelectedGraphic(); break; case "worldmap": var mapViewer = new MapViewer { MdiParent = this, Definition = definition }; mapViewer.Show(); mapViewer.UpdateMap(); break; case "info": var infoViewer = new InfoViewer { MdiParent = this, Definition = definition }; infoViewer.Show(); break; } } if (UIItemTree.SelectedNode.Tag is Thing) { ThingViewer form = new ThingViewer { MdiParent = this, Definition = definition, Thing = (Thing)UIItemTree.SelectedNode.Tag }; form.Show(); } else if (UIItemTree.SelectedNode.Tag is Creature) { CreatureViewer creatForm = new CreatureViewer { Definition = definition, MdiParent = this, Creature = (Creature)UIItemTree.SelectedNode.Tag }; creatForm.Show(); } else if (UIItemTree.SelectedNode.Tag is WorldMapCreature) { CreatureViewer creatForm = new CreatureViewer { Definition = definition, MdiParent = this, MapCreature = (WorldMapCreature)UIItemTree.SelectedNode.Tag }; creatForm.Show(); } else if (UIItemTree.SelectedNode.Tag is Region) { RegionViewer regform = new RegionViewer { MdiParent = this, Definition = definition, DisplayRegion = (Region)UIItemTree.SelectedNode.Tag }; regform.Show(); } else if (UIItemTree.SelectedNode.Tag is Terrain) { TerrainViewer terrainForm = new TerrainViewer { MdiParent = this, Definition = definition, Terrain = (Terrain)UIItemTree.SelectedNode.Tag }; terrainForm.Show(); } else if (UIItemTree.SelectedNode.Tag is WorldMapCreature) { CreatureViewer creatureForm = new CreatureViewer { Definition = definition, MdiParent = this, MapCreature = (WorldMapCreature)UIItemTree.SelectedNode.Tag }; creatureForm.Show(); } }