Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: some ui fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 16, 2024
1 parent 5a9a6e8 commit 5e7c3b2
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 69 deletions.
4 changes: 0 additions & 4 deletions ActionTimelineEx/ActionTimelineEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
</Reference>
</ItemGroup>

<ItemGroup>
<Folder Include="Localization\" />
</ItemGroup>

<ItemGroup>
<Using Include="Newtonsoft.Json" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions ActionTimelineEx/Configurations/ActionSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void UpdateItem()
var item = Svc.Data.GetExcelSheet<Lumina.Excel.GeneratedSheets.Item>()?.GetRow(ActionId);
if (item == null) return;

IconId = item.Icon;
IconId = ActionId == 0 ? 0u : item.Icon;
DisplayName = item.Name;
}

Expand All @@ -120,7 +120,7 @@ void UpdateAction()

IsGCD = action.CooldownGroup == 58 || action.AdditionalCooldownGroup == 58;

IconId = GetActionIcon(action);
IconId = ActionId == 0 ? 0u : GetActionIcon(action);
DisplayName = $"{action.Name} ({(IsGCD ? "GCD" : "Ability")})";
}

Expand Down
74 changes: 37 additions & 37 deletions ActionTimelineEx/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,37 @@
"XIVConfigUI.LocalString.Searching": "Search... ",
"ActionTimelineEx.Windows.RotationHelperItem": "Rotation Helper",
"ActionTimelineEx.Windows.ChangeLogItem": "ChangeLog",
"ActionTimelineEx.Description": "Configurable timeline display of all the actions you use.",
"XIVConfigUI.LocalString.SourceCode": "Click to see the source code!",
"XIVConfigUI.LocalString.Localization": "Click to open the crowdin for modifying localization!",
"ActionTimelineEx.Configurations.UiString.AddOne": "Add One Timeline",
"ActionTimelineEx.Configurations.UiString.Setting": "Setting",
"ActionTimelineEx.Configurations.UiString.ShowedStatuses": "Showed Statuses",
"ActionTimelineEx.Configurations.UiString.NotStatues": "Don't record these statuses",
"ActionTimelineEx.Configurations.UiString.AddOneRotation": "Add One Rotation",
"ActionTimelineEx.Configurations.UiString.RemoveDesc": "Remove this Item:",
"ActionTimelineEx.Configurations.SettingsName.RotationChoice": "Rotation Choice",
"XIVConfigUI.LocalString.ResetToDefault": "Reset to Default Value.",
"ActionTimelineEx.Configurations.UiString.RotationSetting": "Rotation Setting",
"ActionTimelineEx.Configurations.UiString.Rotation": "Rotation",
"ActionTimelineEx.Configurations.UiString.RotationReset": "Reset Count",
"ActionTimelineEx.Configurations.UiString.AddOneRotation": "Add One Rotation",
"XIVConfigUI.LocalString.CopyToClipboard": "Copy to Clipboard",
"XIVConfigUI.LocalString.FromClipboard": "From Clipboard",
"ActionTimelineEx.Configurations.SettingsName.RecordRotation": "Record Rotation",
"XIVConfigUI.LocalString.ResetToDefault": "Reset to Default Value.",
"ActionTimelineEx.Configurations.RotationSettingName.Name": "Rotation Name",
"ActionTimelineEx.Configurations.RotationSettingName.Actions": "Actions",
"ActionTimelineEx.Configurations.RotationSettingName.IgnoreActions": "Ignore Actions",
"XIVConfigUI.LocalString.List": "List",
"ActionTimelineEx.Configurations.ActionSetting": "ActionSetting",
"XIVConfigUI.LocalString.Remove": "Remove",
"XIVConfigUI.LocalString.MoveUp": "Move Up",
"XIVConfigUI.LocalString.MoveDown": "Move Down",
"ActionTimelineEx.Configurations.ActionSettingDescription": "Infuriate (Ability)",
"ActionTimelineEx.Configurations.ActionSettingName.Id": "Id",
"ActionTimelineEx.Configurations.ActionSettingName.Type": "Type",
"ActionTimelineEx.Configurations.ActionSettingType.Action": "Action",
"ActionTimelineEx.Configurations.ActionSettingType.Item": "Item",
"ActionTimelineEx.Configurations.ActionSettingName.IsLast": "Is the Last Ability during GCD",
"ActionTimelineEx.Configurations.GroupItem.General": "General",
"ActionTimelineEx.Configurations.GroupItem.Icons": "Icons",
"ActionTimelineEx.Configurations.GroupItem.Bar": "Bar",
"ActionTimelineEx.Configurations.GroupItem.Grid": "Grid",
"ActionTimelineEx.Configurations.GroupItem.GcdClipping": "GCD Clipping",
"ActionTimelineEx.Configurations.DrawingSettingsName.Name": "The timeline Name",
"ActionTimelineEx.Configurations.DrawingSettingsName.Enable": "Enable",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsRotation": "Is Rotation",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsHorizonal": "Is Horizonal",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsReverse": "Is Reverse",
"ActionTimelineEx.Configurations.DrawingSettingsName.Locked": "Locked",
"ActionTimelineEx.Configurations.DrawingSettingsName.LockedBackgroundColor": "Locked Background Color",
"ActionTimelineEx.Configurations.DrawingSettingsName.UnlockedBackgroundColor": "Unlocked Background Color",
"ActionTimelineEx.Configurations.DrawingSettingsName.SizePerSecond": "Size per second",
"ActionTimelineEx.Configurations.DrawingSettingsName.TimeOffsetSetting": "Offset Time",
"ActionTimelineEx.Configurations.DrawingSettingsName.CenterOffset": "Center Offset",
"ActionTimelineEx.Configurations.SettingsName.Record": "Record Data",
"ActionTimelineEx.Configurations.SettingsName.ShowTimelineOnlyInDuty": "Show Only In Duty",
"ActionTimelineEx.Configurations.SettingsName.ShowTimelineOnlyInCombat": "Show Only In Combat",
Expand All @@ -52,20 +54,8 @@
"ActionTimelineEx.Configurations.SettingsName.IconSpacing": "Icon Spacing",
"ActionTimelineEx.Configurations.SettingsName.ShowWrongClick": "Show the wrong clicking",
"ActionTimelineEx.Configurations.SettingsName.VerticalDraw": "Draw the rotation Vertically",
"ActionTimelineEx.Configurations.SettingsName.RotationChoice": "Rotation Choice",
"ActionTimelineEx.Configurations.DrawingSettingsName.Name": "The timeline Name",
"ActionTimelineEx.Configurations.DrawingSettingsName.Enable": "Enable",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsRotation": "Is Rotation",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsHorizonal": "Is Horizonal",
"ActionTimelineEx.Configurations.DrawingSettingsName.IsReverse": "Is Reverse",
"ActionTimelineEx.Configurations.DrawingSettingsName.Locked": "Locked",
"ActionTimelineEx.Configurations.DrawingSettingsName.LockedBackgroundColor": "Locked Background Color",
"ActionTimelineEx.Configurations.DrawingSettingsName.UnlockedBackgroundColor": "Unlocked Background Color",
"ActionTimelineEx.Configurations.DrawingSettingsName.SizePerSecond": "Size per second",
"ActionTimelineEx.Configurations.DrawingSettingsDescription.SizePerSecond": "This is the width of every second drawn on the window.",
"ActionTimelineEx.Configurations.DrawingSettingsName.TimeOffsetSetting": "Offset Time",
"ActionTimelineEx.Configurations.DrawingSettingsDescription.TimeOffsetSetting": "If your Is Rotation is on, this means the Offset time of rotation, or this is the advanced time about action using.",
"ActionTimelineEx.Configurations.DrawingSettingsName.CenterOffset": "Center Offset",
"ActionTimelineEx.Configurations.DrawingSettingsName.GCDIconSize": "GCD Icon Size",
"ActionTimelineEx.Configurations.DrawingSettingsName.ShowOGCD": "Show Off GCD",
"ActionTimelineEx.Configurations.DrawingSettingsName.OGCDIconSize": "Off GCD Icon Size",
Expand Down Expand Up @@ -115,24 +105,34 @@
"ActionTimelineEx.Configurations.DrawingSettingsDescription.GCDClippingMaxTime": "Any GCD clip longer than this will be capped",
"ActionTimelineEx.Configurations.DrawingSettingsName.GCDClippingColor": "Color",
"ActionTimelineEx.Configurations.DrawingSettingsName.GCDClippingTextColor": "Text Color",
"ActionTimelineEx.Configurations.GroupItem.General": "General",
"ActionTimelineEx.Configurations.GroupItem.Icons": "Icons",
"ActionTimelineEx.Configurations.GroupItem.Bar": "Bar",
"ActionTimelineEx.Configurations.GroupItem.Grid": "Grid",
"ActionTimelineEx.Configurations.GroupItem.GcdClipping": "GCD Clipping",
"ActionTimelineEx.Configurations.UiString.Setting": "Setting",
"ActionTimelineEx.Configurations.UiString.ShowedStatuses": "Showed Statuses",
"ActionTimelineEx.Configurations.UiString.NotStatues": "Don't record these statuses",
"ActionTimelineEx.Configurations.UiString.Wait": "Please wait for a second.",
"ActionTimelineEx.Configurations.UiString.Confirm": "Are you sure to remove this timeline?",
"ActionTimelineEx.Configurations.UiString.Remove": "Click to remove this timeline.",
"ActionTimelineEx.Configurations.UiString.RemoveDesc": "Remove this Item:",
"ActionTimelineEx.Configurations.UiString.AddOne": "Add One Timeline",
"XIVConfigUI.LocalString.Search_Result": "Search Result",
"XIVConfigUI.LocalString.Search": "Search",
"XIVConfigUI.LocalString.ExecuteCommand": "Execute \"{0}\"",
"XIVConfigUI.LocalString.CopyCommand": "Copy \"{0}\"",
"XIVConfigUI.LocalString.Localization": "Click to open the crowdin for modifying localization!",
"XIVConfigUI.LocalString.SourceCode": "Click to see the source code!",
"XIVConfigUI.LocalString.Remove": "Remove",
"XIVConfigUI.LocalString.MoveUp": "Move Up",
"XIVConfigUI.LocalString.MoveDown": "Move Down",
"XIVConfigUI.LocalString.Nothing": "No items in Combo",
"XIVConfigUI.LocalString.None": "None",
"XIVConfigUI.Attributes.ConfigUnitType.Seconds": "Time Unit, in seconds.",
"XIVConfigUI.Attributes.ConfigUnitType.Degree": "Angle Unit, in degrees.",
"XIVConfigUI.Attributes.ConfigUnitType.Yalms": "Distance Unit, in yalms.",
"XIVConfigUI.Attributes.ConfigUnitType.Percent": "Ratio Unit, as percentage.",
"XIVConfigUI.Attributes.ConfigUnitType.Pixels": "Display Unit, in pixels."
"XIVConfigUI.Attributes.ConfigUnitType.Pixels": "Display Unit, in pixels.",
"ActionTimelineEx.Description": "Configurable timeline display of all the actions you use.",
"ActionTimelineEx.Configurations.ActionSettingName.Id": "Id",
"ActionTimelineEx.Configurations.ActionSettingName.Type": "Type",
"ActionTimelineEx.Configurations.ActionSettingType.Action": "Action",
"ActionTimelineEx.Configurations.ActionSettingType.Item": "Item",
"ActionTimelineEx.Configurations.ActionSettingName.IsLast": "Is the Last Ability during GCD",
"ActionTimelineEx.Configurations.ActionSettingDescription": "Circle of Scorn (Ability)"
}
5 changes: 0 additions & 5 deletions ActionTimelineEx/Windows/ChangeLogItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
using Dalamud.Interface.Utility.Raii;
using Dalamud.Utility;
using ImGuiNET;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using XIVConfigUI;

namespace ActionTimelineEx.Windows;
Expand Down
24 changes: 16 additions & 8 deletions ActionTimelineEx/Windows/RotationHelperWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ActionTimelineEx.Helpers;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using System.Numerics;
using XIVConfigUI;
Expand All @@ -19,22 +20,29 @@ public static void Draw()
}

Vector4 bgColor = setting.RotationLocked ? setting.RotationLockedBackgroundColor : setting.RotationUnlockedBackgroundColor;
ImGui.PushStyleColor(ImGuiCol.WindowBg, bgColor);
using var bgColorPush = ImRaii.PushColor(ImGuiCol.WindowBg, bgColor);

ImGui.SetNextWindowSize(new Vector2(560, 100) * ImGuiHelpers.GlobalScale, ImGuiCond.FirstUseEver);
ImGui.SetNextWindowPos(new Vector2(200, 200) * ImGuiHelpers.GlobalScale, ImGuiCond.FirstUseEver);

ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(0, 0));
ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0);

if (ImGui.Begin("Rotation Helper Window", flag))
{
DrawContent();
ImGui.End();
var padding = ImGui.GetStyle().WindowPadding;
var border = ImGui.GetStyle().WindowBorderSize;
ImGui.GetStyle().WindowPadding = default;
ImGui.GetStyle().WindowBorderSize = 0;
try
{
DrawContent();
}
finally
{
ImGui.End();
ImGui.GetStyle().WindowPadding = padding;
ImGui.GetStyle().WindowBorderSize = border;
}
}

ImGui.PopStyleVar(2);
ImGui.PopStyleColor();
}

private static void DrawContent()
Expand Down
3 changes: 1 addition & 2 deletions ActionTimelineEx/Windows/SettingsWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ActionTimelineEx;
using ActionTimelineEx.Configurations;
using ActionTimelineEx.Configurations;
using ActionTimelineEx.Helpers;
using ActionTimelineEx.Timeline;
using Dalamud.Interface;
Expand Down
25 changes: 16 additions & 9 deletions ActionTimelineEx/Windows/TimelineWindow.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ActionTimelineEx.Configurations;
using ActionTimelineEx.Timeline;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;
using System.Numerics;

Expand All @@ -25,22 +26,28 @@ public static void Draw(DrawingSettings setting, int index)
}

Vector4 bgColor = setting.Locked ? setting.LockedBackgroundColor : setting.UnlockedBackgroundColor;
ImGui.PushStyleColor(ImGuiCol.WindowBg, bgColor);
using var bgColorPush = ImRaii.PushColor(ImGuiCol.WindowBg, bgColor);

ImGui.SetNextWindowSize(new Vector2(560, 100) * ImGuiHelpers.GlobalScale, ImGuiCond.FirstUseEver);
ImGui.SetNextWindowPos(new Vector2(200, 200) * ImGuiHelpers.GlobalScale, ImGuiCond.FirstUseEver);

ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(0, 0));
ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0);

if (ImGui.Begin($"Timeline: {index}", flag))
{
DrawContent(setting);
ImGui.End();
var padding = ImGui.GetStyle().WindowPadding;
var border = ImGui.GetStyle().WindowBorderSize;
ImGui.GetStyle().WindowPadding = default;
ImGui.GetStyle().WindowBorderSize = 0;
try
{
DrawContent(setting);
}
finally
{
ImGui.End();
ImGui.GetStyle().WindowPadding = padding;
ImGui.GetStyle().WindowBorderSize = border;
}
}

ImGui.PopStyleVar(2);
ImGui.PopStyleColor();
}

private static void DrawContent(DrawingSettings setting)
Expand Down
2 changes: 1 addition & 1 deletion XIVConfigUI

0 comments on commit 5e7c3b2

Please sign in to comment.