public void ToggleFreeCam() { GroundSceneCallbacks.AddUpdateLoopCall(() => { GroundScene.Get().ToggleFreeCamera(); }); }
public void CreateAppearance(string filename) { GroundSceneCallbacks.AddUpdateLoopCall(() => { GroundScene.Get().CreateAppearanceAtPlayer(filename); }); }
public void CreateObject(string filename) { GroundSceneCallbacks.AddUpdateLoopCall(() => { GroundScene.Get().CreateObjectAtPlayer(filename); }); }
public void Reload() { GameCallbacks.AddMainLoopCall(() => { GroundScene.Get().ReloadTerrain(); }); }
public void DoubleSpeed() { if (!GroundScene.Get().IsFreeCameraActive) { float value = GetSpeed() * 2; SetSpeed(value); playerPanel.UpdateSpeed(value); } }
public void HalfSpeed() { if (GroundScene.Get().IsFreeCameraActive) { float value = GetSpeed() / 2; SetSpeed(value); freeCamPanel.UpdateSpeed(value); } }
private void removeStateVariables() { //remove all state variables DataManager.Instance.SetProgress(null); ZoneManager.Instance.Cleanup(); DungeonScene.InitInstance(); GroundScene.InitInstance(); LuaEngine.Instance.Reset(); LuaEngine.Instance.ReInit(); }
private void lbFiles_MouseDoubleClick(object sender, MouseEventArgs e) { // ToDo SelectChanged events for listbox are broken with manual add, implement enable/disable of the controls down the road instead of this check if (lbFiles.SelectedIndex == -1 || GroundScene.Get() == null) { return; } if (e.Button == MouseButtons.Left) { CreateSnapshotNodeAtPlayer(); // ToDo add a different spawn location if in freecam } }
public void Teleport(float x, float y, float z) { GroundSceneCallbacks.AddUpdateLoopCall(() => { if (GroundScene.Get().IsFreeCameraActive) { GroundScene.Get().ToggleFreeCamera(); } UtinniCore.Utinni.PlayerObject.player_object.Teleport(x, y, z); }); }
private void btnCreateSnapshotNodesAtPlayer_Click(object sender, EventArgs e) { // ToDo SelectChanged events for listbox are broken with manual add, implement enable/disable of the controls down the road instead of this check if (lbFiles.SelectedIndex == -1 || GroundScene.Get() == null) { return; } for (int i = 0; i < nudSnapshotNodeCount.Value; i++) { CreateSnapshotNodeAtPlayer(); } }
private async Task UpdateSpeed() { while (true) { await Task.Delay(1); if (GroundScene.Get() != null && Game.Camera != null && GetSpeed() > 0f) { defaultSpeed = GetSpeed(); freeCamPanel.UpdateSpeed(defaultSpeed); break; } } }
private async Task UpdateCellName() { while (GroundScene.Get() != null) { var player = Game.Player; if (player != null && player.ParentCell != null) { playerPanel.UpdateCellName(player.ParentCell.Name + ": " + player.ParentCell.Index + " (" + 0 + ")"); // ToDo get network id } await Task.Delay(5); } }
private async Task UpdateCellName() { while (GroundScene.Get() != null) { var camera = Game.Camera; if (camera != null && camera.ParentCell != null) { freeCamPanel.UpdateCellName(camera.ParentCell.Name + ": " + camera.ParentCell.Index + " (" + 0 + ")"); // ToDo get network id } await Task.Delay(5); } }
private void btnSaveAs_Click(object sender, EventArgs e) { FormSnapshotSaveAsDialog form = new FormSnapshotSaveAsDialog(GroundScene.Get().Name) { Location = new System.Drawing.Point(MousePosition.X - 200, MousePosition.Y - 40) }; DialogResult dialogResult = form.ShowDialog(this); if (dialogResult == DialogResult.OK) { worldSnapshot.SaveAs(form.SaveAsName); } }
private void CreateDragDropObject(string filename) { var player = Game.Player; var camera = GroundScene.Get().CurrentCamera; if (player == null || camera == null || dragDropObject != null) // ToDo Sometimes this function ets called twice, why { return; } var objTemplate = ObjectTemplateList.GetObjectTemplateByFilename(filename); if (objTemplate == null) { return; } if (objTemplate.AppearanceFilename == "" && objTemplate.ClientDataFilename == "" && objTemplate.PortalLayoutFilename == "") { return; } dragDropObject = UtinniCore.Utinni.Object.Ctor; dragDropObject.AddNotification(0x019136E4, false); // ToDo Label the magic number string appearanceFilename; if (objTemplate.PortalLayoutFilename == "") { appearanceFilename = objTemplate.AppearanceFilename; } else { var pob = PortalPropertyTemplateList.GetPobByCrcString(PersistentCrcString.Ctor(objTemplate.PortalLayoutFilename)); appearanceFilename = pob.ExteriorAppearanceName; } var apperance = Appearance.Create(appearanceFilename); if (apperance == null) { CleanUpDragDropObject(); return; } dragDropObject.SetAppearance(apperance); dragDropObject.ClientObject.SetParentCell(camera.ParentCell); UtinniCore.Utinni.RenderWorld.render_world.AddObjectNotifications(dragDropObject); dragDropObject.AddToWorld(); }
private async Task UpdateView() { while (true) { await Task.Delay(1); if (GroundScene.Get() != null && Terrain.Get() != null) { GroundSceneCallbacks.AddUpdateLoopCall(() => { scenePanel.UpdateTimeOfDay((int)(Terrain.Get().TimeOfDay * 1000)); // multiply by 1000f to get the correct trackbar value }); } } }
private void OnCameraChangeCallback() { playerPanel.UpdateTeleportToCamera(GroundScene.Get().IsFreeCameraActive); }
private void OnCameraChangeCallback() { freeCamPanel.UpdateFreecamAvailability(GroundScene.Get().IsFreeCameraActive); }