updated verse highlighter + #289 v1

This commit is contained in:
4sval
2022-07-06 11:17:07 +02:00
parent 97b4b00766
commit 8d80c3f8ac
7 changed files with 7 additions and 75 deletions

View File

@@ -12,11 +12,11 @@
<Color name="Punctuation" foreground="#E5C07B" />
<RuleSet>
<Rule color="Constant">\b(?:module|class|attribute|interface|struct|external|enum|where|comparable|component|void|type|subtype)</Rule>
<Rule color="Constant">\b(?:module|class|attribute|interface|struct|external|enum|where|comparable|component|void|type|subtype)|\@\w+</Rule>
<Rule color="Method">\w+(?:\'.*\')?(?=(?:&lt;\w+&gt;)+\()</Rule>
<Rule color="Variable">\w+(?:\'.*\')?(?=(?:&lt;\w+&gt;)+\^?:)</Rule>
<Rule color="Tag1">&lt;\w+&gt;</Rule>
<Rule color="Tag2">&lt;@.*&gt;|^using.*</Rule>
<Rule color="Tag2">(?:^using|\# ).*</Rule>
<Rule color="Parameter">(?!\()\w+(?=:)</Rule>
<Rule color="Class">\w+(?=(?:&lt;\w+&gt;)+\s:=)</Rule>
<Rule color="Type">(?&lt;=:)[\w\[\]\?]+</Rule>

View File

@@ -109,20 +109,6 @@ namespace FModel.Settings
set => SetProperty(ref _mappingFilePath, value);
}
private bool _forceGame;
public bool ForceGame
{
get => _forceGame;
set => SetProperty(ref _forceGame, value);
}
private FGame _gameToForce;
public FGame GameToForce
{
get => _gameToForce;
set => SetProperty(ref _gameToForce, value);
}
private int _lastOpenedSettingTab;
public int LastOpenedSettingTab
{

View File

@@ -103,10 +103,7 @@ public class CUE4ParseViewModel : ViewModel
}
default:
{
Game = UserSettings.Default.ForceGame ?
UserSettings.Default.GameToForce :
gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\").ToEnum(FGame.Unknown);
Game = gameDirectory.SubstringBeforeLast("\\Content").SubstringAfterLast("\\").ToEnum(FGame.Unknown);
var versions = new VersionContainer(UserSettings.Default.OverridedGame[Game], UserSettings.Default.OverridedPlatform,
customVersions: UserSettings.Default.OverridedCustomVersions[Game],
optionOverrides: UserSettings.Default.OverridedOptions[Game]);
@@ -278,7 +275,7 @@ public class CUE4ParseViewModel : ViewModel
file.FileCount = vfs.FileCount;
}
// Game = Provider.GameName.ToEnum(Game);
Game = Provider.GameName.ToEnum(Game);
});
}

View File

@@ -50,7 +50,7 @@ public class LoadCommand : ViewModelCommand<LoadingModesViewModel>
_applicationView.CUE4Parse.Provider.MappingsContainer == null)
{
FLogger.AppendError();
FLogger.AppendText("Mappings could not get pulled, extracting packages might not work properly. If so, press F12 or please restart.", Constants.WHITE, true);
FLogger.AppendText("Mappings could not get pulled, extracting packages might not work properly. If so, either press F12, restart, or come back later.", Constants.WHITE, true);
}
#if DEBUG
@@ -223,4 +223,4 @@ public class LoadCommand : ViewModelCommand<LoadingModesViewModel>
_applicationView.CUE4Parse.AssetsFolder.BulkPopulate(entries);
}
}
}

View File

@@ -89,13 +89,6 @@ public class SettingsViewModel : ViewModel
set => SetProperty(ref _selectedDiscordRpc, value);
}
private FGame _selectedForceGame;
public FGame SelectedForceGame
{
get => _selectedForceGame;
set => SetProperty(ref _selectedForceGame, value);
}
private ECompressedAudio _selectedCompressedAudio;
public ECompressedAudio SelectedCompressedAudio
{
@@ -133,7 +126,6 @@ public class SettingsViewModel : ViewModel
public ReadOnlyObservableCollection<EUpdateMode> UpdateModes { get; private set; }
public ObservableCollection<string> Presets { get; private set; }
public ReadOnlyObservableCollection<FGame> GameTypes { get; private set; }
public ReadOnlyObservableCollection<EGame> UeGames { get; private set; }
public ReadOnlyObservableCollection<ELanguage> AssetLanguages { get; private set; }
public ReadOnlyObservableCollection<EAesReload> AesReloads { get; private set; }
@@ -220,12 +212,10 @@ public class SettingsViewModel : ViewModel
SelectedTextureExportFormat = _textureExportFormatSnapshot;
SelectedAesReload = UserSettings.Default.AesReload;
SelectedDiscordRpc = UserSettings.Default.DiscordRpc;
SelectedForceGame = UserSettings.Default.GameToForce;
UpdateModes = new ReadOnlyObservableCollection<EUpdateMode>(new ObservableCollection<EUpdateMode>(EnumerateUpdateModes()));
Presets = new ObservableCollection<string>(EnumeratePresets());
UeGames = new ReadOnlyObservableCollection<EGame>(new ObservableCollection<EGame>(EnumerateUeGames()));
GameTypes = new ReadOnlyObservableCollection<FGame>(new ObservableCollection<FGame>(EnumerateGameTypes()));
AssetLanguages = new ReadOnlyObservableCollection<ELanguage>(new ObservableCollection<ELanguage>(EnumerateAssetLanguages()));
AesReloads = new ReadOnlyObservableCollection<EAesReload>(new ObservableCollection<EAesReload>(EnumerateAesReloads()));
DiscordRpcs = new ReadOnlyObservableCollection<EDiscordRpc>(new ObservableCollection<EDiscordRpc>(EnumerateDiscordRpcs()));
@@ -335,7 +325,6 @@ public class SettingsViewModel : ViewModel
yield return Constants._NO_PRESET_TRIGGER;
}
private IEnumerable<EGame> EnumerateUeGames() => Enum.GetValues<EGame>();
private IEnumerable<FGame> EnumerateGameTypes() => Enum.GetValues<FGame>();
private IEnumerable<ELanguage> EnumerateAssetLanguages() => Enum.GetValues<ELanguage>();
private IEnumerable<EAesReload> EnumerateAesReloads() => Enum.GetValues<EAesReload>();
private IEnumerable<EDiscordRpc> EnumerateDiscordRpcs() => Enum.GetValues<EDiscordRpc>();

View File

@@ -41,8 +41,6 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -246,44 +244,6 @@
Visibility="{Binding OverwriteMapping, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"/>
<Button Grid.Row="15" Grid.Column="6" Content="..." HorizontalAlignment="Right" Click="OnBrowseMappings" Margin="0 0 0 5"
Visibility="{Binding OverwriteMapping, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"/>
<TextBlock Grid.Row="16" Grid.Column="0" Text="Force Game Type" VerticalAlignment="Center" Margin="0 0 0 5"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="Visibility" Value="Visible"/>
</Style>
</TextBlock.Style>
</TextBlock>
<CheckBox Grid.Row="16" Grid.Column="2" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
IsChecked="{Binding ForceGame, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" Margin="0 5 0 10"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}">
<CheckBox.Style>
<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Visibility" Value="Visible"/>
</Style>
</CheckBox.Style>
</CheckBox>
<TextBlock Grid.Row="17" Grid.Column="0" Text="Game Type" VerticalAlignment="Center" Margin="0 0 0 5"
Visibility="{Binding ForceGame, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}" />
<ComboBox Grid.Row="17" Grid.Column="2" Grid.ColumnSpan="5" ItemsSource="{Binding SettingsView.GameTypes}" SelectedItem="{Binding SettingsView.SelectedForceGame, Mode=TwoWay}"
DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Views.SettingsView}}}"
SelectedValue="{Binding GameToForce, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" Margin="0 5 0 10">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={x:Static converters:EnumToStringConverter.Instance}}" />
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBox.Style>
<Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="Visibility" Value="{Binding ForceGame, Source={x:Static local:Settings.UserSettings.Default}, Converter={StaticResource BoolToVisibilityConverter}}"/>
</Style>
</ComboBox.Style>
</ComboBox>
</Grid>
</DataTemplate>
<DataTemplate x:Key="CreatorTemplate">