public LotDebugScreen() { var lotInfo = XmlHouseData.Parse(GameFacade.GameFilePath("housedata/blueprints/restaurant01_00.xml")); World = new World(GameFacade.Game.GraphicsDevice); GameFacade.Scenes.Add(World); vm = new TSO.Simantics.VM(new VMContext(World)); vm.Init(); var activator = new VMWorldActivator(vm, World); var blueprint = activator.LoadFromXML(lotInfo); World.InitBlueprint(blueprint); vm.Context.Blueprint = blueprint; var sim = activator.CreateAvatar(); //sim.Position = new Vector3(31.5f, 55.5f, 0.0f); sim.Position = new Vector3(26.5f, 41.5f, 0.0f); VMDebug = new UIButton() { Caption = "Simantics", Y = 45, Width = 100, X = GlobalSettings.Default.GraphicsWidth - 110 }; VMDebug.OnButtonClick += new ButtonClickDelegate(VMDebug_OnButtonClick); this.Add(VMDebug); LotController = new UILotControl(vm, World); this.AddAt(0, LotController); ucp = new UIUCP(this); ucp.Y = ScreenHeight - 210; ucp.SetInLot(true); ucp.SetMode(UIUCP.UCPMode.LotMode); ucp.SelectedAvatar = sim; ucp.SetPanel(1); //ucp.ZoomLevel = 1; //ucp.OnZoomChanged += new UCPZoomChangeEvent(ucp_OnZoomChanged); //ucp.OnRotateChanged += new UCPRotateChangeEvent(ucp_OnRotateChanged); this.Add(ucp); }
public void InitTestLot() { var lotInfo = XmlHouseData.Parse(GameFacade.GameFilePath("housedata/blueprints/restaurant08_00.xml")); World = new World(GameFacade.Game.GraphicsDevice); GameFacade.Scenes.Add(World); vm = new TSO.Simantics.VM(new VMContext(World)); vm.Init(); var activator = new VMWorldActivator(vm, World); var blueprint = activator.LoadFromXML(lotInfo); World.InitBlueprint(blueprint); vm.Context.Blueprint = blueprint; var sim = activator.CreateAvatar(); sim.Position = new Vector3(26.5f, 41.5f, 0.0f); var sim2 = activator.CreateAvatar(); sim2.Position = new Vector3(27.5f, 41.5f, 0.0f); /*for (float x = 30.5f; x < 40.5; x+=1.0f) { for (float y = 42.5f; y < 52.5; y += 1.0f) { var sim3 = activator.CreateAvatar(); sim3.Position = new Vector3(x, y, 0.0f); } }*/ LotController = new UILotControl(vm, World); this.AddAt(0, LotController); vm.Context.Clock.Hours = 6; ucp.SelectedAvatar = sim; ucp.SetInLot(true); if (m_ZoomLevel > 3) World.Visible = false; }
public LotScreenNew() { var lotInfo = XmlHouseData.Parse(GameFacade.GameFilePath("housedata/blueprints/restaurant07_00.xml")); World = new World(); GameFacade.Scenes.Add(World); vm = new VM(new VMContext(World)); vm.Init(); var activator = new VMWorldActivator(vm, World); var blueprint = activator.LoadFromXML(lotInfo); World.InitBlueprint(blueprint); vm.Context.Blueprint = blueprint; var sim = activator.CreateAvatar(); //sim.Position = new Vector3(31.5f, 55.5f, 0.0f); sim.Position = new Vector3(26.5f, 41.5f, 0.0f); VMDebug = new UIButton() { Caption = "Simantics", Y = 45, Width = 100, X = GlobalSettings.Default.GraphicsWidth - 110 }; VMDebug.OnButtonClick += new ButtonClickDelegate(VMDebug_OnButtonClick); this.Add(VMDebug); //var lotInfo = HouseData.Parse("C:\\restaurant00_00_small.xml"); //for (int i = 1; i < 64; i++) //{ // lotInfo.World.Floors.Add(new HouseDataFloor { // X = 1, // Y = i, // Level = 0, // Value = 9 // }); //} //lotInfo.World.Floors.Add(new HouseDataFloor { // X = 0, Y = 0, // Level = 0, Value = 20 //}); //lotInfo.World.Floors.Add(new HouseDataFloor //{ // X = 63, // Y = 63, // Level = 0, // Value = 40 //}); //lotInfo.World.Floors.Add(new HouseDataFloor //{ // X = 0, // Y = 63, // Level = 0, // Value = 20 //}); //lotInfo.World.Floors.Add(new HouseDataFloor //{ // X = 63, // Y = 0, // Level = 0, // Value = 20 //}); //Renderer = new HouseRenderer(); //Renderer.SetModel(lotInfo); ////Renderer.Position = new Microsoft.Xna.Framework.Vector3(-32.0f, -40.0f, 0.0f); //var scene = new ThreeDScene(); //var focusPoint = Vector3.Zero; //var yValue = (float)Math.Cos(MathHelper.ToRadians(30.0f)) * 96.0f; //var cameraOffset = new Vector3(-96.0f, yValue, 96.0f); //var rotatedOffset = Vector3.Transform(cameraOffset, Microsoft.Xna.Framework.Matrix.CreateRotationY(MathHelper.PiOver2 * 0.5f)); ////rotatedOffset = Vector3.Transform(rotatedOffset, Microsoft.Xna.Framework.Matrix.CreateScale(3f)); ////Renderer.Position = new Vector3(-96.0f, 0.0f, -96.0f); //scene.Camera.Position = cameraOffset;// new Microsoft.Xna.Framework.Vector3(0, 0, 80); //scene.Add(Renderer); //Renderer.Scale = new Vector3(0.005f); //GameFacade.Scenes.AddScene(scene); ucp = new UIUCP(); ucp.Y = ScreenHeight - 210; ucp.OnZoomChanged += new UCPZoomChangeEvent(ucp_OnZoomChanged); ucp.OnRotateChanged += new UCPRotateChangeEvent(ucp_OnRotateChanged); this.Add(ucp); }
public void InitTestLot(string path) { var lotInfo = XmlHouseData.Parse(path); if (vm != null) CleanupLastWorld(); World = new World(GameFacade.Game.GraphicsDevice); GameFacade.Scenes.Add(World); vm = new TSO.Simantics.VM(new VMContext(World)); vm.Init(); var activator = new VMWorldActivator(vm, World); var blueprint = activator.LoadFromXML(lotInfo); World.InitBlueprint(blueprint); vm.Context.Blueprint = blueprint; var sim = activator.CreateAvatar(); sim.Position = LotTilePos.FromBigTile(56, 33, 1); var sim2 = activator.CreateAvatar(); sim2.Position = LotTilePos.FromBigTile(56, 34, 1); var mailbox = vm.Entities.First(x => (x.Object.OBJ.GUID == 0xEF121974 || x.Object.OBJ.GUID == 0x1D95C9B0)); VMFindLocationFor.FindLocationFor(sim, mailbox, vm.Context); VMFindLocationFor.FindLocationFor(sim2, mailbox, vm.Context); HITVM.Get().PlaySoundEvent("lot_enter"); World.State.CenterTile = new Vector2(sim.VisualPosition.X, sim.VisualPosition.Y); LotController = new UILotControl(vm, World); this.AddAt(0, LotController); vm.Context.Clock.Hours = 10; ucp.SelectedAvatar = sim; ucp.SetInLot(true); if (m_ZoomLevel > 3) World.Visible = false; ZoomLevel = 1; }