public void EnableGizmo(UtinniCore.Utinni.Object target) { GroundSceneCallbacks.AddPreDrawLoopCall(() => { imgui_impl.Enable(target); }); }
private void CleanUpDragDropObject() { GameCallbacks.AddMainLoopCall(() => { dragDropObject.Remove(); dragDropObject = null; }); }
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(); }