Skip to content

Commit 9f56b2b

Browse files
committed
if invalid mappings passed into UpdateMappings, treat as null
1 parent 0c05e6e commit 9f56b2b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ Example 2: `UAssetGUI fromjson B.json A.umap Outriders`
3737

3838
### Open a specific file in the GUI
3939
```
40-
UAssetGUI <file name> [engine version] [mappings name]
40+
UAssetGUI [file name] [engine version] [mappings name]
4141
```
4242

43-
Example 1: `UAssetGUI test.uasset`
43+
Example 1: `UAssetGUI` (to simply open the GUI without opening a file)
4444

45-
Example 2: `UAssetGUI test.uasset VER_UE4_23`
45+
Example 2: `UAssetGUI test.uasset`
4646

47-
Example 3: `UAssetGUI test.uasset VER_UE5_1 Engine`
47+
Example 3: `UAssetGUI test.uasset 23`
48+
49+
Example 4: `UAssetGUI test.uasset VER_UE5_4 Bellwright`
4850

4951
## Compilation
5052
If you'd like to compile UAssetGUI for yourself, read on:

UAssetGUI/Form1.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,22 @@ internal void UpdateMappings(string newSelection = null, bool alsoCheckVersion =
221221

222222
string initialSelection = newSelection == null ? (allMappingsKeys.Contains(UAGConfig.Data.PreferredMappings) ? UAGConfig.Data.PreferredMappings : allMappingsKeys[0]) : newSelection;
223223

224+
bool success = false;
224225
for (int i = 0; i < allMappingsKeys.Count; i++)
225226
{
226227
if (allMappingsKeys[i] == initialSelection)
227228
{
228229
comboSpecifyMappings.SelectedIndex = i;
230+
success = true;
229231
break;
230232
}
231233
}
232234

235+
if (!success)
236+
{
237+
comboSpecifyMappings.SelectedIndex = 0;
238+
}
239+
233240
UpdateComboSpecifyMappings(alsoCheckVersion);
234241
});
235242
}

0 commit comments

Comments
 (0)