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

@ -1 +1 @@
Subproject commit 81458ae77d3f3230d7582a77ffd938510430a4bf
Subproject commit dc70cfbc92436bd8c6308a5139c1baa94bd37799

View File

@ -300,7 +300,7 @@ namespace FModel.Settings
}
}
private EUnluacFlags _unluacFlags;
private EUnluacFlags _unluacFlags = EUnluacFlags.Decompile;
public EUnluacFlags 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)
{
if (!UserSettings.IsEndpointValid(EEndpointType.Mapping, out var endpoint))
@ -413,7 +423,7 @@ public class CUE4ParseViewModel : ViewModel
var l = ELog.Information;
if (endpoint.Overwrite && File.Exists(endpoint.FilePath))
{
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(endpoint.FilePath);
Provider.MappingsContainer = SelectMappingsProvider(endpoint.FilePath);
}
else if (endpoint.IsValid)
{
@ -439,7 +449,7 @@ public class CUE4ParseViewModel : ViewModel
_apiEndpointView.DownloadFile(mapping.Url, mappingPath);
}
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(mappingPath);
Provider.MappingsContainer = SelectMappingsProvider(mappingPath);
break;
}
}
@ -1321,8 +1331,8 @@ public class CUE4ParseViewModel : ViewModel
{
var data = squareEnixObject switch
{
USQEXSEADSoundBank sqexSoundBank => sqexSoundBank.SQEXSoundBankData?.Data ?? [],
USQEXSEADSound sqexSound => sqexSound.SQEXSoundData?.Data ?? [],
USQEXSEADSoundBank sqexSoundBank => sqexSoundBank.SQEXSoundBankData?.ReadDataOnce() ?? [],
USQEXSEADSound sqexSound => sqexSound.SQEXSoundData?.ReadDataOnce() ?? [],
_ => [],
};
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)
{
TitleText.Text = "Drop .usmap to import";
TitleText.Text = "Drop usmap/jmap to import";
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)
return;
bool directorySelectorIsVisible = _applicationView.Status.Kind is EStatusKind.Configuring;
if (!directorySelectorIsVisible && (Helper.IsWindowOpen<DictionaryEditor>() || Helper.IsWindowOpen<EndpointEditor>()))
{
@ -145,7 +144,9 @@ public partial class DropOverlay : UserControl
_dragStatus = DragStatus.Folder;
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;
_dragStatus = DragStatus.File;