@@ -62,8 +62,7 @@ public ModFileSystemSelector(IKeyState keyState, CommunicatorService communicato
62
62
SubscribeRightClickFolder ( f => SetQuickMove ( f , 1 , _config . QuickMoveFolder2 , s => { _config . QuickMoveFolder2 = s ; _config . Save ( ) ; } ) , 120 ) ;
63
63
SubscribeRightClickFolder ( f => SetQuickMove ( f , 2 , _config . QuickMoveFolder3 , s => { _config . QuickMoveFolder3 = s ; _config . Save ( ) ; } ) , 130 ) ;
64
64
SubscribeRightClickLeaf ( ToggleLeafFavorite ) ;
65
- SubscribeRightClickLeaf ( RemoveTemporarySettings ) ;
66
- SubscribeRightClickLeaf ( DisableTemporarily ) ;
65
+ SubscribeRightClickLeaf ( DrawTemporaryOptions ) ;
67
66
SubscribeRightClickLeaf ( l => QuickMove ( l , _config . QuickMoveFolder1 , _config . QuickMoveFolder2 , _config . QuickMoveFolder3 ) ) ;
68
67
SubscribeRightClickMain ( ClearDefaultImportFolder , 100 ) ;
69
68
SubscribeRightClickMain ( ( ) => ClearQuickMove ( 0 , _config . QuickMoveFolder1 , ( ) => { _config . QuickMoveFolder1 = string . Empty ; _config . Save ( ) ; } ) , 110 ) ;
@@ -135,7 +134,7 @@ public void SetRenameSearchPath(RenameField value)
135
134
{
136
135
_dragDrop . CreateImGuiSource ( "ModDragDrop" , m => m . Extensions . Any ( e => ValidModExtensions . Contains ( e . ToLowerInvariant ( ) ) ) , m =>
137
136
{
138
- ImGui . TextUnformatted ( $ "Dragging mods for import:\n \t { string . Join ( "\n \t " , m . Files . Select ( Path . GetFileName ) ) } ") ;
137
+ ImUtf8 . Text ( $ "Dragging mods for import:\n \t { string . Join ( "\n \t " , m . Files . Select ( Path . GetFileName ) ) } ") ;
139
138
return true ;
140
139
} ) ;
141
140
base . Draw ( width ) ;
@@ -198,8 +197,8 @@ protected override void DrawLeafName(FileSystem<Mod>.Leaf leaf, in ModState stat
198
197
var flags = selected ? ImGuiTreeNodeFlags . Selected | LeafFlags : LeafFlags ;
199
198
using var c = ImRaii . PushColor ( ImGuiCol . Text , state . Color . Tinted ( state . Tint ) )
200
199
. Push ( ImGuiCol . HeaderHovered , 0x4000FFFF , leaf . Value . Favorite ) ;
201
- using var id = ImRaii . PushId ( leaf . Value . Index ) ;
202
- ImRaii . TreeNode ( leaf . Value . Name , flags ) . Dispose ( ) ;
200
+ using var id = ImUtf8 . PushId ( leaf . Value . Index ) ;
201
+ ImUtf8 . TreeNode ( leaf . Value . Name . Text , flags ) . Dispose ( ) ;
203
202
if ( ImGui . IsItemClicked ( ImGuiMouseButton . Middle ) )
204
203
{
205
204
_modManager . SetKnown ( leaf . Value ) ;
@@ -244,48 +243,58 @@ private void EnableDescendants(ModFileSystem.Folder folder)
244
243
245
244
private void DisableDescendants ( ModFileSystem . Folder folder )
246
245
{
247
- if ( ImGui . MenuItem ( "Disable Descendants" ) )
246
+ if ( ImUtf8 . MenuItem ( "Disable Descendants"u8 ) )
248
247
SetDescendants ( folder , false ) ;
249
248
}
250
249
251
250
private void InheritDescendants ( ModFileSystem . Folder folder )
252
251
{
253
- if ( ImGui . MenuItem ( "Inherit Descendants" ) )
252
+ if ( ImUtf8 . MenuItem ( "Inherit Descendants"u8 ) )
254
253
SetDescendants ( folder , true , true ) ;
255
254
}
256
255
257
256
private void OwnDescendants ( ModFileSystem . Folder folder )
258
257
{
259
- if ( ImGui . MenuItem ( "Stop Inheriting Descendants" ) )
258
+ if ( ImUtf8 . MenuItem ( "Stop Inheriting Descendants"u8 ) )
260
259
SetDescendants ( folder , false , true ) ;
261
260
}
262
261
263
262
private void ToggleLeafFavorite ( FileSystem < Mod > . Leaf mod )
264
263
{
265
- if ( ImGui . MenuItem ( mod . Value . Favorite ? "Remove Favorite" : "Mark as Favorite" ) )
264
+ if ( ImUtf8 . MenuItem ( mod . Value . Favorite ? "Remove Favorite"u8 : "Mark as Favorite"u8 ) )
266
265
_modManager . DataEditor . ChangeModFavorite ( mod . Value , ! mod . Value . Favorite ) ;
267
266
}
268
267
269
- private void RemoveTemporarySettings ( FileSystem < Mod > . Leaf mod )
268
+ private void DrawTemporaryOptions ( FileSystem < Mod > . Leaf mod )
270
269
{
271
- var tempSettings = _collectionManager . Active . Current . GetTempSettings ( mod . Value . Index ) ;
272
- if ( tempSettings is { Lock : <= 0 } )
273
- if ( ImUtf8 . MenuItem ( "Remove Temporary Settings" ) )
274
- _collectionManager . Editor . SetTemporarySettings ( _collectionManager . Active . Current , mod . Value , null ) ;
275
- }
270
+ const string source = "yourself" ;
271
+ var tempSettings = _collectionManager . Active . Current . GetTempSettings ( mod . Value . Index ) ;
272
+ if ( tempSettings is { Lock : > 0 } )
273
+ return ;
276
274
277
- private void DisableTemporarily ( FileSystem < Mod > . Leaf mod )
278
- {
279
- var tempSettings = _collectionManager . Active . Current . GetTempSettings ( mod . Value . Index ) ;
280
- if ( tempSettings is not { Lock : > 0 } )
281
- if ( ImUtf8 . MenuItem ( "Disable Temporarily" ) )
282
- _collectionManager . Editor . SetTemporarySettings ( _collectionManager . Active . Current , mod . Value ,
283
- TemporaryModSettings . DefaultSettings ( mod . Value , "User Context-Menu" ) ) ;
275
+ if ( tempSettings is { Lock : <= 0 } && ImUtf8 . MenuItem ( "Remove Temporary Settings"u8 ) )
276
+ _collectionManager . Editor . SetTemporarySettings ( _collectionManager . Active . Current , mod . Value , null ) ;
277
+ var actual = _collectionManager . Active . Current . GetActualSettings ( mod . Value . Index ) . Settings ;
278
+ if ( actual ? . Enabled is true && ImUtf8 . MenuItem ( "Disable Temporarily"u8 ) )
279
+ _collectionManager . Editor . SetTemporarySettings ( _collectionManager . Active . Current , mod . Value ,
280
+ new TemporaryModSettings ( actual , source ) { Enabled = false } ) ;
281
+
282
+ if ( actual is not { Enabled : true } && ImUtf8 . MenuItem ( "Enable Temporarily"u8 ) )
283
+ {
284
+ var newSettings = actual is null
285
+ ? TemporaryModSettings . DefaultSettings ( mod . Value , source , true )
286
+ : new TemporaryModSettings ( actual , source ) { Enabled = true } ;
287
+ _collectionManager . Editor . SetTemporarySettings ( _collectionManager . Active . Current , mod . Value , newSettings ) ;
288
+ }
289
+
290
+ if ( tempSettings is null && ImUtf8 . MenuItem ( "Turn Temporary"u8 ) )
291
+ _collectionManager . Editor . SetTemporarySettings ( _collectionManager . Active . Current , mod . Value ,
292
+ new TemporaryModSettings ( actual , source ) ) ;
284
293
}
285
294
286
295
private void SetDefaultImportFolder ( ModFileSystem . Folder folder )
287
296
{
288
- if ( ! ImGui . MenuItem ( "Set As Default Import Folder" ) )
297
+ if ( ! ImUtf8 . MenuItem ( "Set As Default Import Folder"u8 ) )
289
298
return ;
290
299
291
300
var newName = folder . FullName ( ) ;
@@ -298,7 +307,7 @@ private void SetDefaultImportFolder(ModFileSystem.Folder folder)
298
307
299
308
private void ClearDefaultImportFolder ( )
300
309
{
301
- if ( ! ImGui . MenuItem ( "Clear Default Import Folder" ) || _config . DefaultImportFolder . Length <= 0 )
310
+ if ( ! ImUtf8 . MenuItem ( "Clear Default Import Folder"u8 ) || _config . DefaultImportFolder . Length <= 0 )
302
311
return ;
303
312
304
313
_config . DefaultImportFolder = string . Empty ;
@@ -309,16 +318,15 @@ private void ClearDefaultImportFolder()
309
318
310
319
private void AddNewModButton ( Vector2 size )
311
320
{
312
- if ( ImGuiUtil . DrawDisabledButton ( FontAwesomeIcon . Plus . ToIconString ( ) , size , "Create a new, empty mod of a given name." ,
313
- ! _modManager . Valid , true ) )
314
- ImGui . OpenPopup ( "Create New Mod" ) ;
321
+ if ( ImUtf8 . IconButton ( FontAwesomeIcon . Plus , "Create a new, empty mod of a given name."u8 , size , ! _modManager . Valid ) )
322
+ ImUtf8 . OpenPopup ( "Create New Mod"u8 ) ;
315
323
}
316
324
317
325
/// <summary> Add an import mods button that opens a file selector. </summary>
318
326
private void AddImportModButton ( Vector2 size )
319
327
{
320
- var button = ImGuiUtil . DrawDisabledButton ( FontAwesomeIcon . FileImport . ToIconString ( ) , size ,
321
- "Import one or multiple mods from Tex Tools Mod Pack Files or Penumbra Mod Pack Files." , ! _modManager . Valid , true ) ;
328
+ var button = ImUtf8 . IconButton ( FontAwesomeIcon . FileImport ,
329
+ "Import one or multiple mods from Tex Tools Mod Pack Files or Penumbra Mod Pack Files."u8 , size , ! _modManager . Valid ) ;
322
330
_tutorial . OpenTutorial ( BasicTutorialSteps . ModImport ) ;
323
331
if ( ! button )
324
332
return ;
@@ -351,23 +359,23 @@ private void RenameMod(ModFileSystem.Leaf leaf)
351
359
var currentName = leaf . Value . Name . Text ;
352
360
if ( ImGui . IsWindowAppearing ( ) )
353
361
ImGui . SetKeyboardFocusHere ( 0 ) ;
354
- ImGui . TextUnformatted ( "Rename Mod:" ) ;
355
- if ( ImGui . InputText ( "##RenameMod" , ref currentName , 256 , ImGuiInputTextFlags . EnterReturnsTrue ) )
362
+ ImUtf8 . Text ( "Rename Mod:"u8 ) ;
363
+ if ( ImUtf8 . InputText ( "##RenameMod"u8 , ref currentName , flags : ImGuiInputTextFlags . EnterReturnsTrue ) )
356
364
{
357
365
_modManager . DataEditor . ChangeModName ( leaf . Value , currentName ) ;
358
366
ImGui . CloseCurrentPopup ( ) ;
359
367
}
360
368
361
- ImGuiUtil . HoverTooltip ( "Enter a new name here to rename the changed mod." ) ;
369
+ ImUtf8 . HoverTooltip ( "Enter a new name here to rename the changed mod."u8 ) ;
362
370
}
363
371
364
372
private void DeleteModButton ( Vector2 size )
365
373
=> DeleteSelectionButton ( size , _config . DeleteModModifier , "mod" , "mods" , _modManager . DeleteMod ) ;
366
374
367
375
private void AddHelpButton ( Vector2 size )
368
376
{
369
- if ( ImGuiUtil . DrawDisabledButton ( FontAwesomeIcon . QuestionCircle . ToIconString ( ) , size , "Open extended help." , false , true ) )
370
- ImGui . OpenPopup ( "ExtendedHelp" ) ;
377
+ if ( ImUtf8 . IconButton ( FontAwesomeIcon . QuestionCircle , "Open extended help."u8 , size , false ) )
378
+ ImUtf8 . OpenPopup ( "ExtendedHelp"u8 ) ;
371
379
372
380
_tutorial . OpenTutorial ( BasicTutorialSteps . AdvancedHelp ) ;
373
381
}
@@ -392,60 +400,61 @@ private void DrawHelpPopup()
392
400
ImGuiUtil . HelpPopup ( "ExtendedHelp" , new Vector2 ( 1000 * UiHelpers . Scale , 38.5f * ImGui . GetTextLineHeightWithSpacing ( ) ) , ( ) =>
393
401
{
394
402
ImGui . Dummy ( Vector2 . UnitY * ImGui . GetTextLineHeight ( ) ) ;
395
- ImGui . TextUnformatted ( "Mod Management" ) ;
396
- ImGui . BulletText ( "You can create empty mods or import mods with the buttons in this row." ) ;
403
+ ImUtf8 . Text ( "Mod Management"u8 ) ;
404
+ ImUtf8 . BulletText ( "You can create empty mods or import mods with the buttons in this row."u8 ) ;
397
405
using var indent = ImRaii . PushIndent ( ) ;
398
- ImGui . BulletText ( "Supported formats for import are: .ttmp, .ttmp2, .pmp." ) ;
399
- ImGui . BulletText (
400
- "You can also support .zip, .7z or .rar archives, but only if they already contain Penumbra-styled mods with appropriate metadata." ) ;
406
+ ImUtf8 . BulletText ( "Supported formats for import are: .ttmp, .ttmp2, .pmp."u8 ) ;
407
+ ImUtf8 . BulletText (
408
+ "You can also support .zip, .7z or .rar archives, but only if they already contain Penumbra-styled mods with appropriate metadata."u8 ) ;
401
409
indent . Pop ( 1 ) ;
402
- ImGui . BulletText ( "You can also create empty mod folders and delete mods." ) ;
403
- ImGui . BulletText ( "For further editing of mods, select them and use the Edit Mod tab in the panel or the Advanced Editing popup." ) ;
410
+ ImUtf8 . BulletText ( "You can also create empty mod folders and delete mods."u8 ) ;
411
+ ImUtf8 . BulletText (
412
+ "For further editing of mods, select them and use the Edit Mod tab in the panel or the Advanced Editing popup."u8 ) ;
404
413
ImGui . Dummy ( Vector2 . UnitY * ImGui . GetTextLineHeight ( ) ) ;
405
- ImGui . TextUnformatted ( "Mod Selector" ) ;
406
- ImGui . BulletText ( "Select a mod to obtain more information or change settings." ) ;
407
- ImGui . BulletText ( "Names are colored according to your config and their current state in the collection:" ) ;
414
+ ImUtf8 . Text ( "Mod Selector"u8 ) ;
415
+ ImUtf8 . BulletText ( "Select a mod to obtain more information or change settings."u8 ) ;
416
+ ImUtf8 . BulletText ( "Names are colored according to your config and their current state in the collection:"u8 ) ;
408
417
indent . Push ( ) ;
409
- ImGuiUtil . BulletTextColored ( ColorId . EnabledMod . Value ( ) , "enabled in the current collection." ) ;
410
- ImGuiUtil . BulletTextColored ( ColorId . DisabledMod . Value ( ) , "disabled in the current collection." ) ;
411
- ImGuiUtil . BulletTextColored ( ColorId . InheritedMod . Value ( ) , "enabled due to inheritance from another collection." ) ;
412
- ImGuiUtil . BulletTextColored ( ColorId . InheritedDisabledMod . Value ( ) , "disabled due to inheritance from another collection." ) ;
413
- ImGuiUtil . BulletTextColored ( ColorId . UndefinedMod . Value ( ) , "unconfigured in all inherited collections." ) ;
414
- ImGuiUtil . BulletTextColored ( ColorId . HandledConflictMod . Value ( ) ,
415
- "enabled and conflicting with another enabled Mod, but on different priorities (i.e. the conflict is solved)." ) ;
416
- ImGuiUtil . BulletTextColored ( ColorId . ConflictingMod . Value ( ) ,
417
- "enabled and conflicting with another enabled Mod on the same priority." ) ;
418
- ImGuiUtil . BulletTextColored ( ColorId . FolderExpanded . Value ( ) , "expanded mod folder." ) ;
419
- ImGuiUtil . BulletTextColored ( ColorId . FolderCollapsed . Value ( ) , "collapsed mod folder" ) ;
418
+ ImUtf8 . BulletTextColored ( ColorId . EnabledMod . Value ( ) , "enabled in the current collection."u8 ) ;
419
+ ImUtf8 . BulletTextColored ( ColorId . DisabledMod . Value ( ) , "disabled in the current collection."u8 ) ;
420
+ ImUtf8 . BulletTextColored ( ColorId . InheritedMod . Value ( ) , "enabled due to inheritance from another collection."u8 ) ;
421
+ ImUtf8 . BulletTextColored ( ColorId . InheritedDisabledMod . Value ( ) , "disabled due to inheritance from another collection."u8 ) ;
422
+ ImUtf8 . BulletTextColored ( ColorId . UndefinedMod . Value ( ) , "unconfigured in all inherited collections."u8 ) ;
423
+ ImUtf8 . BulletTextColored ( ColorId . HandledConflictMod . Value ( ) ,
424
+ "enabled and conflicting with another enabled Mod, but on different priorities (i.e. the conflict is solved)."u8 ) ;
425
+ ImUtf8 . BulletTextColored ( ColorId . ConflictingMod . Value ( ) ,
426
+ "enabled and conflicting with another enabled Mod on the same priority."u8 ) ;
427
+ ImUtf8 . BulletTextColored ( ColorId . FolderExpanded . Value ( ) , "expanded mod folder."u8 ) ;
428
+ ImUtf8 . BulletTextColored ( ColorId . FolderCollapsed . Value ( ) , "collapsed mod folder"u8 ) ;
420
429
indent . Pop ( 1 ) ;
421
- ImGui . BulletText ( "Middle-click a mod to disable it if it is enabled or enable it if it is disabled." ) ;
430
+ ImUtf8 . BulletText ( "Middle-click a mod to disable it if it is enabled or enable it if it is disabled."u8 ) ;
422
431
indent . Push ( ) ;
423
- ImGui . BulletText (
432
+ ImUtf8 . BulletText (
424
433
$ "Holding { _config . DeleteModModifier . ForcedModifier ( new DoubleModifier ( ModifierHotkey . Control , ModifierHotkey . Shift ) ) } while middle-clicking lets it inherit, discarding settings.") ;
425
434
indent . Pop ( 1 ) ;
426
- ImGui . BulletText ( "Right-click a mod to enter its sort order, which is its name by default, possibly with a duplicate number." ) ;
435
+ ImUtf8 . BulletText ( "Right-click a mod to enter its sort order, which is its name by default, possibly with a duplicate number."u8 ) ;
427
436
indent . Push ( ) ;
428
- ImGui . BulletText ( "A sort order differing from the mods name will not be displayed, it will just be used for ordering." ) ;
429
- ImGui . BulletText (
430
- "If the sort order string contains Forward-Slashes ('/'), the preceding substring will be turned into folders automatically." ) ;
437
+ ImUtf8 . BulletText ( "A sort order differing from the mods name will not be displayed, it will just be used for ordering."u8 ) ;
438
+ ImUtf8 . BulletText (
439
+ "If the sort order string contains Forward-Slashes ('/'), the preceding substring will be turned into folders automatically."u8 ) ;
431
440
indent . Pop ( 1 ) ;
432
- ImGui . BulletText (
433
- "You can drag and drop mods and subfolders into existing folders. Dropping them onto mods is the same as dropping them onto the parent of the mod." ) ;
441
+ ImUtf8 . BulletText (
442
+ "You can drag and drop mods and subfolders into existing folders. Dropping them onto mods is the same as dropping them onto the parent of the mod."u8 ) ;
434
443
indent . Push ( ) ;
435
- ImGui . BulletText (
436
- "You can select multiple mods and folders by holding Control while clicking them, and then drag all of them at once." ) ;
437
- ImGui . BulletText (
438
- "Selected mods inside an also selected folder will be ignored when dragging and move inside their folder instead of directly into the target." ) ;
444
+ ImUtf8 . BulletText (
445
+ "You can select multiple mods and folders by holding Control while clicking them, and then drag all of them at once."u8 ) ;
446
+ ImUtf8 . BulletText (
447
+ "Selected mods inside an also selected folder will be ignored when dragging and move inside their folder instead of directly into the target."u8 ) ;
439
448
indent . Pop ( 1 ) ;
440
- ImGui . BulletText ( "Right-clicking a folder opens a context menu." ) ;
441
- ImGui . BulletText ( "Right-clicking empty space allows you to expand or collapse all folders at once." ) ;
442
- ImGui . BulletText ( "Use the Filter Mods... input at the top to filter the list for mods whose name or path contain the text." ) ;
449
+ ImUtf8 . BulletText ( "Right-clicking a folder opens a context menu."u8 ) ;
450
+ ImUtf8 . BulletText ( "Right-clicking empty space allows you to expand or collapse all folders at once."u8 ) ;
451
+ ImUtf8 . BulletText ( "Use the Filter Mods... input at the top to filter the list for mods whose name or path contain the text."u8 ) ;
443
452
indent . Push ( ) ;
444
- ImGui . BulletText ( "You can enter n:[string] to filter only for names, without path." ) ;
445
- ImGui . BulletText ( "You can enter c:[string] to filter for Changed Items instead." ) ;
446
- ImGui . BulletText ( "You can enter a:[string] to filter for Mod Authors instead." ) ;
453
+ ImUtf8 . BulletText ( "You can enter n:[string] to filter only for names, without path."u8 ) ;
454
+ ImUtf8 . BulletText ( "You can enter c:[string] to filter for Changed Items instead."u8 ) ;
455
+ ImUtf8 . BulletText ( "You can enter a:[string] to filter for Mod Authors instead."u8 ) ;
447
456
indent . Pop ( 1 ) ;
448
- ImGui . BulletText ( "Use the expandable menu beside the input to filter for mods fulfilling specific criteria." ) ;
457
+ ImUtf8 . BulletText ( "Use the expandable menu beside the input to filter for mods fulfilling specific criteria."u8 ) ;
449
458
} ) ;
450
459
}
451
460
@@ -729,7 +738,7 @@ private bool ApplyFiltersAndState(ModFileSystem.Leaf leaf, out ModState state)
729
738
730
739
private bool DrawFilterCombo ( ref bool everything )
731
740
{
732
- using var combo = ImRaii . Combo ( "##filterCombo" , string . Empty ,
741
+ using var combo = ImUtf8 . Combo ( "##filterCombo"u8 , ""u8 ,
733
742
ImGuiComboFlags . NoPreview | ImGuiComboFlags . PopupAlignLeft | ImGuiComboFlags . HeightLargest ) ;
734
743
var ret = ImGui . IsItemClicked ( ImGuiMouseButton . Right ) ;
735
744
if ( ! combo )
@@ -738,7 +747,7 @@ private bool DrawFilterCombo(ref bool everything)
738
747
using var style = ImRaii . PushStyle ( ImGuiStyleVar . ItemSpacing ,
739
748
ImGui . GetStyle ( ) . ItemSpacing with { Y = 3 * UiHelpers . Scale } ) ;
740
749
741
- if ( ImGui . Checkbox ( "Everything" , ref everything ) )
750
+ if ( ImUtf8 . Checkbox ( "Everything"u8 , ref everything ) )
742
751
{
743
752
_stateFilter = everything ? ModFilterExtensions . UnfilteredStateMods : 0 ;
744
753
SetFilterDirty ( ) ;
@@ -784,7 +793,7 @@ protected override (float, bool) CustomFilters(float width)
784
793
SetFilterDirty ( ) ;
785
794
}
786
795
787
- ImGuiUtil . HoverTooltip ( "Filter mods for their activation status.\n Right-Click to clear all filters." ) ;
796
+ ImUtf8 . HoverTooltip ( "Filter mods for their activation status.\n Right-Click to clear all filters."u8 ) ;
788
797
ImGui . SetCursorPos ( pos ) ;
789
798
return ( remainingWidth , rightClick ) ;
790
799
}
0 commit comments