Skip to content

Commit 18a71f0

Browse files
feat: green selection outline, remove brush panel, add protocol 1100
- Change item selection outline from blue (#89b4fa) to green (#a6e3a1) in item list, composition grid, and map catalog - Remove custom brushes panel (Row 5) from map editor sidebar (redundant with existing Brush Editor window) - Add protocol 1100 (client 11.00) support to DAT parser with signature detection and fallback array
1 parent 1d7e986 commit 18a71f0

2 files changed

Lines changed: 9 additions & 61 deletions

File tree

src/App/MainWindow.axaml

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@
669669
<Setter Property="Background" Value="Transparent"/>
670670
</Style>
671671
<Style Selector="ListBoxItem:selected Border.compCell">
672-
<Setter Property="BorderBrush" Value="#89b4fa"/>
672+
<Setter Property="BorderBrush" Value="#a6e3a1"/>
673673
</Style>
674674
</ListBox.Styles>
675675
<ListBox.ItemTemplate>
@@ -1639,7 +1639,7 @@
16391639
<Border Grid.Column="1" Background="#181825" CornerRadius="8" Margin="0,0,6,0" Padding="0"
16401640
IsVisible="{Binding Palette, Converter={x:Static ObjectConverters.IsNotNull}}"
16411641
x:DataType="vm:MainWindowViewModel">
1642-
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*" DataContext="{Binding Palette}"
1642+
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,*" DataContext="{Binding Palette}"
16431643
x:DataType="vm:PaletteViewModel" Margin="6,8,6,6">
16441644

16451645
<!-- Row 0: Collection selector -->
@@ -1857,61 +1857,8 @@
18571857
</DockPanel>
18581858
</Border>
18591859

1860-
<!-- Row 5: Custom brushes -->
1861-
<Border Grid.Row="5" Background="#11111b" CornerRadius="4" Padding="4,3" Margin="0,0,0,4">
1862-
<DockPanel>
1863-
<TextBlock DockPanel.Dock="Left" Text="Brush" FontSize="9" Foreground="#585b70"
1864-
VerticalAlignment="Center" Margin="0,0,6,0"/>
1865-
<Button DockPanel.Dock="Right" Classes="toolbar" Padding="4,2" Margin="2,0,0,0"
1866-
ToolTip.Tip="New Brush" Command="{Binding AddBrushCommand}">
1867-
<i:Icon Value="fa-solid fa-plus" FontSize="9"/>
1868-
</Button>
1869-
<Button DockPanel.Dock="Right" Classes="toolbar" Padding="4,2" Margin="2,0,0,0"
1870-
ToolTip.Tip="Delete Brush"
1871-
Command="{Binding RemoveBrushCommand}"
1872-
CommandParameter="{Binding SelectedBrush}">
1873-
<i:Icon Value="fa-solid fa-trash" FontSize="9" Foreground="#f38ba8"/>
1874-
</Button>
1875-
<Button DockPanel.Dock="Right" Classes="toolbar" Padding="4,2" Margin="2,0,0,0"
1876-
ToolTip.Tip="Edit Brush Items"
1877-
Command="{Binding EditBrushCommand}">
1878-
<i:Icon Value="fa-solid fa-pen" FontSize="9"/>
1879-
</Button>
1880-
<Button DockPanel.Dock="Right" Classes="toolbar" Padding="4,2" Margin="2,0,0,0"
1881-
ToolTip.Tip="Rename Brush"
1882-
Command="{Binding SelectedBrush.BeginRenameCommand}">
1883-
<i:Icon Value="fa-solid fa-i-cursor" FontSize="9"/>
1884-
</Button>
1885-
<Panel>
1886-
<ComboBox ItemsSource="{Binding CustomBrushes}"
1887-
SelectedItem="{Binding SelectedBrush}"
1888-
IsVisible="{Binding SelectedBrush.IsRenaming, Converter={x:Static BoolConverters.Not}, FallbackValue=True}"
1889-
FontSize="11" Padding="6,4" MinHeight="0" MaxHeight="28"
1890-
Background="#1e1e2e" Foreground="#cdd6f4" BorderBrush="#313244"
1891-
CornerRadius="4" HorizontalAlignment="Stretch">
1892-
<ComboBox.ItemTemplate>
1893-
<DataTemplate x:DataType="vm:CustomBrushViewModel">
1894-
<StackPanel Orientation="Horizontal" Spacing="6">
1895-
<i:Icon Value="fa-solid fa-paintbrush" FontSize="9" Foreground="#f9e2af"/>
1896-
<TextBlock Text="{Binding Name}" FontSize="11"/>
1897-
<TextBlock Text="{Binding Items.Count, StringFormat='({0})'}"
1898-
FontSize="9" Foreground="#585b70" VerticalAlignment="Center"/>
1899-
</StackPanel>
1900-
</DataTemplate>
1901-
</ComboBox.ItemTemplate>
1902-
</ComboBox>
1903-
<TextBox IsVisible="{Binding SelectedBrush.IsRenaming, FallbackValue=False}"
1904-
Text="{Binding SelectedBrush.RenameText, Mode=TwoWay}"
1905-
FontSize="11" Padding="6,4" MinHeight="0" MaxHeight="28"
1906-
Background="#11111b" Foreground="#cdd6f4" BorderBrush="#89b4fa"
1907-
CornerRadius="4" HorizontalAlignment="Stretch"
1908-
KeyDown="OnBrushRenameKeyDown"/>
1909-
</Panel>
1910-
</DockPanel>
1911-
</Border>
1912-
1913-
<!-- Row 6: Items grid (unified catalog + search) -->
1914-
<Grid Grid.Row="6" RowDefinitions="Auto,*,Auto">
1860+
<!-- Row 5: Items grid (unified catalog + search) -->
1861+
<Grid Grid.Row="5" RowDefinitions="Auto,*,Auto">
19151862
<TextBox Grid.Row="0" Watermark="Search items..."
19161863
Text="{Binding CatalogSearchText}" FontSize="10"
19171864
Background="#11111b" Foreground="#cdd6f4" BorderBrush="#313244"
@@ -1929,7 +1876,7 @@
19291876
<Border Width="36" Height="36" Background="#313244" CornerRadius="3" Margin="1"
19301877
ToolTip.Tip="{Binding Tooltip}" Cursor="Hand"
19311878
BorderThickness="{Binding IsHighlighted, Converter={StaticResource BoolToHighlightThickness}}"
1932-
BorderBrush="White"
1879+
BorderBrush="#a6e3a1"
19331880
DoubleTapped="OnCatalogItemDoubleTapped"
19341881
PointerPressed="OnCatalogItemPressed">
19351882
<Border.ContextMenu>

src/OTB/DatFile.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace AssetsAndMapEditor.OTB;
55

66
/// <summary>
77
/// Tibia.dat parser supporting multiple protocol versions.
8-
/// Supports MetadataFlags6 (1098+), and legacy protocols (854, 860).
8+
/// Supports MetadataFlags6 (1100, 1098+), and legacy protocols (854, 860).
99
/// </summary>
1010
public static class DatFile
1111
{
@@ -48,7 +48,7 @@ public static DatData Load(string path, int protocolHint = 0)
4848
}
4949

5050
// Fallback: try every other protocol with both extended modes
51-
int[] allProtocols = [1098, 1076, 1057, 1050, 960, 860, 854, 810, 800, 790, 780, 770, 760, 750, 740];
51+
int[] allProtocols = [1100, 1098, 1076, 1057, 1050, 960, 860, 854, 810, 800, 790, 780, 770, 760, 750, 740];
5252
foreach (var proto in allProtocols)
5353
{
5454
if (proto == primary) continue;
@@ -93,7 +93,8 @@ public static int DetectProtocol(uint signature)
9393
0x4E97D9D4 => 1057,
9494
0x500F744E => 1076,
9595
0x50C5A941 => 1098,
96-
_ => 1098,
96+
0x51D6A2D3 => 1100,
97+
_ => 1100,
9798
};
9899
}
99100

0 commit comments

Comments
 (0)