Merge branch 'master' into Textures

This commit is contained in:
Ottermandias 2022-09-22 18:52:54 +02:00
commit 4b7315d364
18 changed files with 184 additions and 87 deletions

View file

@ -8,6 +8,7 @@ using OtterGui;
using OtterGui.Classes;
using OtterGui.Raii;
using Penumbra.GameData.ByteString;
using Penumbra.GameData.Util;
using Penumbra.Mods;
namespace Penumbra.UI.Classes;
@ -230,7 +231,7 @@ public partial class ModEditWindow
using var id = ImRaii.PushId( j );
ImGui.TableNextColumn();
var tmp = _fileIdx == i && _pathIdx == j ? _gamePathEdit : gamePath.ToString();
var pos = ImGui.GetCursorPosX() - ImGui.GetFrameHeight();
ImGui.SetNextItemWidth( -1 );
if( ImGui.InputText( string.Empty, ref tmp, Utf8GamePath.MaxGamePathLength ) )
{
@ -251,11 +252,20 @@ public partial class ModEditWindow
_fileIdx = -1;
_pathIdx = -1;
}
else if( _fileIdx == i && _pathIdx == j && ( !Utf8GamePath.FromString( _gamePathEdit, out var path, false )
|| !path.IsEmpty && !path.Equals( gamePath ) && !_editor!.CanAddGamePath( path )) )
{
ImGui.SameLine();
ImGui.SetCursorPosX( pos );
using var font = ImRaii.PushFont( UiBuilder.IconFont );
ImGuiUtil.TextColored( 0xFF0000FF, FontAwesomeIcon.TimesCircle.ToIconString() );
}
}
private void PrintNewGamePath( int i, Mod.Editor.FileRegistry registry, ISubMod subMod )
{
var tmp = _fileIdx == i && _pathIdx == -1 ? _gamePathEdit : string.Empty;
var pos = ImGui.GetCursorPosX() - ImGui.GetFrameHeight();
ImGui.SetNextItemWidth( -1 );
if( ImGui.InputTextWithHint( "##new", "Add New Path...", ref tmp, Utf8GamePath.MaxGamePathLength ) )
{
@ -274,6 +284,14 @@ public partial class ModEditWindow
_fileIdx = -1;
_pathIdx = -1;
}
else if( _fileIdx == i && _pathIdx == -1 && (!Utf8GamePath.FromString( _gamePathEdit, out var path, false )
|| !path.IsEmpty && !_editor!.CanAddGamePath( path )) )
{
ImGui.SameLine();
ImGui.SetCursorPosX( pos );
using var font = ImRaii.PushFont( UiBuilder.IconFont );
ImGuiUtil.TextColored( 0xFF0000FF, FontAwesomeIcon.TimesCircle.ToIconString() );
}
}
private void DrawButtonHeader()

View file

@ -33,11 +33,15 @@ public partial class ConfigWindow
"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( "Files that the game loads super early should now be replaceable correctly via base or interface collection." )
.RegisterEntry( "The 1.0 neck tattoo file should now be replaceable, even in character collections. You can also replace the transparent texture used instead. (This was ugly.)" )
.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( "Adding mods via API/IPC will now cause them to incorporate and then delete TexTools .meta and .rgsp files automatically." )
.RegisterEntry( "Fixed an issue with Actor 201 using Your Character collections in cutscenes." )
.RegisterEntry( "Fixed issues with and improved mod option editing." )
.RegisterEntry( "Fixed some issues with and improved file redirection editing - you are now informed if you can not add a game path (because it is invalid or already in use)." )
.RegisterEntry( "Backend optimizations." )
.RegisterEntry( "Changed metadata change system again.", 1 )
.RegisterEntry( "Improved logging efficiency.", 1 );

View file

@ -97,7 +97,7 @@ public partial class ConfigWindow
ImGui.Dummy( _window._defaultSpace );
}
private void DrawUpdateBibo( Vector2 buttonSize)
private void DrawUpdateBibo( Vector2 buttonSize )
{
if( ImGui.Button( "Update Bibo Material", buttonSize ) )
{
@ -108,7 +108,8 @@ public partial class ConfigWindow
_window.ModEditPopup.UpdateModels();
}
ImGuiUtil.HoverTooltip( "For every model in this mod, change all material names that end in a _b or _c suffix to a _bibo or _bibopube suffix respectively.\n"
ImGuiUtil.HoverTooltip(
"For every model in this mod, change all material names that end in a _b or _c suffix to a _bibo or _bibopube suffix respectively.\n"
+ "Does nothing if the mod does not contain any such models or no model contains such materials.\n"
+ "Use this for outdated mods made for old Bibo bodies.\n"
+ "Go to Advanced Editing for more fine-tuned control over material assignment." );
@ -459,15 +460,16 @@ public partial class ConfigWindow
public static void Draw( ModPanel panel, int groupIdx )
{
using var table = ImRaii.Table( string.Empty, 4, ImGuiTableFlags.SizingFixedFit );
using var table = ImRaii.Table( string.Empty, 5, ImGuiTableFlags.SizingFixedFit );
if( !table )
{
return;
}
ImGui.TableSetupColumn( "idx", ImGuiTableColumnFlags.WidthFixed, 60 * ImGuiHelpers.GlobalScale );
ImGui.TableSetupColumn( "default", ImGuiTableColumnFlags.WidthFixed, ImGui.GetFrameHeight() );
ImGui.TableSetupColumn( "name", ImGuiTableColumnFlags.WidthFixed,
panel._window._inputTextWidth.X - 62 * ImGuiHelpers.GlobalScale );
panel._window._inputTextWidth.X - 68 * ImGuiHelpers.GlobalScale - ImGui.GetFrameHeight() );
ImGui.TableSetupColumn( "delete", ImGuiTableColumnFlags.WidthFixed, panel._window._iconButtonSize.X );
ImGui.TableSetupColumn( "priority", ImGuiTableColumnFlags.WidthFixed, 50 * ImGuiHelpers.GlobalScale );
@ -491,6 +493,31 @@ public partial class ConfigWindow
Source( group, groupIdx, optionIdx );
Target( panel, group, groupIdx, optionIdx );
ImGui.TableNextColumn();
if( group.Type == SelectType.Single )
{
if( ImGui.RadioButton( "##default", group.DefaultSettings == optionIdx ) )
{
Penumbra.ModManager.ChangeModGroupDefaultOption( panel._mod, groupIdx, ( uint )optionIdx );
}
ImGuiUtil.HoverTooltip( $"Set {option.Name} as the default choice for this group." );
}
else
{
var isDefaultOption = ( ( group.DefaultSettings >> optionIdx ) & 1 ) != 0;
if( ImGui.Checkbox( "##default", ref isDefaultOption ) )
{
Penumbra.ModManager.ChangeModGroupDefaultOption( panel._mod, groupIdx, isDefaultOption
? group.DefaultSettings | ( 1u << optionIdx )
: group.DefaultSettings & ~( 1u << optionIdx ) );
}
ImGuiUtil.HoverTooltip( $"{( isDefaultOption ? "Disable" : "Enable" )} {option.Name} per default in this group." );
}
ImGui.TableNextColumn();
if( Input.Text( "##Name", groupIdx, optionIdx, option.Name, out var newOptionName, 256, -1 ) )
{
@ -527,6 +554,7 @@ public partial class ConfigWindow
ImGui.Selectable( $"Option #{group.Count + 1}" );
Target( panel, group, groupIdx, group.Count );
ImGui.TableNextColumn();
ImGui.TableNextColumn();
ImGui.SetNextItemWidth( -1 );
var tmp = _newOptionNameIdx == groupIdx ? _newOptionName : string.Empty;
if( ImGui.InputTextWithHint( "##newOption", "Add new option...", ref tmp, 256 ) )
@ -575,7 +603,7 @@ public partial class ConfigWindow
return;
}
if( _dragDropGroupIdx >= 0 && _dragDropOptionIdx >= 0 )
if( _dragDropGroupIdx >= 0 && _dragDropOptionIdx >= 0 )
{
if( _dragDropGroupIdx == groupIdx )
{
@ -589,7 +617,7 @@ public partial class ConfigWindow
var sourceOption = _dragDropOptionIdx;
var sourceGroup = panel._mod.Groups[ sourceGroupIdx ];
var currentCount = group.Count;
var option = sourceGroup[sourceOption];
var option = sourceGroup[ sourceOption ];
var priority = sourceGroup.OptionPriority( _dragDropGroupIdx );
panel._delayedActions.Enqueue( () =>
{

View file

@ -160,7 +160,7 @@ public partial class ConfigWindow
}
using var id = ImRaii.PushId( groupIdx );
var selectedOption = _emptySetting ? 0 : ( int )_settings.Settings[ groupIdx ];
var selectedOption = _emptySetting ? (int) group.DefaultSettings : ( int )_settings.Settings[ groupIdx ];
ImGui.SetNextItemWidth( _window._inputTextWidth.X * 3 / 4 );
using var combo = ImRaii.Combo( string.Empty, group[ selectedOption ].Name );
if( combo )
@ -199,7 +199,7 @@ public partial class ConfigWindow
}
using var id = ImRaii.PushId( groupIdx );
var flags = _emptySetting ? 0u : _settings.Settings[ groupIdx ];
var flags = _emptySetting ? group.DefaultSettings : _settings.Settings[ groupIdx ];
Widget.BeginFramedGroup( group.Name, group.Description );
for( var idx2 = 0; idx2 < group.Count; ++idx2 )
{

View file

@ -37,8 +37,8 @@ public partial class ConfigWindow
using var style = ImRaii.PushStyle( ImGuiStyleVar.ItemSpacing, Vector2.Zero );
using( var child = ImRaii.Child( "##ModsTabMod", new Vector2( -1, -ImGui.GetFrameHeight() ), true,
ImGuiWindowFlags.HorizontalScrollbar ) )
using( var child = ImRaii.Child( "##ModsTabMod", new Vector2( -1, Penumbra.Config.HideRedrawBar ? 0 : -ImGui.GetFrameHeight() ),
true, ImGuiWindowFlags.HorizontalScrollbar ) )
{
style.Pop();
if( child )
@ -68,6 +68,11 @@ public partial class ConfigWindow
private void DrawRedrawLine()
{
if( Penumbra.Config.HideRedrawBar )
{
return;
}
var frameHeight = new Vector2( 0, ImGui.GetFrameHeight() );
var frameColor = ImGui.GetColorU32( ImGuiCol.FrameBg );
using( var _ = ImRaii.Group() )

View file

@ -59,6 +59,9 @@ public partial class ConfigWindow
Dalamud.PluginInterface.UiBuilder.DisableGposeUiHide = !v;
} );
ImGui.Dummy( _window._defaultSpace );
Checkbox( "Hide Redraw Bar in Mod Panel", "Hides the lower redraw buttons in the mod panel in your Mods tab.",
Penumbra.Config.HideRedrawBar, v => Penumbra.Config.HideRedrawBar = v );
ImGui.Dummy( _window._defaultSpace );
Checkbox( $"Use {AssignedCollections} in Character Window",
"Use the character collection for your characters name or the Your Character collection in your main character window, if it is set.",
Penumbra.Config.UseCharacterCollectionInMainWindow, v => Penumbra.Config.UseCharacterCollectionInMainWindow = v );