Merge branch 'master' into Textures

This commit is contained in:
Ottermandias 2022-09-20 21:11:54 +02:00
commit aeb2e9facd
35 changed files with 581 additions and 166 deletions

View file

@ -18,16 +18,29 @@ public partial class ConfigWindow
Add5_7_0( ret );
Add5_7_1( ret );
Add5_8_0( ret );
return ret;
}
private static void Add5_8_0( Changelog log )
=> log.NextVersion( "Version 0.5.8.0" )
.RegisterEntry( "Added choices what Change Logs are to be displayed. It is recommended to just keep showing all." )
.RegisterEntry( "Added choices what Change Logs are to be displayed. It is recommended to just keep showing all." )
.RegisterEntry( "Added an Interface Collection assignment." )
.RegisterEntry( "All your UI mods will have to be in the interface collection.", 1 )
.RegisterEntry( "Files that are categorized as UI files by the game will only check for redirections in this collection.", 1 )
.RegisterHighlight(
"Migration should have set your currently assigned Base Collection to the Interface Collection, please verify that.", 1 )
.RegisterEntry( "New API / IPC for the Interface Collection added.", 1 )
.RegisterHighlight( "API / IPC consumers should verify whether they need to change resolving to the new collection.", 1 )
.RegisterEntry(
"Added buttons for redrawing self or all as well as a tooltip to describe redraw options and a tutorial step for it." )
.RegisterEntry( "Collection Selectors now display None at the top if available." )
.RegisterEntry( "Fixed an issue with Actor 201 using Your Character collections in cutscenes." )
.RegisterEntry( "Fixed issues with and improved mod option editing." )
.RegisterEntry( "Backend optimizations." );
.RegisterEntry( "Backend optimizations." )
.RegisterEntry( "Changed metadata change system again.", 1 )
.RegisterEntry( "Improved logging efficiency.", 1 );
private static void Add5_7_1( Changelog log )
=> log.NextVersion( "Version 0.5.7.1" )

View file

@ -129,10 +129,19 @@ public partial class ConfigWindow
DrawCollectionSelector( "##default", _window._inputTextWidth.X, CollectionType.Default, true, null );
ImGui.SameLine();
ImGuiUtil.LabeledHelpMarker( DefaultCollection,
$"Mods in the {DefaultCollection} are loaded for anything that is not associated with a character in the game "
$"Mods in the {DefaultCollection} are loaded for anything that is not associated with the user interface or a character in the game,"
+ "as well as any character for whom no more specific conditions from below apply." );
}
private void DrawInterfaceCollectionSelector()
{
using var group = ImRaii.Group();
DrawCollectionSelector( "##interface", _window._inputTextWidth.X, CollectionType.Interface, true, null );
ImGui.SameLine();
ImGuiUtil.LabeledHelpMarker( InterfaceCollection,
$"Mods in the {InterfaceCollection} are loaded for any file that the game categorizes as an UI file. This is mostly icons as well as the tiles that generate the user interface windows themselves." );
}
// We do not check for valid character names.
private void DrawNewSpecialCollection()
{
@ -272,6 +281,8 @@ public partial class ConfigWindow
ImGui.Dummy( _window._defaultSpace );
DrawDefaultCollectionSelector();
OpenTutorial( BasicTutorialSteps.DefaultCollection );
DrawInterfaceCollectionSelector();
OpenTutorial( BasicTutorialSteps.InterfaceCollection );
ImGui.Dummy( _window._defaultSpace );
DrawSpecialAssignments();

View file

@ -100,7 +100,10 @@ public partial class ConfigWindow
using var combo = ImRaii.Combo( label, current?.Name ?? string.Empty );
if( combo )
{
foreach( var collection in Penumbra.CollectionManager.GetEnumeratorWithEmpty().Skip( withEmpty ? 0 : 1 ).OrderBy( c => c.Name ) )
var enumerator = Penumbra.CollectionManager.OrderBy( c => c.Name ).AsEnumerable();
if( withEmpty )
enumerator = enumerator.Prepend( ModCollection.Empty );
foreach( var collection in enumerator )
{
using var id = ImRaii.PushId( collection.Index );
if( ImGui.Selectable( collection.Name, collection == current ) )

View file

@ -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();

View file

@ -11,6 +11,7 @@ using ImGuiNET;
using OtterGui;
using OtterGui.Raii;
using OtterGui.Widgets;
using Penumbra.GameData.Enums;
using Penumbra.UI.Classes;
namespace Penumbra.UI;

View file

@ -10,6 +10,7 @@ public partial class ConfigWindow
{
public const string SelectedCollection = "Selected Collection";
public const string DefaultCollection = "Base Collection";
public const string InterfaceCollection = "Interface Collection";
public const string ActiveCollections = "Active Collections";
public const string AssignedCollections = "Assigned Collections";
public const string GroupAssignment = "Group Assignment";
@ -18,6 +19,13 @@ public partial class ConfigWindow
public const string ConditionalIndividual = "Character";
public const string IndividualAssignments = "Individual Assignments";
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"
+ " - any specific actor name to redraw all actors of that exactly matching name.";
private static void UpdateTutorialStep()
{
var tutorial = Tutorial.CurrentEnabledId( Penumbra.Config.TutorialStep );
@ -49,6 +57,7 @@ public partial class ConfigWindow
Inheritance,
ActiveCollections,
DefaultCollection,
InterfaceCollection,
SpecialCollections1,
SpecialCollections2,
Mods,
@ -56,6 +65,7 @@ public partial class ConfigWindow
AdvancedHelp,
ModFilters,
CollectionSelectors,
Redrawing,
EnablingMods,
Priority,
ModOptions,
@ -100,11 +110,14 @@ public partial class ConfigWindow
.Register( $"Initial Setup, Step 7: {DefaultCollection}",
$"The {DefaultCollection} - which should currently be set to a collection named {ModCollection.DefaultCollection} - is the main one.\n\n"
+ $"As long as no more specific conditions apply to an object in the game, the mods from the {DefaultCollection} will be used.\n\n"
+ "This is also the collection you need to use for all UI mods, music mods or any mods not associated with a character in the game at all." )
+ "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." )
.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"
+ $"{IndividualAssignments} always take precedence before groups.")
+ $"{IndividualAssignments} always take precedence before groups." )
.Register( IndividualAssignments,
"Collections assigned here are used only for individual characters or NPCs that have the specified name.\n\n"
+ "They may also apply to objects 'owned' by those characters, e.g. minions or mounts - see the general settings for options on this.\n\n" )
@ -121,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." )