muffin v7.38
This commit is contained in:
parent
411c0bbe76
commit
e5b98b3d57
35 changed files with 10700 additions and 7610 deletions
132
Questionable/Questionable.Windows/ChangelogWindow.cs
Normal file
132
Questionable/Questionable.Windows/ChangelogWindow.cs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using LLib.ImGui;
|
||||
using Questionable.Data;
|
||||
using Questionable.Model.Changelog;
|
||||
using Questionable.Windows.ChangelogComponents;
|
||||
|
||||
namespace Questionable.Windows;
|
||||
|
||||
internal sealed class ChangelogWindow : LWindow
|
||||
{
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
||||
private readonly ChangelogHeaderComponent _headerComponent;
|
||||
|
||||
private readonly ChangelogFooterComponent _footerComponent;
|
||||
|
||||
private int _windowOpenCount;
|
||||
|
||||
private bool _hasSetInitialState;
|
||||
|
||||
private float _headerAnimationTime;
|
||||
|
||||
public ChangelogWindow(Configuration configuration, IDalamudPluginInterface pluginInterface)
|
||||
: base("Questionable Changelog###QuestionableChangelog", ImGuiWindowFlags.NoTitleBar)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_pluginInterface = pluginInterface;
|
||||
_headerComponent = new ChangelogHeaderComponent();
|
||||
_footerComponent = new ChangelogFooterComponent();
|
||||
base.Size = new Vector2(900f, 650f);
|
||||
base.SizeCondition = ImGuiCond.FirstUseEver;
|
||||
base.SizeConstraints = new WindowSizeConstraints
|
||||
{
|
||||
MinimumSize = new Vector2(700f, 500f),
|
||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
||||
};
|
||||
}
|
||||
|
||||
public override void DrawContent()
|
||||
{
|
||||
_headerComponent.Draw(delegate(bool isOpen)
|
||||
{
|
||||
base.IsOpen = isOpen;
|
||||
});
|
||||
DrawChangelogEntries();
|
||||
ChangelogFooterComponent.Draw(delegate
|
||||
{
|
||||
MarkAllAsRead();
|
||||
base.IsOpen = false;
|
||||
});
|
||||
ImDrawListPtr windowDrawList = ImGui.GetWindowDrawList();
|
||||
Vector2 windowPos = ImGui.GetWindowPos();
|
||||
Vector2 windowSize = ImGui.GetWindowSize();
|
||||
windowDrawList.AddRect(windowPos, windowPos + windowSize, ImGui.ColorConvertFloat4ToU32(new Vector4(0.65f, 0.55f, 0.85f, 0.3f)), 0f, ImDrawFlags.None, 2f);
|
||||
}
|
||||
|
||||
public override void OnOpen()
|
||||
{
|
||||
base.OnOpen();
|
||||
_windowOpenCount++;
|
||||
_hasSetInitialState = false;
|
||||
_headerAnimationTime = 0f;
|
||||
_headerComponent.Reset();
|
||||
}
|
||||
|
||||
private void DrawChangelogEntries()
|
||||
{
|
||||
_headerAnimationTime += ImGui.GetIO().DeltaTime;
|
||||
using (ImRaii.PushColor(ImGuiCol.ScrollbarBg, new Vector4(0.1f, 0.08f, 0.14f, 0.6f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ScrollbarGrab, new Vector4(0.55f, 0.45f, 0.75f, 0.4f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ScrollbarGrabHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.6f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.ScrollbarGrabActive, new Vector4(0.75f, 0.55f, 0.95f, 0.8f)))
|
||||
{
|
||||
float num = ImGui.GetFrameHeightWithSpacing() + ImGui.GetStyle().ItemSpacing.Y * 2f;
|
||||
using ImRaii.IEndObject endObject = ImRaii.Child("ChangelogScroll", new Vector2(0f, 0f - num), border: false, ImGuiWindowFlags.NoScrollbar);
|
||||
if (!endObject)
|
||||
{
|
||||
return;
|
||||
}
|
||||
using ImRaii.IEndObject endObject2 = ImRaii.Child("ChangelogScrollInner", Vector2.Zero, border: false);
|
||||
if (!endObject2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<ChangelogEntry> changelogs = ChangelogData.Changelogs;
|
||||
ChangelogEntry changelogEntry = changelogs.FirstOrDefault();
|
||||
if (changelogs.Count == 0)
|
||||
{
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 40f);
|
||||
Vector2 vector = ImGui.CalcTextSize("No changelog entries available.");
|
||||
ImGui.SetCursorPosX((ImGui.GetContentRegionAvail().X - vector.X) * 0.5f);
|
||||
ImGui.TextDisabled("No changelog entries available.");
|
||||
return;
|
||||
}
|
||||
ChangelogEntryComponent changelogEntryComponent = new ChangelogEntryComponent(_configuration, _windowOpenCount, _headerAnimationTime);
|
||||
foreach (ChangelogEntry item in changelogs)
|
||||
{
|
||||
changelogEntryComponent.Draw(item, item == changelogEntry, _hasSetInitialState);
|
||||
Vector2 cursorScreenPos = ImGui.GetCursorScreenPos();
|
||||
float num2 = ImGui.GetContentRegionAvail().X * 0.5f;
|
||||
float num3 = (ImGui.GetContentRegionAvail().X - num2) * 0.5f;
|
||||
ImGui.GetWindowDrawList().AddLine(cursorScreenPos + new Vector2(num3, 0f), cursorScreenPos + new Vector2(num3 + num2, 0f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.55f, 0.45f, 0.75f, 0.1f)), 1f);
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 4f);
|
||||
}
|
||||
_hasSetInitialState = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MarkAllAsRead()
|
||||
{
|
||||
string text = ChangelogData.Changelogs.FirstOrDefault()?.Version;
|
||||
if (text != null)
|
||||
{
|
||||
_configuration.LastViewedChangelogVersion = text;
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using LLib.ImGui;
|
||||
using Questionable.Windows.ConfigComponents;
|
||||
|
|
@ -28,7 +31,7 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
|
|||
|
||||
public WindowConfig WindowConfig => _configuration.ConfigWindowConfig;
|
||||
|
||||
public ConfigWindow(IDalamudPluginInterface pluginInterface, GeneralConfigComponent generalConfigComponent, PluginConfigComponent pluginConfigComponent, DutyConfigComponent dutyConfigComponent, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent, StopConditionComponent stopConditionComponent, NotificationConfigComponent notificationConfigComponent, DebugConfigComponent debugConfigComponent, Configuration configuration)
|
||||
public ConfigWindow(IDalamudPluginInterface pluginInterface, GeneralConfigComponent generalConfigComponent, PluginConfigComponent pluginConfigComponent, DutyConfigComponent dutyConfigComponent, SinglePlayerDutyConfigComponent singlePlayerDutyConfigComponent, StopConditionComponent stopConditionComponent, NotificationConfigComponent notificationConfigComponent, DebugConfigComponent debugConfigComponent, Configuration configuration, ChangelogWindow changelogWindow)
|
||||
: base("Config - Questionable###QuestionableConfig", ImGuiWindowFlags.AlwaysAutoResize)
|
||||
{
|
||||
_pluginInterface = pluginInterface;
|
||||
|
|
@ -40,6 +43,21 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
|
|||
_notificationConfigComponent = notificationConfigComponent;
|
||||
_debugConfigComponent = debugConfigComponent;
|
||||
_configuration = configuration;
|
||||
base.TitleBarButtons.Add(new TitleBarButton
|
||||
{
|
||||
Icon = FontAwesomeIcon.FileAlt,
|
||||
IconOffset = new Vector2(1.5f, 1f),
|
||||
Click = delegate
|
||||
{
|
||||
changelogWindow.IsOpenAndUncollapsed = true;
|
||||
},
|
||||
ShowTooltip = delegate
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
ImGui.Text("View Changelog");
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override void DrawContent()
|
||||
|
|
|
|||
84
Questionable/Questionable.Windows/QuestSequenceWindow.cs
Normal file
84
Questionable/Questionable.Windows/QuestSequenceWindow.cs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using LLib.ImGui;
|
||||
using Questionable.Windows.QuestComponents;
|
||||
|
||||
namespace Questionable.Windows;
|
||||
|
||||
internal sealed class QuestSequenceWindow : LWindow, IPersistableWindowConfig
|
||||
{
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly QuestSequenceComponent _questSequenceComponent;
|
||||
|
||||
public WindowConfig WindowConfig => _configuration.QuestSequenceWindowConfig;
|
||||
|
||||
public QuestSequenceWindow(IDalamudPluginInterface pluginInterface, Configuration configuration, QuestSequenceComponent questSequenceComponent)
|
||||
: base("Quest Sequence Viewer###QuestionableQuestSequenceViewer", ImGuiWindowFlags.NoTitleBar)
|
||||
{
|
||||
_pluginInterface = pluginInterface;
|
||||
_configuration = configuration;
|
||||
_questSequenceComponent = questSequenceComponent;
|
||||
base.Size = new Vector2(950f, 700f);
|
||||
base.SizeCondition = ImGuiCond.FirstUseEver;
|
||||
base.SizeConstraints = new WindowSizeConstraints
|
||||
{
|
||||
MinimumSize = new Vector2(750f, 550f),
|
||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
||||
};
|
||||
}
|
||||
|
||||
public void SaveWindowConfig()
|
||||
{
|
||||
_pluginInterface.SavePluginConfig(_configuration);
|
||||
}
|
||||
|
||||
public override void DrawContent()
|
||||
{
|
||||
bool isOpen = base.IsOpen;
|
||||
QuestSequenceComponent.DrawCustomHeader(ref isOpen);
|
||||
base.IsOpen = isOpen;
|
||||
ImGui.Spacing();
|
||||
ImGui.Spacing();
|
||||
using (ImRaii.PushColor(ImGuiCol.Tab, new Vector4(0.15f, 0.13f, 0.2f, 0.7f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.TabHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.TabActive, new Vector4(0.28f, 0.24f, 0.35f, 1f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.TabUnfocused, new Vector4(0.13f, 0.11f, 0.18f, 0.6f)))
|
||||
{
|
||||
using (ImRaii.PushColor(ImGuiCol.TabUnfocusedActive, new Vector4(0.25f, 0.22f, 0.3f, 0.95f)))
|
||||
{
|
||||
using ImRaii.IEndObject endObject = ImRaii.TabBar("QuestSequenceTabs", ImGuiTabBarFlags.None);
|
||||
if (!endObject)
|
||||
{
|
||||
return;
|
||||
}
|
||||
using (ImRaii.IEndObject endObject2 = ImRaii.TabItem("Current Quest"))
|
||||
{
|
||||
if (endObject2)
|
||||
{
|
||||
ImGui.Spacing();
|
||||
_questSequenceComponent.DrawCurrentQuestTab();
|
||||
}
|
||||
}
|
||||
using ImRaii.IEndObject endObject3 = ImRaii.TabItem("Quest Lookup");
|
||||
if (endObject3)
|
||||
{
|
||||
ImGui.Spacing();
|
||||
_questSequenceComponent.DrawQuestLookupTab();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QuestSequenceComponent.DrawWindowBorder();
|
||||
}
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
|
|||
public bool IsMinimized { get; set; }
|
||||
|
||||
public QuestWindow(IDalamudPluginInterface pluginInterface, QuestController questController, IClientState clientState, Configuration configuration, TerritoryData territoryData, ActiveQuestComponent activeQuestComponent, ARealmRebornComponent aRealmRebornComponent, EventInfoComponent eventInfoComponent, CreationUtilsComponent creationUtilsComponent, QuickAccessButtonsComponent quickAccessButtonsComponent, RemainingTasksComponent remainingTasksComponent, IFramework framework, InteractionUiController interactionUiController, ConfigWindow configWindow)
|
||||
: base("Questionable v" + PluginVersion.ToString(2) + "###Questionable", ImGuiWindowFlags.AlwaysAutoResize)
|
||||
: base("Questionable v" + PluginVersion.ToString(3) + "###Questionable", ImGuiWindowFlags.AlwaysAutoResize)
|
||||
{
|
||||
QuestWindow questWindow = this;
|
||||
_pluginInterface = pluginInterface;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue