Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings to change transparency colors #1995

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UndertaleModTool/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
<MenuItem Command="ApplicationCommands.Copy" />
<MenuItem Command="ApplicationCommands.Paste" />
</local:ContextMenuDark>
<SolidColorBrush x:Key="TransparencyGridColor1" Color="#FF666666"/>
<SolidColorBrush x:Key="TransparencyGridColor2" Color="#FF999999"/>
</Application.Resources>
</Application>
25 changes: 25 additions & 0 deletions UndertaleModTool/Controls/TransparencyGridBrush.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DrawingBrush x:Key="TransparencyGridBrushBrush" Stretch="None" TileMode="Tile" Viewport="0,0,16,16" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="{DynamicResource TransparencyGridColor1}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,8,8"/>
<RectangleGeometry Rect="8,8,8,8"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="{DynamicResource TransparencyGridColor2}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="8,0,8,8"/>
<RectangleGeometry Rect="0,8,8,8"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</ResourceDictionary>
19 changes: 8 additions & 11 deletions UndertaleModTool/Editors/UndertaleBackgroundEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
xmlns:undertale="clr-namespace:UndertaleModLib.Models;assembly=UndertaleModLib"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance undertale:UndertaleBackground}" DataContextChanged="DataUserControl_DataContextChanged">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Controls/TransparencyGridBrush.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
Expand Down Expand Up @@ -146,17 +153,7 @@
</Style.Triggers>
</Style>
</Canvas.Style>
<Border>
<Border.Background>
<DrawingBrush Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Geometry="M0,0 L20,0 20,20, 0,20Z" Brush="White"/>
<GeometryDrawing Geometry="M0,10 L20,10 20,20, 10,20 10,0 0,0Z" Brush="LightGray"/>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Border.Background>
<Border Background="{DynamicResource TransparencyGridBrushBrush}">
<local:UndertaleTexturePageItemDisplay DataContext="{Binding Texture, Mode=OneWay}"/>
</Border>
<Rectangle Name="TileRectangle" Canvas.Left="0" Canvas.Top="0" Width="{Binding GMS2TileWidth, Mode=OneWay}" Height="{Binding GMS2TileHeight, Mode=OneWay}" Stroke="#FFB23131" Panel.ZIndex="50" StrokeThickness="2" SnapsToDevicePixels="True"
Expand Down
24 changes: 9 additions & 15 deletions UndertaleModTool/Editors/UndertaleEmbeddedTextureEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance undertale:UndertaleEmbeddedTexture}"
DataContextChanged="DataUserControl_DataContextChanged" Loaded="DataUserControl_Loaded" Unloaded="DataUserControl_Unloaded">
<UserControl.Resources>
<local:BooleanToVisibilityConverter x:Key="BoolFalseToVisConverter" local:trueValue="Collapsed" local:falseValue="Visible"/>
<local:TextureLoadedWrapper x:Key="TextureLoadedWrapper"/>
<local:IsVersionAtLeastConverter x:Key="IsVersionAtLeastConverter"/>
<ResourceDictionary>
<local:BooleanToVisibilityConverter x:Key="BoolFalseToVisConverter" local:trueValue="Collapsed" local:falseValue="Visible"/>
<local:TextureLoadedWrapper x:Key="TextureLoadedWrapper"/>
<local:IsVersionAtLeastConverter x:Key="IsVersionAtLeastConverter"/>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Controls/TransparencyGridBrush.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
Expand Down Expand Up @@ -76,18 +81,7 @@
</ScrollViewer.Background>
<Viewbox Name="TextureViewbox" Stretch="Uniform" StretchDirection="DownOnly"
SnapsToDevicePixels="True" RenderOptions.BitmapScalingMode="NearestNeighbor" MouseWheel="TextureViewbox_MouseWheel">
<Border>
<Border.Background>
<DrawingBrush Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Geometry="M0,0 L20,0 20,20, 0,20Z" Brush="White"/>
<GeometryDrawing Geometry="M0,10 L20,10 20,20, 10,20 10,0 0,0Z" Brush="LightGray"/>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Border.Background>

<Border Background="{DynamicResource TransparencyGridBrushBrush}">
<Grid Cursor="Hand" MouseDown="Grid_MouseDown" MouseMove="Grid_MouseMove" MouseLeave="Grid_MouseLeave">
<Image Name="TexturePageImage"/>
<Canvas>
Expand Down
83 changes: 39 additions & 44 deletions UndertaleModTool/Editors/UndertaleGameObjectEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,44 @@
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="800" d:DataContext="{d:DesignInstance undertale:UndertaleGameObject}">
<UserControl.Resources>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="CollisionShapeFlags">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:CollisionShapeFlags" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeKey">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeKey" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeStep">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeStep" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeMouse">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeMouse" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeOther">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeOther" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeDraw">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeDraw" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<local:EventNameConverter x:Key="EventNameConverter"/>
<local:GameObjectByIdConverter x:Key="GameObjectByIdConverter"/>
<local:IsGMS2Converter x:Key="IsGMS2Converter" />
<ResourceDictionary>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="CollisionShapeFlags">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:CollisionShapeFlags" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeKey">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeKey" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeStep">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeStep" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeMouse">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeMouse" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeOther">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeOther" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EventSubtypeDraw">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:EventSubtypeDraw" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<local:EventNameConverter x:Key="EventNameConverter"/>
<local:GameObjectByIdConverter x:Key="GameObjectByIdConverter"/>
<local:IsGMS2Converter x:Key="IsGMS2Converter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Controls/TransparencyGridBrush.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

<!--
Leaving this here for now, I might want to add it back for 'advanced' editor
Expand Down Expand Up @@ -198,17 +203,7 @@
<ListView.ItemTemplate>
<DataTemplate>
<Viewbox Stretch="Uniform" StretchDirection="DownOnly">
<Border>
<Border.Background>
<DrawingBrush Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Geometry="M0,0 L20,0 20,20, 0,20Z" Brush="White"/>
<GeometryDrawing Geometry="M0,10 L20,10 20,20, 10,20 10,0 0,0Z" Brush="LightGray"/>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Border.Background>
<Border Background="{DynamicResource TransparencyGridBrushBrush}">
<local:UndertaleTexturePageItemDisplay DataContext="{Binding Texture, Mode=OneWay}"/>
</Border>
</Viewbox>
Expand Down
69 changes: 32 additions & 37 deletions UndertaleModTool/Editors/UndertaleParticleSystemEmitterEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,37 @@
mc:Ignorable="d"
d:DesignHeight="4500" d:DesignWidth="800" d:DataContext="{d:DesignInstance undertale:UndertaleParticleSystemEmitter}">
<UserControl.Resources>
<local:IsVersionAtLeastConverter x:Key="IsVersionAtLeastConverter"/>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EmitMode">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+EmitMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="DistributionEnum">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+DistributionEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EmitterShape">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+EmitterShape" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="TextureEnum">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+TextureEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="TimeUnitEnum">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+TimeUnitEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ResourceDictionary>
<local:IsVersionAtLeastConverter x:Key="IsVersionAtLeastConverter"/>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EmitMode">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+EmitMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="DistributionEnum">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+DistributionEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="EmitterShape">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+EmitterShape" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="TextureEnum">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+TextureEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="TimeUnitEnum">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="undertale:UndertaleParticleSystemEmitter+TimeUnitEnum" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Controls/TransparencyGridBrush.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>

<Grid>
Expand Down Expand Up @@ -180,17 +185,7 @@
<ListView.ItemTemplate>
<DataTemplate>
<Viewbox Stretch="Uniform" StretchDirection="DownOnly">
<Border>
<Border.Background>
<DrawingBrush Stretch="None" TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Geometry="M0,0 L20,0 20,20, 0,20Z" Brush="White"/>
<GeometryDrawing Geometry="M0,10 L20,10 20,20, 10,20 10,0 0,0Z" Brush="LightGray"/>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Border.Background>
<Border Background="{DynamicResource TransparencyGridBrushBrush}">
<local:UndertaleTexturePageItemDisplay DataContext="{Binding Texture, Mode=OneWay}"/>
</Border>
</Viewbox>
Expand Down
Loading
Loading