public void DisableGizmo() { GroundSceneCallbacks.AddPreDrawLoopCall(() => { imgui_impl.Disable(); }); }
public void SetSelectedNodePosition(float x, float y, float z) { GroundSceneCallbacks.AddUpdateLoopCall(() => { var obj = Game.PlayerLookAtTargetObject; if (obj != null) { var node = WorldSnapshotReaderWriter.Get().GetNodeById((int)obj.NetworkId, obj.ParentObject); if (node != null) { if (node.ParentId != 0) { Vector oldO2w = obj.ObjectToWorld.Position; Vector oldO2p = obj.ObjectToParent.Position; Vector deltaPos = new Vector(oldO2p.X - x, oldO2p.Y - y, oldO2p.Z - z); obj.ObjectToWorld.Position = new Vector(oldO2w + deltaPos); obj.ObjectToParent.SetPosition(x, y, z); } else { obj.Transform.SetPosition(x, y, z); } obj.PositionAndRotationChanged(false, node.Transform.Position); editorPlugin.AddUndoCommand(this, new AddUndoCommandEventArgs(new WorldSnapshotNodePositionChangedCommand(node, node.Transform, obj.Transform))); node.Transform.SetPosition(x, y, z); } } }); }
public void SaveAs(string snapshotName) { GroundSceneCallbacks.AddUpdateLoopCall(() => { WorldSnapshotReaderWriter.Get().SaveFile(snapshotName); }); }
public void EnableGizmo(UtinniCore.Utinni.Object target) { GroundSceneCallbacks.AddPreDrawLoopCall(() => { imgui_impl.Enable(target); }); }
public void Save() { GroundSceneCallbacks.AddUpdateLoopCall(() => { WorldSnapshotReaderWriter.Get().SaveFile(""); }); }
public void Reload() { GroundSceneCallbacks.AddUpdateLoopCall(() => { WorldSnapshot.Reload(); }); }
public void Load(string filename) { GroundSceneCallbacks.AddUpdateLoopCall(() => { WorldSnapshot.Load(filename); }); }
public void SetOperationModeToRotation() { GroundSceneCallbacks.AddUpdateLoopCall(() => { imgui_impl.SetOperationModeToRotate(); }); }
public void CreateObject(string filename) { GroundSceneCallbacks.AddUpdateLoopCall(() => { GroundScene.Get().CreateObjectAtPlayer(filename); }); }
public void SetWeatherIndex(int value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { Terrain.Get().WeatherIndex = value; }); }
public void ToggleFreeCam() { GroundSceneCallbacks.AddUpdateLoopCall(() => { GroundScene.Get().ToggleFreeCamera(); }); }
public void SetGizmoSnap(bool value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { imgui_impl.EnableSnap(value); }); }
private static int EntryPoint(string args) { if (!initialized) { initialized = true; Application.EnableVisualStyles(); Log.Setup(); // Load plugins from the /Plugins/ directory PluginLoader pluginLoader = new PluginLoader(); // Initialize callbacks that aren't purely editor related GameCallbacks.Initialize(); GroundSceneCallbacks.Initialize(); ObjectCallbacks.Initialize(); CuiCallbacks.Initialize(); if (UtinniCore.Utinni.utinni.GetConfig().GetBool("Editor", "enableEditorMode")) { Application.Run(new FormMain(pluginLoader)); } } return(0); }
public void Teleport(float x, float y, float z) { GroundSceneCallbacks.AddUpdateLoopCall(() => { Game.Camera.Transform.SetPosition(x, y, z); }); }
public void SetTimeOfDay(float value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { Terrain.Get().TimeOfDay = value / 1000f; // divide by 1000f to get the correct decimal value }); }
public void CreateAppearance(string filename) { GroundSceneCallbacks.AddUpdateLoopCall(() => { GroundScene.Get().CreateAppearanceAtPlayer(filename); }); }
public void AllowTargetEverything(bool value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { cui_hud.PatchAllowTargetEverything(value); }); }
public void SetSnapScale(float value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { imgui_impl.SetSnapSize(value); }); }
public void Execute() { GroundSceneCallbacks.AddUpdateLoopCall(() => { WorldSnapshot.AddNode(nodeCopy); }); }
public void EnableDragPlayer(bool value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { UtinniCore.Utinni.DebugCamera.debug_camera.EnableDragPlayer(value); }); }
public void ToggleModel() { GroundSceneCallbacks.AddUpdateLoopCall(() => { UtinniCore.Utinni.PlayerObject.player_object.TogglePlayerAppearance(); }); }
public void SetSpeed(float value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { //modifiedSpeed = value; UtinniCore.Utinni.PlayerObject.player_object.SetSpeed(value); }); }
public void SetGizmoToWorld() { GroundSceneCallbacks.AddUpdateLoopCall(() => { imgui_impl.SetGizmoModeToWorld(); }); //snapshotPanel.UpdateGizmoModeControls(false); }
public void SetSpeed(float value) { GroundSceneCallbacks.AddUpdateLoopCall(() => { //modifiedSpeed = value; UtinniCore.Utinni.DebugCamera.debug_camera.SetSpeed(value); }); }
public void TeleportToCamera() { GroundSceneCallbacks.AddUpdateLoopCall(() => { var pos = Game.Camera.Transform.Position; UtinniCore.Utinni.PlayerObject.player_object.Teleport(pos.X, 0, pos.Y); }); }
public void ResetSpeed() { GroundSceneCallbacks.AddUpdateLoopCall(() => { UtinniCore.Utinni.PlayerObject.player_object.SetSpeed(defaultSpeed); }); playerPanel.UpdateSpeed(defaultSpeed); }
public void TeleportToPlayer() { GroundSceneCallbacks.AddUpdateLoopCall(() => { var pos = Game.Player.Transform.Position; Game.Camera.Transform.SetPosition(pos.X, pos.Y + 10, pos.Z); }); }
public void ResetSpeed() // ToDo { GroundSceneCallbacks.AddUpdateLoopCall(() => { UtinniCore.Utinni.DebugCamera.debug_camera.SetSpeed(defaultSpeed); }); freeCamPanel.UpdateSpeed(defaultSpeed); }
public void ToggleGizmoSnapHotkey() { bool hasSnapOn = !imgui_impl.IsSnapOn(); GroundSceneCallbacks.AddUpdateLoopCall(() => { imgui_impl.EnableSnap(hasSnapOn); }); snapshotPanel.UpdateGizmoSnapControl(hasSnapOn); }
public PlayerObjectImpl(IPlayerPanel sceneAvailability, HotkeyManager hotkeyManager) { this.playerPanel = sceneAvailability; GameCallbacks.AddSetupSceneCall(OnSetupSceneCallback); GameCallbacks.AddCleanupSceneCall(OnCleanupCallback); GroundSceneCallbacks.AddCameraChangeCallback(OnCameraChangeCallback); hotkeyManager.Add(new Hotkey("PlayerHalfSpeed", "Half the Player speed", "F4", HalfSpeed, true, true, true)); hotkeyManager.Add(new Hotkey("PlayerDoubleSpeed", "Double the Player speed", "F5", DoubleSpeed, true, true, true)); // hotkeyManager.Add(new Hotkey("ToggleDefaultSpeed", "Shift, Control + F6", ToggleFreeCam, false)); ToDo }