public override void OnEnd() { SelectedEntity = null; // Clean up the GUI if it exists. if (InspectorGui != null) { InspectorGui.Close(); } InspectorGui = null; }
public override void Update(DwarfGame game, DwarfTime time) { World.UserInterface.VoxSelector.Enabled = false; World.UserInterface.BodySelector.Enabled = true; World.UserInterface.BodySelector.AllowRightClickSelection = false; World.UserInterface.SetMouse(World.UserInterface.MousePointer); // If no gui bit exists, go ahead and create it. If it does, update the selected entity part of it. if (InspectorGui == null) { InspectorGui = World.UserInterface.Gui.ConstructWidget(new EntityInspectionPanel()) as EntityInspectionPanel; InspectorGui.Rect = new Rectangle(0, 0, 256, 512); InspectorGui.Layout(); World.UserInterface.Gui.RootItem.AddChild(InspectorGui); InspectorGui.OnClose = (sender) => { InspectorGui = null; World.UserInterface.ChangeTool("SelectUnits"); }; } InspectorGui.SelectedEntity = SelectedEntity; }