Skip to content

Commit

Permalink
Replace old settings with simple json
Browse files Browse the repository at this point in the history
Remove PTP UI editor (outdated and unnecessary format)
  • Loading branch information
Meloman19 committed Oct 6, 2024
1 parent 67ef5f1 commit 31696cf
Show file tree
Hide file tree
Showing 71 changed files with 1,173 additions and 3,735 deletions.
2 changes: 2 additions & 0 deletions AuxiliaryLibraries/Media/PixelMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ public PixelMap(int width, int height, Pixel[] pixels)
public int Height => _height;

public Pixel[] Pixels => _pixels;

public bool IsEmpty => _pixels.Length == 0;
}
}
37 changes: 15 additions & 22 deletions PersonaEditor/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:converters="clr-namespace:PersonaEditor.Common.Converters"
xmlns:controls="clr-namespace:PersonaEditor.Controls"
xmlns:settings="clr-namespace:PersonaEditor.ApplicationSettings"
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:beh="clr-namespace:PersonaEditor.Common.Behaviors"
Expand All @@ -20,11 +19,11 @@

<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

<DrawingBrush x:Key="ImageBackground"
Viewport="0,0,50,50"
ViewportUnits="Absolute"
TileMode="Tile"
PresentationOptions:Freeze="True">
<DrawingBrush x:Key="DefaultImageTiledBackground"
Viewport="0,0,50,50"
ViewportUnits="Absolute"
TileMode="Tile"
PresentationOptions:Freeze="True">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="White">
Expand Down Expand Up @@ -54,13 +53,6 @@
</DrawingBrush.Drawing>
</DrawingBrush>

<SolidColorBrush x:Key="SPDEditorBackgroud"
Color="{Binding Source={x:Static settings:SPREditor.Default}, Path=BackgroundColor, Mode=OneWay}"/>
<SolidColorBrush x:Key="SPDEditorSelect"
Color="{Binding Source={x:Static settings:SPREditor.Default}, Path=SelectColor, Mode=OneWay}"/>
<SolidColorBrush x:Key="SPDEditorLine"
Color="{Binding Source={x:Static settings:SPREditor.Default}, Path=LineColor, Mode=OneWay}"/>

<StreamGeometry x:Key="ArrowUp">
M 0 4 L 4 0 L 8 4 L 7 5 L 4 2 L 1 5 Z
</StreamGeometry>
Expand Down Expand Up @@ -98,18 +90,19 @@
DataContext="{x:Null}"
Background="Transparent">
<Grid IsHitTestVisible="False">
<Rectangle Fill="{StaticResource ImageBackground}"
<Rectangle Fill="{StaticResource DefaultImageTiledBackground}"
Stroke="Black"
StrokeThickness="2" />
<Rectangle Fill="{StaticResource SPDEditorBackgroud}" />
<Rectangle Fill="{TemplateBinding Background}" />
<Image Source="{TemplateBinding TextureBitmap}" />
</Grid>

<controls:AtlasItemsContol
x:Name="ItemsControl"
SelectedObject="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=SelectedObject, Mode=TwoWay}"
ObjectBorderThickness="{TemplateBinding ObjectBorderThickness}"
ItemsSource="{TemplateBinding ObjectList}" />
<controls:AtlasItemsContol x:Name="ItemsControl"
SelectedItem="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=SelectedObject, Mode=TwoWay}"
ItemBorderThickness="{TemplateBinding ObjectBorderThickness}"
ItemBorderBrush="{TemplateBinding ObjectBorderBrush}"
ItemSelectionBrush="{TemplateBinding ObjectSelectionBrush}"
ItemsSource="{TemplateBinding ObjectList}" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand All @@ -120,10 +113,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AtlasObjectContainer}">
<Border BorderBrush="{StaticResource SPDEditorLine}"
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="Transparent">
<Rectangle Fill="{StaticResource SPDEditorSelect}"
<Rectangle Fill="{TemplateBinding Foreground}"
Opacity="0.4"
Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=IsSelected, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}" />
</Border>
Expand Down
20 changes: 13 additions & 7 deletions PersonaEditor/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
using System.Windows;
using System.Text;
using System.Threading;
using System.Text;
using PersonaEditor.Views;
using System.Windows;
using PersonaEditor.Common;
using PersonaEditor.Views;

namespace PersonaEditor
{
public partial class App : Application
{
private const string CURRENT_NAMED_PIPE = "PersonaEditor";

Mutex Mutex;
NamedPipeManager NamedPipeManager;
MainWindowVM MainWindowVM;
private Mutex Mutex;
private NamedPipeManager NamedPipeManager;
private MainWindowVM MainWindowVM;

public App()
{
Expand All @@ -22,7 +22,13 @@ public App()

private void Application_Startup(object sender, StartupEventArgs e)
{
if (ApplicationSettings.AppSetting.Default.SingleInstanceApplication)
try
{
Static.SettingsProvider.Load();
}
catch { }

if (Static.SettingsProvider.AppSettings.SingleInstanceApplication)
{
Mutex = new Mutex(true, CURRENT_NAMED_PIPE, out bool Is);
if (!Is)
Expand Down
242 changes: 0 additions & 242 deletions PersonaEditor/ApplicationSettings/AppSetting.Designer.cs

This file was deleted.

Loading

0 comments on commit 31696cf

Please sign in to comment.