Skip to content

Commit

Permalink
Merge pull request #472 from 4sval/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
4sval authored May 26, 2024
2 parents 0b11888 + eb3f302 commit bcbda59
Show file tree
Hide file tree
Showing 77 changed files with 3,313 additions and 2,330 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
- name: Fetch Submodules Recursively
run: git submodule update --init --recursive

- name: .NET 6 Setup
- name: .NET 8 Setup
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'

- name: .NET Restore
run: dotnet restore FModel

- name: .NET Publish
run: dotnet publish FModel -c Release --no-self-contained -r win-x64 -f net6.0-windows -o "./FModel/bin/Publish/" -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:DebugType=None -p:GenerateDocumentationFile=false -p:DebugSymbols=false -p:AssemblyVersion=${{ github.event.inputs.appVersion }} -p:FileVersion=${{ github.event.inputs.appVersion }}
run: dotnet publish FModel -c Release --no-self-contained -r win-x64 -f net8.0-windows -o "./FModel/bin/Publish/" -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:DebugType=None -p:GenerateDocumentationFile=false -p:DebugSymbols=false -p:AssemblyVersion=${{ github.event.inputs.appVersion }} -p:FileVersion=${{ github.event.inputs.appVersion }}

- name: ZIP File
uses: papeloto/action-zip@v1
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: FModel QA Builder

on:
push:
branches: [ dev ]

jobs:
build:
runs-on: windows-latest

steps:
- name: GIT Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: .NET 8 Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: .NET Restore
run: dotnet restore FModel

- name: .NET Publish
run: dotnet publish "./FModel/FModel.csproj" -c Release --no-restore --no-self-contained -r win-x64 -f net8.0-windows -o "./FModel/bin/Publish/" -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:DebugType=None -p:GenerateDocumentationFile=false -p:DebugSymbols=false

- name: ZIP File
uses: thedoctor0/[email protected]
with:
type: zip
filename: ${{ github.sha }}.zip # will end up in working directory not the Publish folder
path: ./FModel/bin/Publish/FModel.exe

- name: Edit QA Artifact
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: 'FModel QA Testing'
body: 'Dev builds'
tag: 'qa'
artifacts: ${{ github.sha }}.zip
prerelease: true
allowUpdates: true

- name: Get Version
id: package_version
uses: kzrnm/get-net-sdk-project-versions-action@v2
with:
proj-path: ./FModel/FModel.csproj

- name: FModel Auth
id: fmodel_auth
uses: fjogeleit/[email protected]
with:
url: "https://api.fmodel.app/v1/oauth/token"
data: '{"username": "${{ secrets.API_USERNAME }}", "password": "${{ secrets.API_PASSWORD }}"}'

- name: FModel Deploy Build
uses: fjogeleit/[email protected]
with:
url: "https://api.fmodel.app/v1/infos/${{ secrets.QA_ID }}"
method: "PATCH"
bearerToken: ${{ fromJson(steps.fmodel_auth.outputs.response).accessToken }}
data: '{"version": "${{ steps.package_version.outputs.version }}-dev+${{ github.sha }}", "downloadUrl": "https://github.com/4sval/FModel/releases/download/qa/${{ github.sha }}.zip"}'
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "CUE4Parse"]
path = CUE4Parse
url = https://github.com/FabianFG/CUE4Parse
[submodule "EpicManifestParser"]
path = EpicManifestParser
url = https://github.com/FModel/EpicManifestParser
2 changes: 1 addition & 1 deletion CUE4Parse
Submodule CUE4Parse updated 250 files
1 change: 0 additions & 1 deletion EpicManifestParser
Submodule EpicManifestParser deleted from 21df8a
22 changes: 8 additions & 14 deletions FModel/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ protected override void OnStartup(StartupEventArgs e)
{
UserSettings.Default = JsonConvert.DeserializeObject<UserSettings>(
File.ReadAllText(UserSettings.FilePath), JsonNetSerializer.SerializerSettings);

/*if (UserSettings.Default.ShowChangelog) */MigrateV1Games();
}
catch
{
Expand All @@ -52,7 +50,14 @@ protected override void OnStartup(StartupEventArgs e)
var createMe = false;
if (!Directory.Exists(UserSettings.Default.OutputDirectory))
{
UserSettings.Default.OutputDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Output");
var currentDir = Directory.GetCurrentDirectory();
var dirInfo = new DirectoryInfo(currentDir);
if (dirInfo.Attributes.HasFlag(FileAttributes.Archive))
throw new Exception("FModel cannot be run from an archive file. Please extract it and try again.");
if (dirInfo.Attributes.HasFlag(FileAttributes.ReadOnly))
throw new Exception("FModel cannot be run from a read-only directory. Please move it to a writable location.");

UserSettings.Default.OutputDirectory = Path.Combine(currentDir, "Output");
}

if (!Directory.Exists(UserSettings.Default.RawDataDirectory))
Expand Down Expand Up @@ -143,17 +148,6 @@ private void OnUnhandledException(object sender, DispatcherUnhandledExceptionEve
e.Handled = true;
}

private void MigrateV1Games()
{
foreach ((var gameDir, var setting) in UserSettings.Default.ManualGames)
{
if (!Directory.Exists(gameDir)) continue;
UserSettings.Default.PerDirectory[gameDir] =
DirectorySettings.Default(setting.GameName, setting.GameDirectory, true, setting.OverridedGame, setting.AesKeys?.MainKey);
}
UserSettings.Default.ManualGames.Clear();
}

private string GetOperatingSystemProductName()
{
var productName = string.Empty;
Expand Down
2 changes: 1 addition & 1 deletion FModel/Creator/Bases/FN/BaseBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override void ParseForInfo()
{
_quests = new List<BaseQuest>();

if (Object.TryGetValue(out FText displayName, "DisplayName"))
if (Object.TryGetValue(out FText displayName, "DisplayName", "ItemName"))
DisplayName = displayName.Text.ToUpperInvariant();

if (Object.TryGetValue(out FStructFallback[] quests, "QuestInfos")) // prout :)
Expand Down
23 changes: 21 additions & 2 deletions FModel/Creator/Bases/FN/BaseCommunity.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Linq;
using CUE4Parse.GameTypes.FN.Enums;
using CUE4Parse.UE4.Assets.Exports;
using CUE4Parse.UE4.Assets.Objects;
using CUE4Parse.UE4.Objects.GameplayTags;
using CUE4Parse.UE4.Objects.UObject;
using CUE4Parse.UE4.Versions;
Expand Down Expand Up @@ -32,10 +34,27 @@ public override void ParseForInfo()
{
ParseForReward(UserSettings.Default.CosmeticDisplayAsset);

if (Object.TryGetValue(out FPackageIndex series, "Series") && Utils.TryGetPackageIndexExport(series, out UObject export))
_rarityName = export.Name;
if (Object.TryGetValue(out FPackageIndex series, "Series"))
{
_rarityName = series.Name;
}
else if (Object.TryGetValue(out FInstancedStruct[] dataList, "DataList") &&
dataList.FirstOrDefault(d => d.NonConstStruct?.TryGetValue(out FPackageIndex _, "Series") == true) is { } dl)
{
_rarityName = dl.NonConstStruct?.Get<FPackageIndex>("Series").Name;
}
else if (Object.TryGetValue(out FStructFallback componentContainer, "ComponentContainer") &&
componentContainer.TryGetValue(out FPackageIndex[] components, "Components") &&
components.FirstOrDefault(c => c.Name.Contains("Series")) is { } seriesDef &&
seriesDef.TryLoad(out var seriesDefObj) && seriesDefObj is not null &&
seriesDefObj.TryGetValue(out series, "Series"))
{
_rarityName = series.Name;
}
else
{
_rarityName = Object.GetOrDefault("Rarity", EFortRarity.Uncommon).GetDescription();
}

if (Object.TryGetValue(out FGameplayTagContainer gameplayTags, "GameplayTags"))
CheckGameplayTags(gameplayTags);
Expand Down
Loading

0 comments on commit bcbda59

Please sign in to comment.