diff --git a/README.md b/README.md index b0d3cab..bdbf424 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,16 @@ Example 2: `UAssetGUI fromjson B.json A.umap Outriders` ### Open a specific file in the GUI ``` -UAssetGUI [engine version] [mappings name] +UAssetGUI [file name] [engine version] [mappings name] ``` -Example 1: `UAssetGUI test.uasset` +Example 1: `UAssetGUI` (to simply open the GUI without opening a file) -Example 2: `UAssetGUI test.uasset VER_UE4_23` +Example 2: `UAssetGUI test.uasset` -Example 3: `UAssetGUI test.uasset VER_UE5_1 Engine` +Example 3: `UAssetGUI test.uasset 23` + +Example 4: `UAssetGUI test.uasset VER_UE5_4 Bellwright` ## Compilation If you'd like to compile UAssetGUI for yourself, read on: diff --git a/UAssetGUI/Form1.cs b/UAssetGUI/Form1.cs index 0acaa83..2d336b2 100644 --- a/UAssetGUI/Form1.cs +++ b/UAssetGUI/Form1.cs @@ -221,15 +221,22 @@ internal void UpdateMappings(string newSelection = null, bool alsoCheckVersion = string initialSelection = newSelection == null ? (allMappingsKeys.Contains(UAGConfig.Data.PreferredMappings) ? UAGConfig.Data.PreferredMappings : allMappingsKeys[0]) : newSelection; + bool success = false; for (int i = 0; i < allMappingsKeys.Count; i++) { if (allMappingsKeys[i] == initialSelection) { comboSpecifyMappings.SelectedIndex = i; + success = true; break; } } + if (!success) + { + comboSpecifyMappings.SelectedIndex = 0; + } + UpdateComboSpecifyMappings(alsoCheckVersion); }); }