Directive 8020, Conan Exiles Enhanced, Chasing Kaleido RIDER, Abzu support
Some checks failed
FModel QA Builder / build (push) Has been cancelled

Fix Delta Force, Highguard SM
jmap as mappings support
This commit is contained in:
LongerWarrior
2026-05-12 01:22:46 +03:00
parent 9159a91626
commit afb02f5bbd
4 changed files with 20 additions and 9 deletions

View File

@@ -300,7 +300,7 @@ namespace FModel.Settings
} }
} }
private EUnluacFlags _unluacFlags; private EUnluacFlags _unluacFlags = EUnluacFlags.Decompile;
public EUnluacFlags UnluacFlags public EUnluacFlags UnluacFlags
{ {
get => _unluacFlags; get => _unluacFlags;

View File

@@ -400,6 +400,16 @@ public class CUE4ParseViewModel : ViewModel
}); });
} }
private ITypeMappingsProvider SelectMappingsProvider(string path)
{
if (path.EndsWith(".jmap.gz", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".jmap", StringComparison.OrdinalIgnoreCase))
{
return new JmapTypeMappingsProvider(path);
}
return new FileUsmapTypeMappingsProvider(path);
}
public Task InitMappings(bool force = false) public Task InitMappings(bool force = false)
{ {
if (!UserSettings.IsEndpointValid(EEndpointType.Mapping, out var endpoint)) if (!UserSettings.IsEndpointValid(EEndpointType.Mapping, out var endpoint))
@@ -413,7 +423,7 @@ public class CUE4ParseViewModel : ViewModel
var l = ELog.Information; var l = ELog.Information;
if (endpoint.Overwrite && File.Exists(endpoint.FilePath)) if (endpoint.Overwrite && File.Exists(endpoint.FilePath))
{ {
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(endpoint.FilePath); Provider.MappingsContainer = SelectMappingsProvider(endpoint.FilePath);
} }
else if (endpoint.IsValid) else if (endpoint.IsValid)
{ {
@@ -439,7 +449,7 @@ public class CUE4ParseViewModel : ViewModel
_apiEndpointView.DownloadFile(mapping.Url, mappingPath); _apiEndpointView.DownloadFile(mapping.Url, mappingPath);
} }
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(mappingPath); Provider.MappingsContainer = SelectMappingsProvider(mappingPath);
break; break;
} }
} }
@@ -1321,8 +1331,8 @@ public class CUE4ParseViewModel : ViewModel
{ {
var data = squareEnixObject switch var data = squareEnixObject switch
{ {
USQEXSEADSoundBank sqexSoundBank => sqexSoundBank.SQEXSoundBankData?.Data ?? [], USQEXSEADSoundBank sqexSoundBank => sqexSoundBank.SQEXSoundBankData?.ReadDataOnce() ?? [],
USQEXSEADSound sqexSound => sqexSound.SQEXSoundData?.Data ?? [], USQEXSEADSound sqexSound => sqexSound.SQEXSoundData?.ReadDataOnce() ?? [],
_ => [], _ => [],
}; };
var sabPath = Path.Combine(TabControl.SelectedTab.Entry.PathWithoutExtension.Replace('\\', '/').SubstringBeforeLast('/'), squareEnixObject.Name); var sabPath = Path.Combine(TabControl.SelectedTab.Entry.PathWithoutExtension.Replace('\\', '/').SubstringBeforeLast('/'), squareEnixObject.Name);

View File

@@ -68,7 +68,7 @@ public partial class DropOverlay : UserControl
} }
else if (_dragStatus is DragStatus.File) else if (_dragStatus is DragStatus.File)
{ {
TitleText.Text = "Drop .usmap to import"; TitleText.Text = "Drop usmap/jmap to import";
DescriptionText.Text = "Mapping file will be applied immediately"; DescriptionText.Text = "Mapping file will be applied immediately";
} }
} }
@@ -125,7 +125,6 @@ public partial class DropOverlay : UserControl
if (!_applicationView.Status.IsReady || !e.Data.GetDataPresent(DataFormats.FileDrop) || e.Data.GetData(DataFormats.FileDrop) is not string[] files) if (!_applicationView.Status.IsReady || !e.Data.GetDataPresent(DataFormats.FileDrop) || e.Data.GetData(DataFormats.FileDrop) is not string[] files)
return; return;
bool directorySelectorIsVisible = _applicationView.Status.Kind is EStatusKind.Configuring; bool directorySelectorIsVisible = _applicationView.Status.Kind is EStatusKind.Configuring;
if (!directorySelectorIsVisible && (Helper.IsWindowOpen<DictionaryEditor>() || Helper.IsWindowOpen<EndpointEditor>())) if (!directorySelectorIsVisible && (Helper.IsWindowOpen<DictionaryEditor>() || Helper.IsWindowOpen<EndpointEditor>()))
{ {
@@ -145,7 +144,9 @@ public partial class DropOverlay : UserControl
_dragStatus = DragStatus.Folder; _dragStatus = DragStatus.Folder;
return; return;
} }
else if (File.Exists(path) && Path.GetExtension(path).Equals(".usmap", StringComparison.OrdinalIgnoreCase)) else if (File.Exists(path) && path.EndsWith(".usmap", StringComparison.OrdinalIgnoreCase) ||
path.EndsWith(".jmap", StringComparison.OrdinalIgnoreCase) ||
path.EndsWith(".jmap.gz", StringComparison.OrdinalIgnoreCase))
{ {
_path = path; _path = path;
_dragStatus = DragStatus.File; _dragStatus = DragStatus.File;