public Cammy(DalamudPluginInterface pluginInterface) { try { Plugin = this; DalamudApi.Initialize(this, pluginInterface); Config = (Configuration)DalamudApi.PluginInterface.GetPluginConfig() ?? new(); Config.Initialize(); DalamudApi.Framework.Update += Update; DalamudApi.ClientState.Login += Login; DalamudApi.ClientState.Logout += Logout; DalamudApi.PluginInterface.UiBuilder.OpenConfigUi += ToggleConfig; DalamudApi.PluginInterface.UiBuilder.Draw += Draw; DalamudApi.ClientState.TerritoryChanged += TerritoryChanged; Game.Initialize(); IPC.Initialize(); pluginReady = true; } catch (Exception e) { PluginLog.LogError($"Failed loading plugin\n{e}"); } }
public bool CheckConditionSet() => ConditionSet < 0 || IPC.QoLBarEnabled && IPC.CheckConditionSet(ConditionSet);
private static unsafe void DrawOtherSettings() { ImGui.TextUnformatted("QoL Bar Status:"); if (!IPC.QoLBarEnabled) { ImGui.SameLine(); ImGui.TextColored(new Vector4(1, 0, 0, 1), "Disabled"); ImGui.SameLine(); ImGui.PushFont(UiBuilder.IconFont); if (ImGui.SmallButton($"{FontAwesomeIcon.UndoAlt.ToIconString()}##CheckQoLBar")) { IPC.Dispose(); IPC.Initialize(); } ImGui.PopFont(); } else { ImGui.SameLine(); ImGui.TextColored(new Vector4(0, 1, 0, 1), "Enabled"); } ImGui.Spacing(); ImGui.Columns(3, null, false); { var _ = Game.GetCameraTargetHook.IsEnabled; if (ImGui.Checkbox("Spectate Focus / Soft Target", ref _)) { Game.ToggleSpectate(); } } { ImGui.NextColumn(); var _ = FreeCam.Enabled; if (ImGui.Checkbox("Free Cam", ref _)) { FreeCam.Toggle(); } } ImGui.NextColumn(); if (ImGui.Checkbox("Toggle Free Cam on Death/Revive", ref Cammy.Config.FreeCamOnDeath)) { Cammy.Config.Save(); } if (Game.cameraNoCollideReplacer.IsValid) { ImGui.NextColumn(); var _ = Game.cameraNoCollideReplacer.IsEnabled; if (ImGui.Checkbox("Disable Camera Collision", ref _)) { Game.cameraNoCollideReplacer.Toggle(); } } ImGui.Columns(1); ImGui.Spacing(); { ImGui.PushFont(UiBuilder.IconFont); if (ImGui.Button($"{FontAwesomeIcon.UndoAlt.ToIconString()}##Reset???")) { Game.cameraManager->WorldCamera->Mode = 1; } ImGui.PopFont(); ImGui.SameLine(); var _ = Game.cameraManager->WorldCamera->Mode; if (ImGui.SliderInt("???", ref _, 0, 2)) { Game.cameraManager->WorldCamera->Mode = _; } } }