mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix weird bug where a collection name of certain length fucks up the combo.
This commit is contained in:
parent
071da49ba9
commit
893925f599
2 changed files with 2 additions and 4 deletions
|
|
@ -85,7 +85,7 @@ namespace Penumbra.Mods
|
||||||
public bool AddCollection( string name, Dictionary< string, ModSettings > settings )
|
public bool AddCollection( string name, Dictionary< string, ModSettings > settings )
|
||||||
{
|
{
|
||||||
var nameFixed = name.RemoveInvalidPathSymbols().ToLowerInvariant();
|
var nameFixed = name.RemoveInvalidPathSymbols().ToLowerInvariant();
|
||||||
if( Collections.Values.Any( c => c.Name.RemoveInvalidPathSymbols().ToLowerInvariant() == nameFixed ) )
|
if( nameFixed == string.Empty || Collections.Values.Any( c => c.Name.RemoveInvalidPathSymbols().ToLowerInvariant() == nameFixed ) )
|
||||||
{
|
{
|
||||||
PluginLog.Warning( $"The new collection {name} would lead to the same path as one that already exists." );
|
PluginLog.Warning( $"The new collection {name} would lead to the same path as one that already exists." );
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Penumbra.Interop;
|
|
||||||
using Penumbra.Mod;
|
using Penumbra.Mod;
|
||||||
using Penumbra.Mods;
|
using Penumbra.Mods;
|
||||||
using Penumbra.Util;
|
using Penumbra.Util;
|
||||||
|
|
@ -31,7 +29,7 @@ namespace Penumbra.UI
|
||||||
private void UpdateNames()
|
private void UpdateNames()
|
||||||
{
|
{
|
||||||
_collections = _manager.Collections.Collections.Values.Prepend( ModCollection.Empty ).ToArray();
|
_collections = _manager.Collections.Collections.Values.Prepend( ModCollection.Empty ).ToArray();
|
||||||
_collectionNames = string.Join( "\0", _collections.Skip( 1 ).Select( c => c.Name ) );
|
_collectionNames = string.Join( "\0", _collections.Skip( 1 ).Select( c => c.Name ) ) + '\0';
|
||||||
_collectionNamesWithNone = "None\0" + _collectionNames;
|
_collectionNamesWithNone = "None\0" + _collectionNames;
|
||||||
UpdateIndices();
|
UpdateIndices();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue