1
0
Fork 0
forked from aly/qstbak

qstcompanion v1.0.5

This commit is contained in:
alydev 2025-12-04 04:40:50 +10:00
parent 52daefcfd7
commit 5e1e1decc5
9 changed files with 304 additions and 200 deletions

View file

@ -50,6 +50,8 @@ public class NewMainWindow : Window, IDisposable
private readonly MSQProgressionService msqProgressionService;
private readonly Configuration configuration;
private readonly IPluginLog log;
private readonly IUiBuilder uiBuilder;
@ -128,12 +130,6 @@ public class NewMainWindow : Window, IDisposable
private string selectedWorldFilter = "All";
private bool showWorldActionDropdown;
private uint inputStopQuestId;
private int inputStopSequence = -1;
private string selectedEventQuestId = "";
private List<(string QuestId, string QuestName)> availableEventQuests = new List<(string, string)>();
@ -314,8 +310,8 @@ public class NewMainWindow : Window, IDisposable
}
}
public NewMainWindow(Plugin plugin, AutoRetainerIPC autoRetainerIpc, QuestTrackingService questTrackingService, QuestRotationExecutionService questRotationService, EventQuestExecutionService eventQuestService, AlliedSocietyRotationService alliedSocietyRotationService, AlliedSocietyPriorityWindow alliedSocietyPriorityWindow, DataCenterService dataCenterService, MSQProgressionService msqProgressionService, IPluginLog log, IUiBuilder uiBuilder, IDataManager dataManager)
: base("Questionable Companion##NewMainWindow", ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoBackground)
public NewMainWindow(Plugin plugin, AutoRetainerIPC autoRetainerIpc, QuestTrackingService questTrackingService, QuestRotationExecutionService questRotationService, EventQuestExecutionService eventQuestService, AlliedSocietyRotationService alliedSocietyRotationService, AlliedSocietyPriorityWindow alliedSocietyPriorityWindow, DataCenterService dataCenterService, MSQProgressionService msqProgressionService, Configuration configuration, IPluginLog log, IUiBuilder uiBuilder, IDataManager dataManager)
: base("Questionable Companion##NewMainWindow", ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoBackground)
{
this.plugin = plugin;
this.autoRetainerIpc = autoRetainerIpc;
@ -326,6 +322,7 @@ public class NewMainWindow : Window, IDisposable
this.alliedSocietyPriorityWindow = alliedSocietyPriorityWindow;
this.dataCenterService = dataCenterService;
this.msqProgressionService = msqProgressionService;
this.configuration = configuration;
this.log = log;
this.uiBuilder = uiBuilder;
this.dataManager = dataManager;
@ -431,7 +428,6 @@ public class NewMainWindow : Window, IDisposable
if (registeredCharacters.Count > 0)
{
initialCharacterLoadComplete = true;
log.Information("[NewMainWindow] ✅ Initial character load successful");
}
charactersByDataCenter = dataCenterService.GroupCharactersByDataCenter(registeredCharacters);
availableWorlds = (from w in (from c in registeredCharacters
@ -447,6 +443,13 @@ public class NewMainWindow : Window, IDisposable
characterSelection[character] = false;
}
}
foreach (string savedChar in configuration.SelectedCharactersForUI)
{
if (characterSelection.ContainsKey(savedChar))
{
characterSelection[savedChar] = true;
}
}
}
catch (Exception ex)
{
@ -613,7 +616,7 @@ public class NewMainWindow : Window, IDisposable
uint rightColor = ImGui.ColorConvertFloat4ToU32(new Vector4(colorSecondary.X * 0.3f, colorSecondary.Y * 0.3f, colorSecondary.Z * 0.3f, 1f));
drawList.AddRectFilledMultiColor(windowPos, windowPos + new Vector2(windowSize.X, height), leftColor, rightColor, rightColor, leftColor);
Vector2 titlePos = windowPos + new Vector2(10f, 7f);
drawList.AddText(titlePos, ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 0.9f)), "Questionable Companion V.1.0.4");
drawList.AddText(titlePos, ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 0.9f)), "Questionable Companion V.1.0.5");
Vector2 minimizeButtonPos = windowPos + new Vector2(windowSize.X - 60f, 3f);
Vector2 minimizeButtonSize = new Vector2(24f, 24f);
if (ImGui.IsMouseHoveringRect(minimizeButtonPos, minimizeButtonPos + minimizeButtonSize))
@ -624,7 +627,22 @@ public class NewMainWindow : Window, IDisposable
isMinimized = !isMinimized;
}
}
drawList.AddText(minimizeButtonPos + new Vector2(8f, 2f), ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 1f)), "_");
uint arrowColor = ImGui.ColorConvertFloat4ToU32(new Vector4(1f, 1f, 1f, 1f));
Vector2 arrowCenter = minimizeButtonPos + new Vector2(12f, 12f);
if (isMinimized)
{
Vector2 p1 = arrowCenter + new Vector2(-4f, -5f);
Vector2 p2 = arrowCenter + new Vector2(-4f, 5f);
Vector2 p3 = arrowCenter + new Vector2(4f, 0f);
drawList.AddTriangleFilled(p1, p2, p3, arrowColor);
}
else
{
Vector2 p4 = arrowCenter + new Vector2(-5f, -4f);
Vector2 p5 = arrowCenter + new Vector2(5f, -4f);
Vector2 p6 = arrowCenter + new Vector2(0f, 4f);
drawList.AddTriangleFilled(p4, p5, p6, arrowColor);
}
Vector2 closeButtonPos = windowPos + new Vector2(windowSize.X - 30f, 3f);
Vector2 closeButtonSize = new Vector2(24f, 24f);
if (ImGui.IsMouseHoveringRect(closeButtonPos, closeButtonPos + closeButtonSize))
@ -1909,6 +1927,10 @@ public class NewMainWindow : Window, IDisposable
{
characterSelection[character] = true;
}
configuration.SelectedCharactersForUI = (from kvp in characterSelection
where kvp.Value
select kvp.Key).ToList();
configuration.Save();
}
ImGui.SameLine();
if (ImGui.Button("Deselect All"))
@ -1917,6 +1939,10 @@ public class NewMainWindow : Window, IDisposable
{
characterSelection[character2] = false;
}
configuration.SelectedCharactersForUI = (from kvp in characterSelection
where kvp.Value
select kvp.Key).ToList();
configuration.Save();
}
ImGui.SameLine();
ImGui.SetNextItemWidth(150f);
@ -1967,6 +1993,10 @@ public class NewMainWindow : Window, IDisposable
if (ImGui.Checkbox("##Select", ref isSelected))
{
characterSelection[character3] = isSelected;
configuration.SelectedCharactersForUI = (from kvp in characterSelection
where kvp.Value
select kvp.Key).ToList();
configuration.Save();
}
}
ImGui.SetCursorScreenPos(cursorPos + new Vector2(40f, 8f));