Skip to content

Commit

Permalink
1.2.5
Browse files Browse the repository at this point in the history
- Fixed issue with Regex for phone color. (there's a field labeled 'your character name' so it won't color your name in yellow during phone calls)
- Fixed cached images chat log not saving properly.
  • Loading branch information
VashBaldeus committed Jan 17, 2022
1 parent a3f68da commit 604a0bf
Show file tree
Hide file tree
Showing 84 changed files with 2,212 additions and 97 deletions.
Binary file modified .vs/Screenshot_Editor/v16/.suo
Binary file not shown.
3 changes: 3 additions & 0 deletions GTAWorld Screenshot Editor/GTAWorld Screenshot Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="HtmlToXamlConverter">
<Version>1.0.5727.24510</Version>
</PackageReference>
<PackageReference Include="MahApps.Metro">
<Version>2.4.7</Version>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions GTAWorld Screenshot Editor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.4.0")]
[assembly: AssemblyFileVersion("1.2.4.0")]
[assembly: AssemblyVersion("1.2.5.0")]
[assembly: AssemblyFileVersion("1.2.5.0")]
39 changes: 28 additions & 11 deletions GTAWorld Screenshot Editor/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
using Microsoft.Win32;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using HTMLConverter;
using Clipboard = System.Windows.Clipboard;
using Message = ExtensionMethods.Message;
using MessageBox = System.Windows.MessageBox;
Expand Down Expand Up @@ -87,8 +90,6 @@ public void OnLoadExecute(object obj)
{
try
{
DebugInit();

LookForMainDirectory();

InitFilters();
Expand All @@ -107,6 +108,8 @@ public void OnLoadExecute(object obj)
};

TextBlocks.Add(SelectedBlock);

DebugInit();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -861,6 +864,14 @@ public System.Windows.Controls.ListView NamesList
set { _namesList = value; OnPropertyChanged(); }
}

private string _yourCharacterName = string.Empty;

public string YourCharacterName
{
get => _yourCharacterName;
set { _yourCharacterName = value; OnPropertyChanged(); }
}

#endregion

#region Private Properties
Expand Down Expand Up @@ -893,21 +904,19 @@ public System.Windows.Controls.ListView NamesList
private void DebugInit()
{
#if DEBUG
File.Delete("./parser.cfg");

//var str = "You placed Pistol Ammo (49) into the property.";

//Console.WriteLine(
// $"{Regex.IsMatch(str, @"^You placed (.* \((?<AMOUNT>[\d.,]+)\)|(?<AMOUNT>[\d.,]+) .*) (into the property|in the vehicle).$")}");
//File.Delete("./parser.cfg");
#endif

}

/// <summary>
/// Initialize Filters, load saved filter file if exits, otherwise create new file
/// </summary>
private void InitFilters()
{
#if DEBUG
File.Delete("./parser.cfg");
#endif

ParserSettings.Filters = new ObservableCollection<Criteria>
{
new Criteria
Expand Down Expand Up @@ -945,7 +954,7 @@ private void InitFilters()
{
Selected = true,
Name = "Cellphone",
Filter = @"(\(cellphone\))"
Filter = @"^((([\p{L}]+ {0,1} [\p{L}]+){0,1})|(Mask+[a-zA-Z0-9_]+ {0,1})) says (\[low\] ){0,1}\(cellphone\):.*$"
},

new Criteria
Expand Down Expand Up @@ -1212,7 +1221,7 @@ private void GenerateText()
Opacity = effectValue,
BlurRadius = effectValue,
Direction = effectValue,
ShadowDepth = effectValue,
ShadowDepth = effectValue
},

BlackBackgroundOpacity = SelectedBlock.BlackBackgroundOpacity
Expand Down Expand Up @@ -1258,6 +1267,12 @@ private string GetColor(string line)
return "#a6a4a6";//grey
}

// ReSharper disable once PossibleNullReferenceException
if (Regex.IsMatch(line, ParserSettings.Filters.FirstOrDefault(fod => fod.Name.Equals("Cellphone")).Filter) && !line.StartsWith(YourCharacterName))
{
return "#fcff16";
}

//money & item transfers
// ReSharper disable once PossibleNullReferenceException
if (Regex.IsMatch(line, ParserSettings.Filters.FirstOrDefault(fod => fod.Name.Equals("Payments")).Filter)
Expand Down Expand Up @@ -1369,6 +1384,8 @@ private void CacheCurrentImageAndText()
new ObservableCollection<CacheScreenshot>(ScreenCache.OrderByDescending(obd => obd.ScreenshotDate));

Xml.Serialize<ObservableCollection<CacheScreenshot>>($@"{CacheScreens}\screenshots.cache", ScreenCache);

RefreshCachedCommand.Execute(null);
}

/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion GTAWorld Screenshot Editor/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

Expand Down Expand Up @@ -355,7 +356,11 @@
</xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>

<xctk:RichTextBox x:Name="ParsedChatSmall" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="12"
<Label Grid.Column="0" Grid.Row="12">Your Character Name:</Label>
<xctk:AutoSelectTextBox Grid.Column="1" Grid.Row="12" AutoSelectBehavior="OnFocus"
Text="{Binding YourCharacterName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

<xctk:RichTextBox x:Name="ParsedChatSmall" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="13"
FontSize="15"
Text="{Binding SelectedBlock.ParsedChat, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Foreground="{DynamicResource MahApps.Brushes.Accent}"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="GTAWorld_Screenshot_Editor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<GTAWorld_Screenshot_Editor.Properties.Settings>
<setting name="DirectoryPath" serializeAs="String">
<value />
</setting>
<setting name="AccentTheme" serializeAs="String">
<value />
</setting>
<setting name="StrokeTextBoxOrWeb" serializeAs="String">
<value>True</value>
</setting>
</GTAWorld_Screenshot_Editor.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfCacheScreenshot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CacheScreenshot>
<Guid>3e77beb6-9b18-4c32-baad-1665cfa40026-aba8f7d2-b778-41a2-af5c-296a279a6767</Guid>
<ScreenshotDate>2022-01-07T20:14:06.9606327+02:00</ScreenshotDate>
<ImageFilePath>cached_screens\screenshot_20220107_081406.jpg</ImageFilePath>
<TextBlocks>
<TextBlockModel>
<Selected>true</Selected>
<Margin>
<Left>1637</Left>
<Top>1006.0066666666667</Top>
<Right>0</Right>
<Bottom>0</Bottom>
</Margin>
<BlockName>Text Block #1</BlockName>
<ParsedChat>John Doe says: Fuck you.
* John Doe flips your mom off.
John Doe says [low]: Fuck You.
</ParsedChat>
<BlackBackgroundOpacity>false</BlackBackgroundOpacity>
</TextBlockModel>
</TextBlocks>
<Text>
<Width>2176</Width>
<CanvasScale>100</CanvasScale>
<ParseLines>100</ParseLines>
</Text>
<Resolution>
<AllowEdit>false</AllowEdit>
<Name>1440p</Name>
<Width>2560</Width>
<Height>1440</Height>
</Resolution>
<NamesToCensor />
</CacheScreenshot>
<CacheScreenshot>
<Guid>9cf0e9ec-c179-4c57-ad67-bbc819df136c-84024c17-03cd-4aae-9ca5-e2cc343130d6</Guid>
<ScreenshotDate>2021-11-27T23:29:09.7721771+02:00</ScreenshotDate>
Expand Down
2 changes: 1 addition & 1 deletion GTAWorld Screenshot Editor/bin/Debug/parser.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</Criteria>
<Criteria>
<Name>Cellphone</Name>
<Filter>(\(cellphone\))</Filter>
<Filter>^((([\p{L}]+ {0,1} [\p{L}]+){0,1})|(Mask+[a-zA-Z0-9_]+ {0,1})) says (\[low\] ){0,1}\(cellphone\):.*$</Filter>
<Selected>true</Selected>
</Criteria>
<Criteria>
Expand Down
Binary file not shown.
Binary file not shown.
63 changes: 63 additions & 0 deletions GTAWorld Screenshot Editor/bin/Release/STAMPEDE.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
====================
[Date] 2022-01-17 21:35:09
[PC Name] STAMPEDE
[Error Message] The process cannot access the file 'C:\Users\xcast\Documents\GitHub\Screenshot_Editor\GTAWorld Screenshot Editor\bin\Release\cached_screens\screenshot_20220117_084043.jpg' because it is being used by another process.
[Stack Trace]
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at System.IO.File.Delete(String path)
at GTAWorld_Screenshot_Editor.MainViewModel.DeleteCachedImageExecute(Object obj)


[InnerException]

====================

====================
[Date] 2022-01-17 21:35:25
[PC Name] STAMPEDE
[Error Message] The process cannot access the file 'C:\Users\xcast\Documents\GitHub\Screenshot_Editor\GTAWorld Screenshot Editor\bin\Release\cached_screens\screenshot_20220117_084043.jpg' because it is being used by another process.
[Stack Trace]
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at System.IO.File.Delete(String path)
at GTAWorld_Screenshot_Editor.MainViewModel.DeleteCachedImageExecute(Object obj)


[InnerException]

====================

====================
[Date] 2022-01-17 21:35:36
[PC Name] STAMPEDE
[Error Message] The process cannot access the file 'C:\Users\xcast\Documents\GitHub\Screenshot_Editor\GTAWorld Screenshot Editor\bin\Release\cached_screens\screenshot_20220117_084043.jpg' because it is being used by another process.
[Stack Trace]
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at System.IO.File.Delete(String path)
at GTAWorld_Screenshot_Editor.MainViewModel.DeleteCachedImageExecute(Object obj)


[InnerException]

====================

====================
[Date] 2022-01-17 21:39:56
[PC Name] STAMPEDE
[Error Message] Object reference not set to an instance of an object.
[Stack Trace]
at System.Uri.CreateThisFromUri(Uri otherUri)
at System.Uri..ctor(Uri baseUri, Uri relativeUri)
at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
at System.Windows.Media.Imaging.BitmapImage.EndInit()
at GTAWorld_Screenshot_Editor.Models.CacheScreenshot.InitImage()
at GTAWorld_Screenshot_Editor.MainViewModel.CacheCurrentImageAndText()
at GTAWorld_Screenshot_Editor.MainViewModel.SaveCacheExecute(Object obj)


[InnerException]

====================

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 604a0bf

Please sign in to comment.