RynthSuite as of 2026-09-05 (internal a5ff5c2)
A snapshot of the working tree for aelrynth.com/git/: the code, build files and public docs. Internal review notes and agent instructions are left out. MIT licensed; see LICENSE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
0a4b611a90
166 changed files with 186537 additions and 0 deletions
10
Tools/RynthCore.MonsterEditor/App.axaml
Normal file
10
Tools/RynthCore.MonsterEditor/App.axaml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<Application xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="RynthCore.MonsterEditor.App"
|
||||
RequestedThemeVariant="Dark">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
|
||||
<StyleInclude Source="avares://RynthCore.MonsterEditor/Styles.axaml"/>
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
25
Tools/RynthCore.MonsterEditor/App.axaml.cs
Normal file
25
Tools/RynthCore.MonsterEditor/App.axaml.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
|
||||
namespace RynthCore.MonsterEditor;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public override void Initialize() => AvaloniaXamlLoader.Load(this);
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
Dispatcher.UIThread.UnhandledException += (_, e) =>
|
||||
{
|
||||
Program.Log($"DISPATCHER: {e.Exception}");
|
||||
e.Handled = false;
|
||||
};
|
||||
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||
desktop.MainWindow = new MainWindow();
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
9
Tools/RynthCore.MonsterEditor/JsonContext.cs
Normal file
9
Tools/RynthCore.MonsterEditor/JsonContext.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RynthCore.MonsterEditor;
|
||||
|
||||
[JsonSerializable(typeof(List<MonsterRule>))]
|
||||
[JsonSerializable(typeof(EditorSettings))]
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, IncludeFields = true)]
|
||||
internal partial class EditorJsonContext : JsonSerializerContext { }
|
||||
227
Tools/RynthCore.MonsterEditor/MainWindow.axaml
Normal file
227
Tools/RynthCore.MonsterEditor/MainWindow.axaml
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:RynthCore.MonsterEditor"
|
||||
x:Class="RynthCore.MonsterEditor.MainWindow"
|
||||
Title="RynthAi — Monster Rules Editor"
|
||||
Width="1060" Height="520" MinWidth="800" MinHeight="300">
|
||||
|
||||
<DockPanel LastChildFill="True">
|
||||
|
||||
<!-- Status bar -->
|
||||
<Border DockPanel.Dock="Bottom" Background="#181825" BorderBrush="#45475A"
|
||||
BorderThickness="0,1,0,0" Padding="4,2">
|
||||
<TextBlock Name="StatusText" Foreground="#A6E3A1"/>
|
||||
</Border>
|
||||
|
||||
<!-- Add row -->
|
||||
<Border DockPanel.Dock="Bottom" Background="#252536" BorderBrush="#45475A"
|
||||
BorderThickness="0,1,0,0" Padding="8,5">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock Text="Add Monster:" VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||
<TextBox Name="NewMonsterBox" Width="200" VerticalAlignment="Center"
|
||||
KeyDown="NewMonsterBox_KeyDown"/>
|
||||
<Button Content="Add" Margin="4,0,0,0" Click="AddMonster_Click" Width="55"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Main grid -->
|
||||
<DataGrid Name="MonsterGrid"
|
||||
ItemsSource="{Binding Rules}"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
SelectionMode="Single"
|
||||
HeadersVisibility="Column"
|
||||
CellEditEnding="MonsterGrid_CellEditEnding">
|
||||
<DataGrid.Columns>
|
||||
|
||||
<!-- Toggle lights — letter shown inside each button; tooltip on hover -->
|
||||
<DataGridTemplateColumn Header="F" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="F"
|
||||
IsChecked="{Binding Fester, Mode=TwoWay}"
|
||||
ToolTip.Tip="Fester — Decrepitude's Grasp"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="B" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="B"
|
||||
IsChecked="{Binding Broadside, Mode=TwoWay}"
|
||||
ToolTip.Tip="Broadside — Broadside of a Barn"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="G" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="G"
|
||||
IsChecked="{Binding GravityWell, Mode=TwoWay}"
|
||||
ToolTip.Tip="Gravity Well — Vulnerability Other"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="I" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="I"
|
||||
IsChecked="{Binding Imperil, Mode=TwoWay}"
|
||||
ToolTip.Tip="Imperil — Gossamer Flesh"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Y" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="Y"
|
||||
IsChecked="{Binding Yield, Mode=TwoWay}"
|
||||
ToolTip.Tip="Yield — Magic Yield Other"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="V" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="V"
|
||||
IsChecked="{Binding Vuln, Mode=TwoWay}"
|
||||
ToolTip.Tip="Vuln — Vulnerability (element-matched)"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="A" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="A"
|
||||
IsChecked="{Binding UseArc, Mode=TwoWay}"
|
||||
ToolTip.Tip="Arc — War/Void arc spells"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="Bl" Width="26" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="Bl"
|
||||
IsChecked="{Binding UseBolt, Mode=TwoWay}"
|
||||
ToolTip.Tip="Bolt — War/Void bolt spells (none set = buff bot mode)"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="R" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="R"
|
||||
IsChecked="{Binding UseRing, Mode=TwoWay}"
|
||||
ToolTip.Tip="Ring — Ring spells (uses Ring Range setting)"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTemplateColumn Header="S" Width="24" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<ToggleButton Classes="light" Content="S"
|
||||
IsChecked="{Binding UseStreak, Mode=TwoWay}"
|
||||
ToolTip.Tip="Streak — War/Void streak spells"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Name -->
|
||||
<DataGridTemplateColumn Header="Name" Width="*" MinWidth="100">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding Name}"
|
||||
Padding="3,1"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{Binding IsDefault, Converter={x:Static local:DefaultFgConverter.Instance}}"
|
||||
FontWeight="{Binding IsDefault, Converter={x:Static local:DefaultWeightConverter.Instance}}"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<TextBox Text="{Binding Name, Mode=TwoWay}" Padding="3,1"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Priority -->
|
||||
<DataGridTemplateColumn Header="P" Width="32" MinWidth="30">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding Priority}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<TextBox Text="{Binding Priority, Mode=TwoWay}" Padding="3,1"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Damage Type -->
|
||||
<DataGridTemplateColumn Header="Dmg Type" Width="84" MinWidth="70">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding DamageType}" Padding="3,1" VerticalAlignment="Center"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding $parent[Window].((local:MainWindow)DataContext).DmgOptions}"
|
||||
SelectedItem="{Binding DamageType, Mode=TwoWay}"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Ex Vuln -->
|
||||
<DataGridTemplateColumn Header="Ex Vuln" Width="84" MinWidth="70">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding ExVuln}" Padding="3,1" VerticalAlignment="Center"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding $parent[Window].((local:MainWindow)DataContext).VulnOptions}"
|
||||
SelectedItem="{Binding ExVuln, Mode=TwoWay}"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Weapon -->
|
||||
<DataGridTemplateColumn Header="Weapon" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding WeaponId, Converter={x:Static local:IdToNameConverter.Instance}}"
|
||||
Padding="3,1" VerticalAlignment="Center"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding $parent[Window].((local:MainWindow)DataContext).WeaponOptions}"
|
||||
SelectedItem="{Binding WeaponId, Converter={x:Static local:OptionFromIdConverter.Instance}, Mode=TwoWay}"
|
||||
ItemTemplate="{x:Null}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:WeaponOption">
|
||||
<TextBlock Text="{Binding DisplayName}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Offhand -->
|
||||
<DataGridTemplateColumn Header="Offhand" Width="140">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding OffhandId, Converter={x:Static local:IdToNameConverter.Instance}}"
|
||||
Padding="3,1" VerticalAlignment="Center"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding $parent[Window].((local:MainWindow)DataContext).WeaponOptions}"
|
||||
SelectedItem="{Binding OffhandId, Converter={x:Static local:OptionFromIdConverter.Instance}, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="local:WeaponOption">
|
||||
<TextBlock Text="{Binding DisplayName}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Pet Damage -->
|
||||
<DataGridTemplateColumn Header="Pet Dmg" Width="74" MinWidth="60">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<TextBlock Text="{Binding PetDamage}" Padding="3,1" VerticalAlignment="Center"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate><DataTemplate>
|
||||
<ComboBox ItemsSource="{Binding $parent[Window].((local:MainWindow)DataContext).PetOptions}"
|
||||
SelectedItem="{Binding PetDamage, Mode=TwoWay}"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<!-- Delete -->
|
||||
<DataGridTemplateColumn Header="Del" Width="34" CanUserResize="False" CanUserSort="False">
|
||||
<DataGridTemplateColumn.CellTemplate><DataTemplate>
|
||||
<Button Content="X" Tag="{Binding}" Click="DeleteRow_Click"
|
||||
Padding="2,0" FontSize="11"
|
||||
IsVisible="{Binding IsDefault, Converter={x:Static local:InvertBoolConverter.Instance}}"/>
|
||||
</DataTemplate></DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
326
Tools/RynthCore.MonsterEditor/MainWindow.axaml.cs
Normal file
326
Tools/RynthCore.MonsterEditor/MainWindow.axaml.cs
Normal file
|
|
@ -0,0 +1,326 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.Threading;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
namespace RynthCore.MonsterEditor;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public ObservableCollection<MonsterRule> Rules { get; } = new();
|
||||
public ObservableCollection<WeaponOption> WeaponOptions { get; } = new();
|
||||
|
||||
public string[] DmgOptions { get; } =
|
||||
{ "Auto", "Slash", "Pierce", "Bludgeon", "Fire", "Cold", "Lightning", "Acid", "Nether" };
|
||||
public string[] VulnOptions { get; } =
|
||||
{ "None", "Slash", "Pierce", "Bludgeon", "Fire", "Cold", "Lightning", "Acid", "Nether" };
|
||||
public string[] PetOptions { get; } =
|
||||
{ "PAuto", "Slash", "Pierce", "Bludgeon", "Fire", "Cold", "Lightning", "Acid", "Nether" };
|
||||
|
||||
private string _charFolder = string.Empty;
|
||||
private string _monstersPath = string.Empty;
|
||||
private bool _initialized;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
|
||||
Opened += MainWindow_Opened;
|
||||
}
|
||||
|
||||
private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||
|
||||
private async void MainWindow_Opened(object? sender, EventArgs e)
|
||||
{
|
||||
if (_initialized) return;
|
||||
_initialized = true;
|
||||
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
if (args.Length > 1)
|
||||
OpenCharFolder(args[1].Trim('"'));
|
||||
else
|
||||
await PromptOpenFileAsync();
|
||||
}
|
||||
|
||||
// ── Open / Load ──────────────────────────────────────────────────────────
|
||||
|
||||
private async System.Threading.Tasks.Task PromptOpenFileAsync()
|
||||
{
|
||||
var sp = StorageProvider;
|
||||
if (sp == null) return;
|
||||
|
||||
var pick = await sp.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||
{
|
||||
Title = "Open monsters.json",
|
||||
AllowMultiple = false,
|
||||
FileTypeFilter = new[]
|
||||
{
|
||||
new FilePickerFileType("Monster Rules") { Patterns = new[] { "monsters.json" } },
|
||||
new FilePickerFileType("All Files") { Patterns = new[] { "*" } },
|
||||
}
|
||||
});
|
||||
|
||||
var file = pick.FirstOrDefault();
|
||||
if (file == null)
|
||||
{
|
||||
SetStatus("No file opened.", error: true);
|
||||
return;
|
||||
}
|
||||
|
||||
string? path = file.TryGetLocalPath();
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
OpenCharFolder(Path.GetDirectoryName(path)!);
|
||||
}
|
||||
|
||||
private void OpenCharFolder(string charFolder)
|
||||
{
|
||||
_charFolder = charFolder;
|
||||
_monstersPath = Path.Combine(charFolder, "monsters.json");
|
||||
Title = $"RynthAi — Monster Rules — {Path.GetFileName(charFolder)}";
|
||||
|
||||
LoadWeaponOptions();
|
||||
LoadRules();
|
||||
}
|
||||
|
||||
private void LoadWeaponOptions()
|
||||
{
|
||||
WeaponOptions.Clear();
|
||||
WeaponOptions.Add(new WeaponOption { Id = 0, DisplayName = "<AUTO>" });
|
||||
|
||||
try
|
||||
{
|
||||
string markerPath = Path.Combine(_charFolder, "active_profile.txt");
|
||||
string profile = File.Exists(markerPath) ? File.ReadAllText(markerPath).Trim() : "Default";
|
||||
string profilePath = Path.Combine(_charFolder, profile + ".json");
|
||||
|
||||
if (File.Exists(profilePath))
|
||||
{
|
||||
string json = File.ReadAllText(profilePath);
|
||||
var settings = JsonSerializer.Deserialize(json, EditorJsonContext.Default.EditorSettings);
|
||||
if (settings?.ItemRules != null)
|
||||
{
|
||||
foreach (var item in settings.ItemRules)
|
||||
WeaponOptions.Add(new WeaponOption { Id = item.Id, DisplayName = item.Name });
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { /* weapon dropdowns will just show <AUTO> */ }
|
||||
|
||||
IdToNameConverter.Instance.Options = WeaponOptions;
|
||||
OptionFromIdConverter.Instance.Options = WeaponOptions;
|
||||
}
|
||||
|
||||
private void LoadRules()
|
||||
{
|
||||
foreach (var r in Rules) r.PropertyChanged -= Rule_Changed;
|
||||
Rules.Clear();
|
||||
|
||||
if (File.Exists(_monstersPath))
|
||||
{
|
||||
try
|
||||
{
|
||||
string json = File.ReadAllText(_monstersPath);
|
||||
var rules = JsonSerializer.Deserialize(json, EditorJsonContext.Default.ListMonsterRule);
|
||||
if (rules != null)
|
||||
foreach (var r in rules) AddRule(r);
|
||||
}
|
||||
catch (Exception ex) { SetStatus($"Load error: {ex.Message}", error: true); return; }
|
||||
}
|
||||
|
||||
EnsureDefault();
|
||||
|
||||
SetStatus(Rules.Count > 0
|
||||
? $"Loaded {Rules.Count} rule(s) from {_monstersPath}"
|
||||
: $"No monsters.json found — starting empty. Saving will create {_monstersPath}");
|
||||
}
|
||||
|
||||
private void EnsureDefault()
|
||||
{
|
||||
for (int i = Rules.Count - 1; i >= 1; i--)
|
||||
if (Rules[i].IsDefault) { Rules[i].PropertyChanged -= Rule_Changed; Rules.RemoveAt(i); }
|
||||
|
||||
if (Rules.Count > 0 && Rules[0].IsDefault)
|
||||
return;
|
||||
|
||||
int existing = -1;
|
||||
for (int i = 0; i < Rules.Count; i++)
|
||||
if (Rules[i].IsDefault) { existing = i; break; }
|
||||
|
||||
if (existing > 0)
|
||||
Rules.Move(existing, 0);
|
||||
else
|
||||
Rules.Insert(0, new MonsterRule { Name = "Default", Priority = 1 });
|
||||
|
||||
Rules[0].PropertyChanged -= Rule_Changed;
|
||||
Rules[0].PropertyChanged += Rule_Changed;
|
||||
}
|
||||
|
||||
private void AddRule(MonsterRule rule)
|
||||
{
|
||||
rule.PropertyChanged += Rule_Changed;
|
||||
Rules.Add(rule);
|
||||
}
|
||||
|
||||
// ── Save ─────────────────────────────────────────────────────────────────
|
||||
|
||||
private void Rule_Changed(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
=> Save();
|
||||
|
||||
private void MonsterGrid_CellEditEnding(object? sender, DataGridCellEditEndingEventArgs e)
|
||||
{
|
||||
Dispatcher.UIThread.Post(Save, DispatcherPriority.Background);
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_monstersPath)) return;
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(_charFolder);
|
||||
string json = JsonSerializer.Serialize(new List<MonsterRule>(Rules), EditorJsonContext.Default.ListMonsterRule);
|
||||
File.WriteAllText(_monstersPath, json);
|
||||
SetStatus($"Saved {Rules.Count} rule(s) — {DateTime.Now:HH:mm:ss}");
|
||||
}
|
||||
catch (Exception ex) { SetStatus($"Save error: {ex.Message}", error: true); }
|
||||
}
|
||||
|
||||
// ── Row actions ──────────────────────────────────────────────────────────
|
||||
|
||||
private void AddMonster_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var nameBox = this.FindControl<TextBox>("NewMonsterBox");
|
||||
if (nameBox == null) return;
|
||||
|
||||
string name = (nameBox.Text ?? string.Empty).Trim();
|
||||
if (string.IsNullOrWhiteSpace(name)) return;
|
||||
|
||||
var rule = new MonsterRule { Name = name };
|
||||
AddRule(rule);
|
||||
|
||||
var grid = this.FindControl<DataGrid>("MonsterGrid");
|
||||
if (grid != null)
|
||||
{
|
||||
grid.ScrollIntoView(rule, null);
|
||||
grid.SelectedItem = rule;
|
||||
}
|
||||
nameBox.Text = string.Empty;
|
||||
Save();
|
||||
}
|
||||
|
||||
private void NewMonsterBox_KeyDown(object? sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Enter) AddMonster_Click(sender, e);
|
||||
}
|
||||
|
||||
private void DeleteRow_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { Tag: MonsterRule rule } && !rule.IsDefault)
|
||||
{
|
||||
rule.PropertyChanged -= Rule_Changed;
|
||||
Rules.Remove(rule);
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
// ── Helpers ──────────────────────────────────────────────────────────────
|
||||
|
||||
private void SetStatus(string msg, bool error = false)
|
||||
{
|
||||
var status = this.FindControl<TextBlock>("StatusText");
|
||||
if (status == null) return;
|
||||
|
||||
status.Foreground = error
|
||||
? new SolidColorBrush(Color.FromRgb(0xF3, 0x8B, 0xA8))
|
||||
: new SolidColorBrush(Color.FromRgb(0xA6, 0xE3, 0xA1));
|
||||
status.Text = msg;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Converters ────────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>int weapon/offhand id → display name (read-only).</summary>
|
||||
public class IdToNameConverter : IValueConverter
|
||||
{
|
||||
public static readonly IdToNameConverter Instance = new();
|
||||
public IReadOnlyList<WeaponOption> Options { get; set; } = Array.Empty<WeaponOption>();
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is int id)
|
||||
{
|
||||
if (id == 0) return "<AUTO>";
|
||||
foreach (var opt in Options)
|
||||
if (opt.Id == id) return opt.DisplayName;
|
||||
return $"<ID:{id}>";
|
||||
}
|
||||
return "<AUTO>";
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>int id ↔ WeaponOption. Used for ComboBox SelectedItem on an int-backed property.</summary>
|
||||
public class OptionFromIdConverter : IValueConverter
|
||||
{
|
||||
public static readonly OptionFromIdConverter Instance = new();
|
||||
public IReadOnlyList<WeaponOption> Options { get; set; } = Array.Empty<WeaponOption>();
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is int id)
|
||||
foreach (var opt in Options)
|
||||
if (opt.Id == id) return opt;
|
||||
return null;
|
||||
}
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> value is WeaponOption opt ? opt.Id : 0;
|
||||
}
|
||||
|
||||
/// <summary>IsDefault → yellow; else default Foreground colour. WPF DataTriggers have no Avalonia equivalent.</summary>
|
||||
public class DefaultFgConverter : IValueConverter
|
||||
{
|
||||
public static readonly DefaultFgConverter Instance = new();
|
||||
private static readonly IBrush DefaultYellow = new SolidColorBrush(Color.FromRgb(0xF9, 0xE2, 0xAF));
|
||||
private static readonly IBrush Normal = new SolidColorBrush(Color.FromRgb(0xCD, 0xD6, 0xF4));
|
||||
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> value is true ? DefaultYellow : Normal;
|
||||
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public class DefaultWeightConverter : IValueConverter
|
||||
{
|
||||
public static readonly DefaultWeightConverter Instance = new();
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> value is true ? FontWeight.SemiBold : FontWeight.Normal;
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>True → false, False → true (IsVisible on Delete button for the Default row).</summary>
|
||||
public class InvertBoolConverter : IValueConverter
|
||||
{
|
||||
public static readonly InvertBoolConverter Instance = new();
|
||||
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> value is not true;
|
||||
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
=> value is not true;
|
||||
}
|
||||
68
Tools/RynthCore.MonsterEditor/Models.cs
Normal file
68
Tools/RynthCore.MonsterEditor/Models.cs
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace RynthCore.MonsterEditor;
|
||||
|
||||
public class MonsterRule : INotifyPropertyChanged
|
||||
{
|
||||
private string _name = "New Monster";
|
||||
private int _priority = 1;
|
||||
private string _damageType = "Auto";
|
||||
private int _weaponId;
|
||||
private bool _fester, _broadside, _gravityWell, _imperil, _yield, _vuln;
|
||||
private bool _useArc, _useBolt = true, _useRing, _useStreak;
|
||||
private string _exVuln = "None";
|
||||
private int _offhandId;
|
||||
private string _petDamage = "PAuto";
|
||||
|
||||
public string Name { get => _name; set { _name = value; OnPropertyChanged(); } }
|
||||
public int Priority { get => _priority; set { _priority = value; OnPropertyChanged(); } }
|
||||
public string DamageType { get => _damageType; set { _damageType = value; OnPropertyChanged(); } }
|
||||
public int WeaponId { get => _weaponId; set { _weaponId = value; OnPropertyChanged(); } }
|
||||
public bool Fester { get => _fester; set { _fester = value; OnPropertyChanged(); } }
|
||||
public bool Broadside { get => _broadside; set { _broadside = value; OnPropertyChanged(); } }
|
||||
public bool GravityWell { get => _gravityWell; set { _gravityWell = value; OnPropertyChanged(); } }
|
||||
public bool Imperil { get => _imperil; set { _imperil = value; OnPropertyChanged(); } }
|
||||
public bool Yield { get => _yield; set { _yield = value; OnPropertyChanged(); } }
|
||||
public bool Vuln { get => _vuln; set { _vuln = value; OnPropertyChanged(); } }
|
||||
public bool UseArc { get => _useArc; set { _useArc = value; OnPropertyChanged(); } }
|
||||
public bool UseBolt { get => _useBolt; set { _useBolt = value; OnPropertyChanged(); } }
|
||||
public bool UseRing { get => _useRing; set { _useRing = value; OnPropertyChanged(); } }
|
||||
public bool UseStreak { get => _useStreak; set { _useStreak = value; OnPropertyChanged(); } }
|
||||
public string ExVuln { get => _exVuln; set { _exVuln = value; OnPropertyChanged(); } }
|
||||
public int OffhandId { get => _offhandId; set { _offhandId = value; OnPropertyChanged(); } }
|
||||
public string PetDamage { get => _petDamage; set { _petDamage = value; OnPropertyChanged(); } }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsDefault => string.Equals(_name, "Default", System.StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
protected void OnPropertyChanged([CallerMemberName] string? name = null)
|
||||
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
|
||||
}
|
||||
|
||||
public class ItemRule
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Action { get; set; } = "Loot";
|
||||
public string Element { get; set; } = "Slash";
|
||||
public bool KeepBuffed { get; set; } = true;
|
||||
}
|
||||
|
||||
/// <summary>Minimal slice of the settings profile — only what the editor needs for dropdowns.</summary>
|
||||
public class EditorSettings
|
||||
{
|
||||
public List<MonsterRule> MonsterRules { get; set; } = new();
|
||||
public List<ItemRule> ItemRules { get; set; } = new();
|
||||
}
|
||||
|
||||
/// <summary>Used by weapon/offhand ComboBoxes: maps weapon ID → display name.</summary>
|
||||
public class WeaponOption
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public override string ToString() => DisplayName;
|
||||
}
|
||||
39
Tools/RynthCore.MonsterEditor/Program.cs
Normal file
39
Tools/RynthCore.MonsterEditor/Program.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using Avalonia;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace RynthCore.MonsterEditor;
|
||||
|
||||
class Program
|
||||
{
|
||||
internal static readonly string LogPath =
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "MonsterEditor.log");
|
||||
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += (_, e) =>
|
||||
Log($"UNHANDLED: {e.ExceptionObject}");
|
||||
|
||||
try
|
||||
{
|
||||
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log($"FATAL: {ex}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void Log(string msg)
|
||||
{
|
||||
try { File.AppendAllText(LogPath, $"[{DateTime.Now:HH:mm:ss}] {msg}\n"); }
|
||||
catch { /* best-effort */ }
|
||||
}
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp() =>
|
||||
AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.LogToTrace();
|
||||
}
|
||||
21
Tools/RynthCore.MonsterEditor/RynthCore.MonsterEditor.csproj
Normal file
21
Tools/RynthCore.MonsterEditor/RynthCore.MonsterEditor.csproj
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<AssemblyName>RynthCore.MonsterEditor</AssemblyName>
|
||||
<RootNamespace>RynthCore.MonsterEditor</RootNamespace>
|
||||
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
|
||||
<UseWpf>false</UseWpf>
|
||||
<UseWindowsForms>false</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.2.3" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
162
Tools/RynthCore.MonsterEditor/Styles.axaml
Normal file
162
Tools/RynthCore.MonsterEditor/Styles.axaml
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Styles.Resources>
|
||||
<SolidColorBrush x:Key="BgMain" Color="#1E1E2E"/>
|
||||
<SolidColorBrush x:Key="BgPanel" Color="#252536"/>
|
||||
<SolidColorBrush x:Key="BgInput" Color="#313244"/>
|
||||
<SolidColorBrush x:Key="BgHover" Color="#252538"/>
|
||||
<SolidColorBrush x:Key="BgSelect" Color="#2D2D44"/>
|
||||
<SolidColorBrush x:Key="BgAltRow" Color="#181825"/>
|
||||
<SolidColorBrush x:Key="FgMain" Color="#CDD6F4"/>
|
||||
<SolidColorBrush x:Key="FgHeader" Color="#89B4FA"/>
|
||||
<SolidColorBrush x:Key="FgDefault" Color="#F9E2AF"/>
|
||||
<SolidColorBrush x:Key="FgStatus" Color="#A6E3A1"/>
|
||||
<SolidColorBrush x:Key="FgError" Color="#F38BA8"/>
|
||||
<SolidColorBrush x:Key="Border" Color="#45475A"/>
|
||||
<SolidColorBrush x:Key="GridLine" Color="#2A2A3A"/>
|
||||
</Styles.Resources>
|
||||
|
||||
<Style Selector="Window">
|
||||
<Setter Property="Background" Value="{StaticResource BgMain}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="FontFamily" Value="Segoe UI,sans-serif"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="Background" Value="{StaticResource BgInput}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="5,3"/>
|
||||
<Setter Property="CaretBrush" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="SelectionBrush" Value="{StaticResource BgSelect}"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
</Style>
|
||||
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Background" Value="{StaticResource BgInput}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="8,3"/>
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
</Style>
|
||||
<Style Selector="Button:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{StaticResource BgHover}"/>
|
||||
</Style>
|
||||
<Style Selector="Button:pressed /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{StaticResource BgSelect}"/>
|
||||
</Style>
|
||||
|
||||
<Style Selector="ComboBox">
|
||||
<Setter Property="Background" Value="{StaticResource BgInput}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="5,1"/>
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
<Setter Property="MinHeight" Value="22"/>
|
||||
</Style>
|
||||
<Style Selector="ComboBoxItem">
|
||||
<Setter Property="Background" Value="{StaticResource BgPanel}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="Padding" Value="8,4"/>
|
||||
</Style>
|
||||
<Style Selector="ComboBoxItem:selected /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{StaticResource BgSelect}"/>
|
||||
</Style>
|
||||
<Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter">
|
||||
<Setter Property="Background" Value="{StaticResource BgHover}"/>
|
||||
</Style>
|
||||
|
||||
<!-- Toggle-light: small labeled square button used for each monster flag. -->
|
||||
<Style Selector="ToggleButton.light">
|
||||
<Setter Property="Width" Value="18"/>
|
||||
<Setter Property="Height" Value="16"/>
|
||||
<Setter Property="Margin" Value="1,1"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="MinWidth" Value="18"/>
|
||||
<Setter Property="MinHeight" Value="16"/>
|
||||
<Setter Property="Background" Value="#404040"/>
|
||||
<Setter Property="Foreground" Value="#909090"/>
|
||||
<Setter Property="BorderBrush" Value="#555555"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="FontSize" Value="8"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
ToolTip.Tip="{TemplateBinding ToolTip.Tip}">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Content}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
FontWeight="{TemplateBinding FontWeight}"
|
||||
Foreground="{TemplateBinding Foreground}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ToggleButton.light:checked">
|
||||
<Setter Property="Background" Value="#22AA22"/>
|
||||
<Setter Property="BorderBrush" Value="#44CC44"/>
|
||||
<Setter Property="Foreground" Value="#FFFFFF"/>
|
||||
</Style>
|
||||
<Style Selector="ToggleButton.light:pointerover">
|
||||
<Setter Property="Opacity" Value="0.80"/>
|
||||
</Style>
|
||||
|
||||
<!-- DataGrid styling -->
|
||||
<Style Selector="DataGrid">
|
||||
<Setter Property="Background" Value="{StaticResource BgAltRow}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
|
||||
<Setter Property="GridLinesVisibility" Value="All"/>
|
||||
<Setter Property="VerticalGridLinesBrush" Value="{StaticResource GridLine}"/>
|
||||
<Setter Property="HorizontalGridLinesBrush" Value="{StaticResource GridLine}"/>
|
||||
<Setter Property="RowBackground" Value="{StaticResource BgAltRow}"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="{StaticResource BgInput}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgHeader}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Border}"/>
|
||||
<Setter Property="BorderThickness" Value="0,0,1,1"/>
|
||||
<Setter Property="Padding" Value="3,2"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridCell">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource FgMain}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Padding" Value="2,1"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridRow">
|
||||
<Setter Property="Background" Value="{StaticResource BgAltRow}"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridRow:nth-child(2n)">
|
||||
<Setter Property="Background" Value="{StaticResource BgMain}"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridRow:pointerover /template/ Rectangle#BackgroundRectangle">
|
||||
<Setter Property="Fill" Value="{StaticResource BgHover}"/>
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridRow:selected /template/ Rectangle#BackgroundRectangle">
|
||||
<Setter Property="Fill" Value="{StaticResource BgSelect}"/>
|
||||
<Setter Property="Opacity" Value="1"/>
|
||||
</Style>
|
||||
|
||||
</Styles>
|
||||
Loading…
Reference in a new issue