Skip to content

Commit

Permalink
if invalid mappings passed into UpdateMappings, treat as null
Browse files Browse the repository at this point in the history
  • Loading branch information
atenfyr committed Jan 19, 2025
1 parent 0c05e6e commit 9f56b2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ Example 2: `UAssetGUI fromjson B.json A.umap Outriders`

### Open a specific file in the GUI
```
UAssetGUI <file name> [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:
Expand Down
7 changes: 7 additions & 0 deletions UAssetGUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit 9f56b2b

Please sign in to comment.