@@ -70,6 +70,7 @@ namespace TFE_FrontEndUI
70
70
71
71
static ViewMode s_viewMode = VIEW_IMAGES;
72
72
73
+ char programDirModDir[TFE_MAX_PATH];
73
74
static char s_modFilter[256 ] = { 0 };
74
75
static char s_prevModFilter[256 ] = { 0 };
75
76
static size_t s_filterLen = 0 ;
@@ -90,7 +91,8 @@ namespace TFE_FrontEndUI
90
91
91
92
void modLoader_read ()
92
93
{
93
- if (s_modsRead) { return ; }
94
+ // Reuse the cached mods unless no mods have been read yet.
95
+ if (s_modsRead && s_mods.size () > 0 ) { return ; }
94
96
s_modsRead = true ;
95
97
96
98
s_mods.clear ();
@@ -118,7 +120,6 @@ namespace TFE_FrontEndUI
118
120
sprintf (programDataModDir, " %sMods/" , programData);
119
121
TFE_Paths::fixupPathAsDirectory (programDataModDir);
120
122
121
- char programDirModDir[TFE_MAX_PATH];
122
123
sprintf (programDirModDir, " %sMods/" , programDir);
123
124
TFE_Paths::fixupPathAsDirectory (programDirModDir);
124
125
@@ -142,6 +143,7 @@ namespace TFE_FrontEndUI
142
143
143
144
if (!modPathCount)
144
145
{
146
+ s_modsRead = false ;
145
147
return ;
146
148
}
147
149
@@ -444,6 +446,24 @@ namespace TFE_FrontEndUI
444
446
}
445
447
filterMods (s_viewMode != VIEW_FILE_LIST);
446
448
}
449
+
450
+ ImGui::SameLine (510 .0f * uiScale);
451
+ if (ImGui::Button (" Refresh Mod Listing" ))
452
+ {
453
+ s_modsRead = false ;
454
+ modLoader_read ();
455
+ }
456
+
457
+ #ifdef _WIN32
458
+ ImGui::SameLine (730 .0f * uiScale);
459
+ if (ImGui::Button (" Open Mod Folder" ))
460
+ {
461
+ if (!TFE_System::osShellExecute (programDirModDir, NULL , NULL , false ))
462
+ {
463
+ TFE_System::logWrite (LOG_ERROR, " ModLoader" , " Failed to open the directory: '%s'" , programDirModDir);
464
+ }
465
+ }
466
+ #endif
447
467
448
468
ImGui::Separator ();
449
469
0 commit comments