Skip to content

Commit 0cc8da9

Browse files
authored
Throne and Liberty, Farlight84 and Mafia fixes
2 parents a1ddc72 + a0586e8 commit 0cc8da9

File tree

17 files changed

+501
-216
lines changed

17 files changed

+501
-216
lines changed

CUE4Parse

Submodule CUE4Parse updated 69 files

FModel/Creator/Bases/FN/BaseIconStats.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public override void ParseForInfo()
8989
weaponRowValue.TryGetValue(out float dmgCritical, "DamageZone_Critical"); //Headshot multiplier
9090
weaponRowValue.TryGetValue(out int clipSize, "ClipSize"); //Item magazine size
9191
weaponRowValue.TryGetValue(out float firingRate, "FiringRate"); //Item firing rate, value is shots per second
92+
weaponRowValue.TryGetValue(out float swingTime, "SwingTime"); //Item swing rate, value is swing per second
9293
weaponRowValue.TryGetValue(out float armTime, "ArmTime"); //Time it takes for traps to be able to be set off
9394
weaponRowValue.TryGetValue(out float reloadTime, "ReloadTime"); //Time it takes for a weapon to reload
9495
weaponRowValue.TryGetValue(out int bpc, "BulletsPerCartridge"); //Amount of pellets shot by a weapon at once, usually for shotguns
@@ -124,7 +125,7 @@ public override void ParseForInfo()
124125
_statistics.Add(new IconStat(Utils.GetLocalizedResource("", "068239DD4327B36124498C9C5F61C038", "Magazine Size"), clipSize, 40));
125126
}
126127

127-
var burstEquation = cartridgePerFire / (((cartridgePerFire - 1f) / burstFiringRate) + (1f / firingRate));
128+
var burstEquation = cartridgePerFire != 0f && burstFiringRate != 0f ? (cartridgePerFire / (((cartridgePerFire - 1f) / burstFiringRate) + (1f / firingRate))) : 0f;
128129
if (burstEquation != 0f)
129130
{
130131
_statistics.Add(new IconStat(Utils.GetLocalizedResource("", "27B80BA44805ABD5A2D2BAB2902B250C", "Fire Rate"), burstEquation, 11));
@@ -133,6 +134,10 @@ public override void ParseForInfo()
133134
{
134135
_statistics.Add(new IconStat(Utils.GetLocalizedResource("", "27B80BA44805ABD5A2D2BAB2902B250C", "Fire Rate"), firingRate, 11));
135136
}
137+
else if (swingTime != 0f)
138+
{
139+
_statistics.Add(new IconStat(Utils.GetLocalizedResource("", "27B80BA44805ABD5A2D2BAB2902B250C", "Fire Rate"), swingTime, 11));
140+
}
136141

137142
if (armTime != 0f)
138143
{

FModel/Extensions/StringExtensions.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ public static int GetNameLineNumber(this string s, string lineToFind)
2929
{
3030
if (KismetRegex().IsMatch(lineToFind))
3131
return s.GetKismetLineNumber(lineToFind);
32+
3233
if (int.TryParse(lineToFind, out var index))
3334
return s.GetLineNumber(index);
3435

35-
lineToFind = $" \"Name\": \"{lineToFind}\",";
36+
return s.GetNameLineNumberText($" \"Name\": \"{lineToFind}\",");
37+
}
38+
39+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
40+
public static int GetNameLineNumberText(this string s, string lineToFind)
41+
{
3642
using var reader = new StringReader(s);
3743
var lineNum = 0;
3844
while (reader.ReadLine() is { } line)
@@ -41,7 +47,6 @@ public static int GetNameLineNumber(this string s, string lineToFind)
4147
if (line.Equals(lineToFind, StringComparison.OrdinalIgnoreCase))
4248
return lineNum;
4349
}
44-
4550
return -1;
4651
}
4752

FModel/MainWindow.xaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,30 @@
501501
</Viewbox>
502502
</MenuItem.Icon>
503503
</MenuItem>
504+
<MenuItem Header="Decompile Blueprint" Command="{Binding DataContext.RightClickMenuCommand}">
505+
<MenuItem.CommandParameter>
506+
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
507+
<Binding Source="Assets_Decompile" />
508+
<Binding Path="SelectedItems" />
509+
</MultiBinding>
510+
</MenuItem.CommandParameter>
511+
<MenuItem.Icon>
512+
<Viewbox Width="16" Height="16">
513+
<Canvas Width="24" Height="24">
514+
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource InfoIcon}" />
515+
</Canvas>
516+
</Viewbox>
517+
</MenuItem.Icon>
518+
<MenuItem.Style>
519+
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
520+
<Style.Triggers>
521+
<DataTrigger Binding="{Binding ShowDecompileOption, Source={x:Static settings:UserSettings.Default}}" Value="False">
522+
<Setter Property="Visibility" Value="Collapsed" />
523+
</DataTrigger>
524+
</Style.Triggers>
525+
</Style>
526+
</MenuItem.Style>
527+
</MenuItem>
504528
<Separator />
505529
<MenuItem Command="{Binding DataContext.RightClickMenuCommand}">
506530
<MenuItem.Header>

0 commit comments

Comments
 (0)