mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Move redraw buttons to mod panel.
This commit is contained in:
parent
5538c5704d
commit
358064cd5f
4 changed files with 78 additions and 43 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit 41581a5d035d46a89819aaefaa8d01c815788eee
|
||||
Subproject commit 28c4d8564296484b3d0fc0d2ea275cded8b1daa2
|
||||
|
|
@ -7,6 +7,8 @@ using Penumbra.UI.Classes;
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
|
|
@ -33,11 +35,22 @@ public partial class ConfigWindow
|
|||
using var group = ImRaii.Group();
|
||||
DrawHeaderLine();
|
||||
|
||||
using var child = ImRaii.Child( "##ModsTabMod", -Vector2.One, true, ImGuiWindowFlags.HorizontalScrollbar );
|
||||
if( child )
|
||||
using var style = ImRaii.PushStyle( ImGuiStyleVar.ItemSpacing, Vector2.Zero );
|
||||
|
||||
using( var child = ImRaii.Child( "##ModsTabMod", new Vector2( -1, -ImGui.GetFrameHeight() ), true,
|
||||
ImGuiWindowFlags.HorizontalScrollbar ) )
|
||||
{
|
||||
_modPanel.Draw( _selector );
|
||||
style.Pop();
|
||||
if( child )
|
||||
{
|
||||
_modPanel.Draw( _selector );
|
||||
}
|
||||
|
||||
style.Push( ImGuiStyleVar.ItemSpacing, Vector2.Zero );
|
||||
}
|
||||
|
||||
style.Push( ImGuiStyleVar.FrameRounding, 0 );
|
||||
DrawRedrawLine();
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
|
|
@ -48,18 +61,69 @@ public partial class ConfigWindow
|
|||
+ $"{_selector.SortMode.Name} Sort Mode\n"
|
||||
+ $"{_selector.SelectedLeaf?.Name ?? "NULL"} Selected Leaf\n"
|
||||
+ $"{_selector.Selected?.Name ?? "NULL"} Selected Mod\n"
|
||||
+ $"{string.Join( ", ", Penumbra.CollectionManager.Current.Inheritance.Select(c => c.AnonymizedName) )} Inheritances\n"
|
||||
+ $"{string.Join( ", ", Penumbra.CollectionManager.Current.Inheritance.Select( c => c.AnonymizedName ) )} Inheritances\n"
|
||||
+ $"{_selector.SelectedSettingCollection.AnonymizedName} Collection\n" );
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawRedrawLine()
|
||||
{
|
||||
var frameHeight = new Vector2( 0, ImGui.GetFrameHeight() );
|
||||
var frameColor = ImGui.GetColorU32( ImGuiCol.FrameBg );
|
||||
using( var _ = ImRaii.Group() )
|
||||
{
|
||||
using( var font = ImRaii.PushFont( UiBuilder.IconFont ) )
|
||||
{
|
||||
ImGuiUtil.DrawTextButton( FontAwesomeIcon.InfoCircle.ToIconString(), frameHeight, frameColor );
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
||||
ImGuiUtil.DrawTextButton( "Redraw: ", frameHeight, frameColor );
|
||||
}
|
||||
|
||||
var hovered = ImGui.IsItemHovered();
|
||||
OpenTutorial( BasicTutorialSteps.Redrawing );
|
||||
if( hovered )
|
||||
{
|
||||
ImGui.SetTooltip( $"The supported modifiers for '/penumbra redraw' are:\n{SupportedRedrawModifiers}" );
|
||||
}
|
||||
|
||||
void DrawButton( Vector2 size, string label, string lower )
|
||||
{
|
||||
if( ImGui.Button( label, size ) )
|
||||
{
|
||||
if( lower.Length > 0 )
|
||||
{
|
||||
_penumbra.ObjectReloader.RedrawObject( lower, RedrawType.Redraw );
|
||||
}
|
||||
else
|
||||
{
|
||||
_penumbra.ObjectReloader.RedrawAll( RedrawType.Redraw );
|
||||
}
|
||||
}
|
||||
|
||||
ImGuiUtil.HoverTooltip( lower.Length > 0 ? $"Execute '/penumbra redraw {lower}'." : $"Execute '/penumbra redraw'." );
|
||||
}
|
||||
|
||||
using var disabled = ImRaii.Disabled( Dalamud.ClientState.LocalPlayer == null );
|
||||
ImGui.SameLine();
|
||||
var buttonWidth = frameHeight with { X = ImGui.GetContentRegionAvail().X / 4 };
|
||||
DrawButton( buttonWidth, "All", string.Empty );
|
||||
ImGui.SameLine();
|
||||
DrawButton( buttonWidth, "Self", "self" );
|
||||
ImGui.SameLine();
|
||||
DrawButton( buttonWidth, "Target", "target" );
|
||||
ImGui.SameLine();
|
||||
DrawButton( frameHeight with { X = ImGui.GetContentRegionAvail().X - 1 }, "Focus", "focus" );
|
||||
}
|
||||
|
||||
// Draw the header line that can quick switch between collections.
|
||||
private void DrawHeaderLine()
|
||||
{
|
||||
using var style = ImRaii.PushStyle( ImGuiStyleVar.FrameRounding, 0 ).Push( ImGuiStyleVar.ItemSpacing, Vector2.Zero );
|
||||
var buttonSize = new Vector2( ImGui.GetContentRegionAvail().X / 8f, 0 );
|
||||
|
||||
using( var group = ImRaii.Group() )
|
||||
using( var _ = ImRaii.Group() )
|
||||
{
|
||||
DrawDefaultCollectionButton( 3 * buttonSize );
|
||||
ImGui.SameLine();
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ public partial class ConfigWindow
|
|||
: _window.Flags & ~( ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize );
|
||||
} );
|
||||
|
||||
DrawRedrawButton();
|
||||
|
||||
ImGui.NewLine();
|
||||
DrawRootFolder();
|
||||
DrawRediscoverButton();
|
||||
|
|
@ -338,34 +336,6 @@ public partial class ConfigWindow
|
|||
+ "Not directly affiliated and potentially, but not usually out of date." );
|
||||
}
|
||||
|
||||
private void DrawRedrawButton()
|
||||
{
|
||||
using( var group = ImRaii.Group() )
|
||||
{
|
||||
using var disabled = ImRaii.Disabled( Dalamud.ClientState.LocalPlayer == null );
|
||||
|
||||
if( ImGui.Button( "Redraw Self" ) )
|
||||
{
|
||||
_window._penumbra.ObjectReloader.RedrawObject( "self", RedrawType.Redraw );
|
||||
}
|
||||
|
||||
ImGuiUtil.HoverTooltip( "Executes '/penumbra redraw self'." );
|
||||
|
||||
ImGui.SameLine();
|
||||
if( ImGui.Button( "Redraw All" ) )
|
||||
{
|
||||
_window._penumbra.ObjectReloader.RedrawAll( RedrawType.Redraw );
|
||||
}
|
||||
ImGuiUtil.HoverTooltip( "Executes '/penumbra redraw'." );
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
ImGuiComponents.HelpMarker( $"The supported modifiers for '/penumbra redraw' are:\n{SupportedRedrawModifiers}" );
|
||||
}
|
||||
|
||||
OpenTutorial( BasicTutorialSteps.Redrawing );
|
||||
}
|
||||
|
||||
private void DrawSupportButtons()
|
||||
{
|
||||
var width = ImGui.CalcTextSize( SupportInfoButtonText ).X + ImGui.GetStyle().FramePadding.X * 2;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ public partial class ConfigWindow
|
|||
public const string ConditionalIndividual = "Character";
|
||||
public const string IndividualAssignments = "Individual Assignments";
|
||||
|
||||
public const string SupportedRedrawModifiers = " - 'self' or '<me>': your own character\n"
|
||||
public const string SupportedRedrawModifiers = " - nothing, to redraw all characters\n"
|
||||
+ " - 'self' or '<me>': your own character\n"
|
||||
+ " - 'target' or '<t>': your target\n"
|
||||
+ " - 'focus' or '<f>: your focus target\n"
|
||||
+ " - 'mouseover' or '<mo>': the actor you are currently hovering over\n"
|
||||
|
|
@ -50,7 +51,6 @@ public partial class ConfigWindow
|
|||
EnableMods,
|
||||
AdvancedSettings,
|
||||
GeneralSettings,
|
||||
Redrawing,
|
||||
Collections,
|
||||
EditingCollections,
|
||||
CurrentCollection,
|
||||
|
|
@ -65,6 +65,7 @@ public partial class ConfigWindow
|
|||
AdvancedHelp,
|
||||
ModFilters,
|
||||
CollectionSelectors,
|
||||
Redrawing,
|
||||
EnablingMods,
|
||||
Priority,
|
||||
ModOptions,
|
||||
|
|
@ -91,10 +92,6 @@ public partial class ConfigWindow
|
|||
+ "If you need to do any editing of your mods, you will have to turn it on later." )
|
||||
.Register( "General Settings", "Look through all of these settings before starting, they might help you a lot!\n\n"
|
||||
+ "If you do not know what some of these do yet, return to this later!" )
|
||||
.Register( "Redrawing",
|
||||
"Whenever you change your mod configuration, changes do not immediately take effect. You will need to force the game to reload the relevant files (or if this is not possible, restart the game).\n\n"
|
||||
+ "For this, Penumbra has these buttons as well as the '/penumbra redraw' command, which redraws all actors at once. You can also use several modifiers described in the help marker instead.\n\n"
|
||||
+ "Feel free to use these slash commands (e.g. '/penumbra redraw self') as a macro, too." )
|
||||
.Register( "Initial Setup, Step 3: Collections", "Collections are lists of settings for your installed mods.\n\n"
|
||||
+ "This is our next stop!\n\n"
|
||||
+ "Go here after setting up your root folder to continue the tutorial!" )
|
||||
|
|
@ -116,7 +113,7 @@ public partial class ConfigWindow
|
|||
+ "This is also the collection you need to use for all mods that are not directly associated with any character in the game or the user interface, like music mods." )
|
||||
.Register( "Interface Collection",
|
||||
$"The {InterfaceCollection} - which should currently be set to None - is used exclusively for files categorized as 'UI' files by the game, which is mostly icons and the backgrounds for different UI windows etc.\n\n"
|
||||
+ $"If you have mods manipulating your interface, they should be enabled in the collection assigned to this slot. You can of course assign the same collection you assigned to the {DefaultCollection} to the {InterfaceCollection}, too, and enable all your UI mods in this one.")
|
||||
+ $"If you have mods manipulating your interface, they should be enabled in the collection assigned to this slot. You can of course assign the same collection you assigned to the {DefaultCollection} to the {InterfaceCollection}, too, and enable all your UI mods in this one." )
|
||||
.Register( GroupAssignment + 's',
|
||||
"Collections assigned here are used for groups of characters for which specific conditions are met.\n\n"
|
||||
+ "The more specific the condition, the higher its priority (i.e. Your Character > Player Characters > Race).\n\n"
|
||||
|
|
@ -137,6 +134,10 @@ public partial class ConfigWindow
|
|||
+ $"The first button sets it to your {DefaultCollection} (if any).\n\n"
|
||||
+ "The second button sets it to the collection the settings of the currently selected mod are inherited from (if any).\n\n"
|
||||
+ "The third is a regular collection selector to let you choose among all your collections." )
|
||||
.Register( "Redrawing",
|
||||
"Whenever you change your mod configuration, changes do not immediately take effect. You will need to force the game to reload the relevant files (or if this is not possible, restart the game).\n\n"
|
||||
+ "For this, Penumbra has these buttons as well as the '/penumbra redraw' command, which redraws all actors at once. You can also use several modifiers described in the help marker instead.\n\n"
|
||||
+ "Feel free to use these slash commands (e.g. '/penumbra redraw self') as a macro, too." )
|
||||
.Register( "Initial Setup, Step 11: Enabling Mods",
|
||||
"Enable a mod here. Disabled mods will not apply to anything in the current collection.\n\n"
|
||||
+ "Mods can be enabled or disabled in a collection, or they can be unconfigured, in which case they will use Inheritance." )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue