public void RenderSkeletons(bool value) { GameCallbacks.AddMainLoopCall(() => { UtinniCore.Utinni.SkeletalAppearance.skeleton.SetRenderSkeleton(value); }); }
public void ReloadTextures() { GameCallbacks.AddMainLoopCall(() => { Graphics.ReloadTextures(); }); }
public void EnableWireframe(bool value) { GameCallbacks.AddMainLoopCall(() => { directx9.ToggleWireframe(); }); }
public WorldSnapshotImpl(ISnapshotPanel snapshotPanel, IEditorPlugin editorPlugin, HotkeyManager hotkeyManager) { this.snapshotPanel = snapshotPanel; this.editorPlugin = editorPlugin; this.hotkeyManager = hotkeyManager; GameCallbacks.AddInstallCallback(OnInstallCallback); GameCallbacks.AddSetupSceneCall(OnSetupSceneCallback); GameCallbacks.AddCleanupSceneCall(OnCleanupCallback); ObjectCallbacks.AddOnTargetCallback(OnTarget); ImGuiCallbacks.AddOnEnabledCallback(OnGizmoEnabled); ImGuiCallbacks.AddOnDisabledCallback(OnGizmoDisabled); ImGuiCallbacks.AddOnPositionChangedCallback(OnPositionChanged); ImGuiCallbacks.AddOnRotationChangedCallback(OnRotationChanged); hotkeyManager.Add(new Hotkey("ToggleSnapshotNodeEditingMode", "Toggle Snapshot Node Editing Mode", "Oemtilde", ToggleNodeEditing, true)); hotkeyManager.Add(new Hotkey("SaveSnapshot", "Save Snapshot", "Control + S", Save, true)); hotkeyManager.Add(new Hotkey("CopySnapshotNode", "Copy Snapshot Node", "Control + C", CopyNode, true, true, true)); hotkeyManager.Add(new Hotkey("PasteSnapshotNode", "Paste Snapshot Node", "Control + V", PasteNode, true, true, true)); hotkeyManager.Add(new Hotkey("DuplicateSnapshotNode", "Duplicate Snapshot Node", "Control + D", DuplicateNode, true, true, true)); hotkeyManager.Add(new Hotkey("DeleteSnapshotNode", "Delete Snapshot Node", "Delete", RemoveNode, true, true, true)); hotkeyManager.Add(new Hotkey("SetGizmoTranslateOperationMode", "Set Gizmo Operation Mode to Translate", "Control + Q", SetOperationModeToTranslateHotkey, true, false, true)); hotkeyManager.Add(new Hotkey("SetGizmoRotationOperationMode", "Set Gizmo Operation Mode to Rotation", "Control + E", SetOperationModeToRotationHotkey, true, false, true)); hotkeyManager.Add(new Hotkey("ToggleGizmoSnap", "Toggle Gizmo Snap", "Control + B", ToggleGizmoSnapHotkey, true, false, true)); }
public void RestartMusic() { GameCallbacks.AddMainLoopCall(() => { CuiManager.RestartMusic(); }); }
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 ReloadUi() { GameCallbacks.AddMainLoopCall(() => { UtinniCore.Utinni.CuiMisc.cui_misc.ReloadUi(); }); }
private void OnDragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.Text)) // ToDo custom format { this.Focus(); this.BringToFront(); if (dragDropObject == null) { e.Effect = DragDropEffects.Copy; string dragData = (string)e.Data.GetData(DataFormats.Text); // ToDo custom format hasValidDragLocation = false; GameCallbacks.AddPreMainLoopCall(() => { CreateDragDropObject(dragData); }); } else { CleanUpDragDropObject(); e.Effect = DragDropEffects.None; } } else { e.Effect = DragDropEffects.None; } }
public void Reload() { GameCallbacks.AddMainLoopCall(() => { GroundScene.Get().ReloadTerrain(); }); }
public void Unload() { GameCallbacks.AddMainLoopCall(() => { Game.CleanupScene(); }); }
public void Load(string sceneName, string avatarObjectFilename) { GameCallbacks.AddMainLoopCall(() => { Game.LoadScene(sceneName, avatarObjectFilename); }); }
private void CleanUpDragDropObject() { GameCallbacks.AddMainLoopCall(() => { dragDropObject.Remove(); dragDropObject = null; }); }
/// <summary> /// Handle drop of the object. /// </summary> private void DropObject() { Logger.Log("Drop object " + pickedUpGameObject); pickedUpGameObject = null; if (GameCallbacks.onObjectRelease != null) { GameCallbacks.onObjectRelease(true); } }
/// <summary> /// Handle throw of the object. /// </summary> private void ThrowObject() { Logger.Log("Throwed object " + pickedUpGameObject); pickedUpGameObject = null; if (GameCallbacks.onObjectRelease != null) { GameCallbacks.onObjectRelease(false); } }
/// <summary> /// Handle pickup of the object. /// </summary> private void PickupObject() { pickedUpGameObject = pickupFsm.Fsm.GetFsmGameObject("PickedObject").Value; Logger.Log("PickupObject " + pickedUpGameObject); if (GameCallbacks.onObjectPickup != null) { GameCallbacks.onObjectPickup(pickedUpGameObject); } }
public GroundSceneImpl(IScenePanel scenePanel, HotkeyManager hotkeyManager) { this.scenePanel = scenePanel; GameCallbacks.AddInstallCallback(OnInstallCallback); GameCallbacks.AddSetupSceneCall(OnSetupSceneCallback); GameCallbacks.AddCleanupSceneCall(OnCleanupCallback); Task updateView = UpdateView(); }
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 }
public UndoRedoManager(Action onUpdateCommandsCallback, Action undoCallback, Action redoCallback) { UndoCommands = new Stack <IUndoCommand>(); RedoCommands = new Stack <IUndoCommand>(); this.onUpdateCommandsCallback = onUpdateCommandsCallback; this.undoCallback = undoCallback; this.redoCallback = redoCallback; GameCallbacks.AddCleanupSceneCall(OnCleanupCallback); }
public FreeCamImpl(IFreeCamPanel sceneAvailability, HotkeyManager hotkeyManager) { this.freeCamPanel = sceneAvailability; GameCallbacks.AddSetupSceneCall(OnSetupSceneCallback); GameCallbacks.AddCleanupSceneCall(OnCleanupCallback); GroundSceneCallbacks.AddCameraChangeCallback(OnCameraChangeCallback); hotkeyManager.Add(new Hotkey("ToggleFreeCam", "Toggle FreeCam", "Shift + Tab", ToggleFreeCam, true, true, true)); hotkeyManager.Add(new Hotkey("CameraHalfSpeed", "Half the Camera speed", "F4", HalfSpeed, true, true, true)); hotkeyManager.Add(new Hotkey("CameraDoubleSpeed", "Double the Camera speed", "F5", DoubleSpeed, true, true, true)); // hotkeyManager.Add(new Hotkey("ToggleDefaultSpeed", "Shift, Control + F6", ToggleFreeCam, false)); ToDo }
public void ProcessInput(Keys modifierKeys, Keys key, bool isGameFocused) { if (!Enabled) { return; } foreach (var pair in Hotkeys) { Hotkey hotkey = pair.Value; if (hotkey.Enabled && hotkey.ModifierKeys == modifierKeys && hotkey.Key == key) // ToDo figure out a way to have some hotkeys only work if the game has focus { if (hotkey.OnGameFocusOnly && !isGameFocused) { continue; } if (hotkey.OverrideGameInput) { // Not happy about this solution, but works, ToDo find a better way GameCallbacks.AddPreMainLoopCall(() => { UtinniCore.Utinni.CuiIo.cui_io.EnableKeyboard(false); hotkey.OnDownCallback(); // ToDo really far from perfect, occasionally doesn't proper block a call GameCallbacks.AddMainLoopCall(() => { GameCallbacks.AddPreMainLoopCall(() => { UtinniCore.Utinni.CuiIo.cui_io.EnableKeyboard(true); }); }); }); } else { hotkey.OnDownCallback(); } } } }
public MiscImpl(ISceneAvailability sceneAvailability) { this.sceneAvailability = sceneAvailability; GameCallbacks.AddSetupSceneCall(OnSetupSceneCallback); GameCallbacks.AddCleanupSceneCall(OnCleanupCallback); }