feat: add outgoing messages to client

This commit is contained in:
k0t9i
2023-02-09 22:45:08 +04:00
parent abcf3b20c0
commit ad5d7a5159
25 changed files with 739 additions and 74 deletions

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Client.Application.Commands
{
public class RelayCommand : ICommand
{
private Action<object?> execute;
private Func<object?, bool>? canExecute;
public event EventHandler? CanExecuteChanged
{
add { CommandManager.RequerySuggested += value; }
remove { CommandManager.RequerySuggested -= value; }
}
public RelayCommand(Action<object?> execute, Func<object?, bool>? canExecute = null)
{
this.execute = execute;
this.canExecute = canExecute;
}
public bool CanExecute(object? parameter)
{
return canExecute == null || canExecute(parameter);
}
public void Execute(object? parameter)
{
execute(parameter);
}
}
}

View File

@@ -3,7 +3,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Client.Application.Components"
xmlns:services="clr-namespace:Client.Application.Services"
xmlns:components="clr-namespace:Client.Application.Components"
mc:Ignorable="d"
@@ -11,7 +10,10 @@
services:SizeObserver.ObservedWidth="{Binding ViewportWidth, Mode=OneWayToSource}"
services:SizeObserver.ObservedHeight="{Binding ViewportHeight, Mode=OneWayToSource}"
>
<Grid>
<Grid Background="Transparent">
<Grid.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding MouseLeftClickCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Grid}}" />
</Grid.InputBindings>
<ItemsControl ItemsSource="{Binding Path=Blocks}">
<ItemsControl.Resources>
<services:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
@@ -55,21 +57,46 @@
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Path.RenderTransform>
</Path>
<Path x:Name="CreatureBody" StrokeThickness="2">
<Path.Data>
<EllipseGeometry
RadiusX="{Binding Radius,Mode=OneWay}"
RadiusY="{Binding Radius,Mode=OneWay}" />
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Path.RenderTransform>
</Path>
<Line x:Name="CreatureDirection" X1="0" Y1="0" X2="{Binding Direction.X,Mode=OneWay}" Y2="{Binding Direction.Y,Mode=OneWay}" StrokeThickness="2">
<Line.RenderTransform>
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Line.RenderTransform>
</Line>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsAggressive,Mode=OneWay}" Value="True">
<Setter TargetName="CreatureAggroRadius" Property="Visibility" Value="Visible" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl ItemsSource="{Binding Path=Creatures}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas ClipToBounds="True" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid x:Name="CreatureMain">
<Grid.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding MouseLeftClickCommand}" />
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding MouseLeftDoubleClickCommand}" />
<MouseBinding Gesture="RightClick" Command="{Binding MouseRightClickCommand}" />
</Grid.InputBindings>
<Path x:Name="CreatureBody" StrokeThickness="2" Fill="Transparent">
<Path.Data>
<EllipseGeometry
RadiusX="{Binding Radius,Mode=OneWay}"
RadiusY="{Binding Radius,Mode=OneWay}" />
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Path.RenderTransform>
</Path>
<Line x:Name="CreatureDirection" X1="0" Y1="0" X2="{Binding Direction.X,Mode=OneWay}" Y2="{Binding Direction.Y,Mode=OneWay}" StrokeThickness="2">
<Line.RenderTransform>
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Line.RenderTransform>
</Line>
</Grid>
<Grid x:Name="CreatureName" Visibility="Hidden" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.RenderTransform>
<TransformGroup>
@@ -125,9 +152,9 @@
<DataTrigger Binding="{Binding IsTarget,Mode=OneWay}" Value="True">
<Setter TargetName="CreatureName" Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding IsAggressive,Mode=OneWay}" Value="True">
<Setter TargetName="CreatureAggroRadius" Property="Visibility" Value="Visible" />
</DataTrigger>
<Trigger SourceName="CreatureMain" Property="IsMouseOver" Value="True">
<Setter TargetName="CreatureName" Property="Visibility" Value="Visible"></Setter>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
@@ -141,17 +168,52 @@
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Path StrokeThickness="2" Stroke="Gold">
<Path.Data>
<EllipseGeometry
RadiusX="{Binding Radius,Mode=OneWay}"
RadiusY="{Binding Radius,Mode=OneWay}" />
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Path.RenderTransform>
</Path>
<Grid x:Name="DropMain">
<Grid.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding MouseLeftClickCommand}" />
<MouseBinding Gesture="RightClick" Command="{Binding MouseRightClickCommand}" />
</Grid.InputBindings>
<Path StrokeThickness="2" Stroke="Gold" Fill="Transparent">
<Path.Data>
<EllipseGeometry
RadiusX="{Binding Radius,Mode=OneWay}"
RadiusY="{Binding Radius,Mode=OneWay}" />
</Path.Data>
<Path.RenderTransform>
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</Path.RenderTransform>
</Path>
</Grid>
<Grid x:Name="DropName" Visibility="Hidden" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="-2" ScaleY="-1" />
<TranslateTransform
X="{Binding Path=ActualWidth,RelativeSource={RelativeSource AncestorType=Grid}}"
Y="{Binding Path=ActualHeight,RelativeSource={RelativeSource AncestorType=Grid}}"
/>
<ScaleTransform ScaleX="-0.5" ScaleY="-1" />
<ScaleTransform ScaleY="-0.5" />
<TranslateTransform Y="{Binding Radius}" />
<ScaleTransform ScaleY="-2" />
<TranslateTransform X="{Binding Position.X,Mode=OneWay}" Y="{Binding Position.Y,Mode=OneWay}"/>
</TransformGroup>
</Grid.RenderTransform>
<TextBlock Text="{Binding Name,Mode=OneWay}" Foreground="Black" FontSize="11">
<TextBlock.Effect>
<BlurEffect
Radius="2"
KernelType="Box"/>
</TextBlock.Effect>
</TextBlock>
<TextBlock Text="{Binding Name,Mode=OneWay}" Foreground="White" FontSize="11"/>
</Grid>
</Grid>
<DataTemplate.Triggers>
<Trigger SourceName="DropMain" Property="IsMouseOver" Value="True">
<Setter TargetName="DropName" Property="Visibility" Value="Visible"></Setter>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

View File

@@ -8,7 +8,8 @@
mc:Ignorable="d"
IsEnabled="{Binding Path=IsButtonActive,ElementName=root,Mode=OneWay}"
ToolTipService.ShowOnDisabled="True"
x:Name="root">
x:Name="root"
Command="{Binding MouseLeftClickCommand}">
<Button.Resources>
<services:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<services:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>

View File

@@ -1,11 +1,14 @@
using Client.Domain.Common;
using Client.Application.Commands;
using Client.Domain.Common;
using Client.Domain.Entities;
using Client.Domain.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Client.Application.ViewModels
{
@@ -21,14 +24,36 @@ namespace Client.Application.ViewModels
public float DeltaZ => creature.DeltaZ(hero);
public CreatureListViewModel(CreatureInterface creature, Hero hero)
public ICommand MouseLeftClickCommand { get; }
public ICommand MouseLeftDoubleClickCommand { get; }
public ICommand MouseRightClickCommand { get; }
private void OnMouseLeftClick(object? obj)
{
worldHandler.RequestAcquireTarget(Id);
}
private void OnMouseLeftDoubleClick(object? obj)
{
worldHandler.RequestAttackOrFollow(Id);
}
private void OnMouseRightClick(object? obj)
{
worldHandler.RequestMoveToEntity(Id);
}
public CreatureListViewModel(CreatureInterface creature, Hero hero, WorldHandler worldHandler)
{
creature.PropertyChanged += Creature_PropertyChanged;
creature.Transform.Position.PropertyChanged += Position_PropertyChanged;
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
MouseLeftClickCommand = new RelayCommand(OnMouseLeftClick);
MouseLeftDoubleClickCommand = new RelayCommand(OnMouseLeftDoubleClick);
MouseRightClickCommand = new RelayCommand(OnMouseRightClick);
this.creature = creature;
this.hero = hero;
this.worldHandler = worldHandler;
}
private void HeroPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -57,5 +82,6 @@ namespace Client.Application.ViewModels
private readonly CreatureInterface creature;
private readonly Hero hero;
private readonly WorldHandler worldHandler;
}
}

View File

@@ -1,12 +1,17 @@
using Client.Domain.Common;
using Client.Domain.Entities;
using Client.Domain.Enums;
using Client.Domain.Service;
using Client.Domain.ValueObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Windows;
using Client.Application.Commands;
using System.Net.Http;
namespace Client.Application.ViewModels
{
@@ -56,20 +61,41 @@ namespace Client.Application.ViewModels
}
public CreatureTypeEnum Type => creature.Type;
public bool IsTarget => Id == hero.TargetId;
public bool IsAggressive => creature.AggroRadius > 0;
public bool IsAggressive => creature.AggroRadius > 0 && !creature.VitalStats.IsDead && creature.IsHostile;
public float AggroRadius => creature.AggroRadius / scale;
public ICommand MouseLeftClickCommand { get; }
public ICommand MouseLeftDoubleClickCommand { get; }
public ICommand MouseRightClickCommand { get; }
private void OnMouseLeftClick(object? obj)
{
worldHandler.RequestAcquireTarget(Id);
}
public CreatureMapViewModel(CreatureInterface creature, Hero hero)
private void OnMouseLeftDoubleClick(object? obj)
{
worldHandler.RequestAttackOrFollow(Id);
}
private void OnMouseRightClick(object? obj)
{
worldHandler.RequestMoveToEntity(Id);
}
public CreatureMapViewModel(CreatureInterface creature, Hero hero, WorldHandler worldHandler)
{
this.creature = creature;
this.hero = hero;
this.worldHandler = worldHandler;
creature.PropertyChanged += Creature_PropertyChanged;
creature.Transform.PropertyChanged += Transform_PropertyChanged;
creature.Transform.Position.PropertyChanged += Position_PropertyChanged;
creature.VitalStats.PropertyChanged += VitalStats_PropertyChanged;
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
hero.PropertyChanged += Hero_PropertyChanged;
MouseLeftClickCommand = new RelayCommand(OnMouseLeftClick);
MouseLeftDoubleClickCommand = new RelayCommand(OnMouseLeftDoubleClick);
MouseRightClickCommand = new RelayCommand(OnMouseRightClick);
}
private void VitalStats_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -78,6 +104,10 @@ namespace Client.Application.ViewModels
{
OnPropertyChanged("VitalStats");
}
if (e.PropertyName == "IsDead")
{
OnPropertyChanged("IsAggressive");
}
}
private void Hero_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -118,6 +148,7 @@ namespace Client.Application.ViewModels
private readonly CreatureInterface creature;
private readonly Hero hero;
private readonly WorldHandler worldHandler;
private float scale = 1;
private static readonly float MAX_RADIUS = 10;
private static readonly float MIN_RADIUS = 4;

View File

@@ -1,10 +1,13 @@
using Client.Domain.Common;
using Client.Application.Commands;
using Client.Domain.Common;
using Client.Domain.Entities;
using Client.Domain.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Client.Application.ViewModels
{
@@ -46,14 +49,14 @@ namespace Client.Application.ViewModels
{
get
{
return drop.Transform.Position.HorizontalDistance(hero.Transform.Position) / 100;
return drop.Transform.Position.HorizontalDistance(hero.Transform.Position);
}
}
public float DeltaZ
{
get
{
return (drop.Transform.Position.Z - hero.Transform.Position.Z) / 100;
return (drop.Transform.Position.Z - hero.Transform.Position.Z);
}
}
@@ -65,14 +68,27 @@ namespace Client.Application.ViewModels
}
}
public DropListViewModel(Drop drop, Hero hero)
public ICommand MouseLeftClickCommand { get; }
public ICommand MouseRightClickCommand { get; }
private void OnMouseLeftClick(object? obj)
{
worldHandler.RequestPickUp(Id);
}
private void OnMouseRightClick(object? obj)
{
worldHandler.RequestMoveToEntity(Id);
}
public DropListViewModel(Drop drop, Hero hero, WorldHandler worldHandler)
{
this.drop = drop;
this.hero = hero;
this.worldHandler = worldHandler;
drop.PropertyChanged += Drop_PropertyChanged;
drop.Transform.Position.PropertyChanged += DropPosition_PropertyChanged;
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
MouseLeftClickCommand = new RelayCommand(OnMouseLeftClick);
MouseRightClickCommand = new RelayCommand(OnMouseRightClick);
}
private void HeroPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -109,5 +125,6 @@ namespace Client.Application.ViewModels
private readonly Drop drop;
private readonly Hero hero;
private readonly WorldHandler worldHandler;
}
}

View File

@@ -8,13 +8,16 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using Client.Domain.Service;
using System.Windows.Input;
using Client.Application.Commands;
namespace Client.Application.ViewModels
{
public class DropMapViewModel : ObservableObject
{
public uint Id => drop.Id;
public string Name => drop.Name;
public string Name => drop.Name + " (" + drop.Amount + ")";
public Vector3 Position => new Vector3(
(drop.Transform.Position.X - hero.Transform.Position.X) / scale + (VieportSize.X / 2),
(drop.Transform.Position.Y - hero.Transform.Position.Y) / scale + (VieportSize.Y / 2),
@@ -47,13 +50,27 @@ namespace Client.Application.ViewModels
}
}
public DropMapViewModel(Drop drop, Hero hero)
public ICommand MouseLeftClickCommand { get; }
public ICommand MouseRightClickCommand { get; }
private void OnMouseLeftClick(object? obj)
{
worldHandler.RequestPickUp(Id);
}
private void OnMouseRightClick(object? obj)
{
worldHandler.RequestMoveToEntity(Id);
}
public DropMapViewModel(Drop drop, Hero hero, WorldHandler worldHandler)
{
this.drop = drop;
this.hero = hero;
this.worldHandler = worldHandler;
drop.PropertyChanged += Creature_PropertyChanged;
drop.Transform.Position.PropertyChanged += Position_PropertyChanged;
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
MouseLeftClickCommand = new RelayCommand(OnMouseLeftClick);
MouseRightClickCommand = new RelayCommand(OnMouseRightClick);
}
private void HeroPosition_PropertyChanged(object? sender, PropertyChangedEventArgs e)
@@ -68,7 +85,7 @@ namespace Client.Application.ViewModels
private void Creature_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "Name")
if (e.PropertyName == "Name" || e.PropertyName == "Amount")
{
OnPropertyChanged("Name");
}
@@ -76,6 +93,7 @@ namespace Client.Application.ViewModels
private readonly Drop drop;
private readonly Hero hero;
private readonly WorldHandler worldHandler;
private float scale = 1;
private static readonly float MAX_RADIUS = 8;
private static readonly float MIN_RADIUS = 2;

View File

@@ -1,6 +1,8 @@
using Client.Domain.Common;
using Client.Application.Components;
using Client.Domain.Common;
using Client.Domain.Entities;
using Client.Domain.Events;
using Client.Domain.Service;
using Client.Domain.ValueObjects;
using System;
using System.Collections.Generic;
@@ -57,7 +59,7 @@ namespace Client.Application.ViewModels
{
if (hero != null)
{
Creatures.Add(new CreatureListViewModel(@event.Creature, hero));
Creatures.Add(new CreatureListViewModel(@event.Creature, hero, worldHandler));
AddCreature(@event.Creature);
}
}
@@ -72,8 +74,8 @@ namespace Client.Application.ViewModels
{
if (hero != null)
{
Drops.Add(new DropListViewModel(@event.Drop, hero));
Map.Drops.Add(new DropMapViewModel(@event.Drop, hero));
Drops.Add(new DropListViewModel(@event.Drop, hero, worldHandler));
Map.Drops.Add(new DropMapViewModel(@event.Drop, hero, worldHandler));
}
}
@@ -94,11 +96,11 @@ namespace Client.Application.ViewModels
{
if (@event.Skill.IsActive)
{
ActiveSkills.Add(new SkillListViewModel(@event.Skill));
ActiveSkills.Add(new SkillListViewModel(worldHandler, @event.Skill));
}
else
{
PassiveSkills.Add(new SkillListViewModel(@event.Skill));
PassiveSkills.Add(new SkillListViewModel(worldHandler, @event.Skill));
}
}
}
@@ -126,7 +128,7 @@ namespace Client.Application.ViewModels
{
if (hero != null)
{
Map.Creatures.Add(new CreatureMapViewModel(creature, hero));
Map.Creatures.Add(new CreatureMapViewModel(creature, hero, worldHandler));
}
}
@@ -135,6 +137,12 @@ namespace Client.Application.ViewModels
Map.Creatures.RemoveAll(x => x.Id == id);
}
public MainViewModel(WorldHandler worldHandler)
{
this.worldHandler = worldHandler;
Map = new MapViewModel(worldHandler);
}
public ObservableCollection<ChatMessageViewModel> ChatMessages { get; } = new ObservableCollection<ChatMessageViewModel>();
public ObservableCollection<CreatureListViewModel> Creatures { get; } = new ObservableCollection<CreatureListViewModel>();
public ObservableCollection<DropListViewModel> Drops { get; } = new ObservableCollection<DropListViewModel>();
@@ -142,7 +150,8 @@ namespace Client.Application.ViewModels
public ObservableCollection<SkillListViewModel> PassiveSkills { get; } = new ObservableCollection<SkillListViewModel>();
public ObservableCollection<BaseItem> Items { get; } = new ObservableCollection<BaseItem>();
public HeroSummaryInfoViewModel? Hero { get; private set; }
public MapViewModel Map { get; private set; } = new MapViewModel();
public MapViewModel Map { get; private set; }
public Hero? hero;
private readonly WorldHandler worldHandler;
}
}

View File

@@ -11,6 +11,9 @@ using System.Threading.Tasks;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Collections.Specialized;
using Client.Application.Commands;
using System.Reflection.Metadata;
using System.Windows;
namespace Client.Application.ViewModels
{
@@ -125,10 +128,33 @@ namespace Client.Application.ViewModels
}
}
public MapViewModel()
public ICommand MouseLeftClickCommand { get; }
private void OnLeftMouseClick(object? obj)
{
if (obj == null)
{
return;
}
if (hero == null)
{
return;
}
Point mousePos = Mouse.GetPosition((IInputElement)obj);
var location = new Vector3(
(float)(mousePos.X - ViewportWidth / 2) * scale + hero.Transform.Position.X,
(float)(mousePos.Y - ViewportHeight / 2) * scale + hero.Transform.Position.Y,
hero.Transform.Position.Z
);
worldHandler.RequestMoveToLocation(location);
}
public MapViewModel(WorldHandler worldHandler)
{
Creatures.CollectionChanged += Creatures_CollectionChanged;
Drops.CollectionChanged += Drops_CollectionChanged;
this.worldHandler = worldHandler;
MouseLeftClickCommand = new RelayCommand(OnLeftMouseClick);
}
private void Drops_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
@@ -167,5 +193,6 @@ namespace Client.Application.ViewModels
private float scale = 8;
private double viewportWidth = 0;
private double viewportHeight = 0;
private readonly WorldHandler worldHandler;
}
}

View File

@@ -1,10 +1,13 @@
using Client.Domain.Common;
using Client.Domain.Entities;
using Client.Domain.Service;
using System.Windows.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Client.Application.Commands;
namespace Client.Application.ViewModels
{
@@ -21,11 +24,19 @@ namespace Client.Application.ViewModels
public uint? Cost => skill.Cost == 0 ? null : skill.Cost;
public int? Range => skill.Range <= 0 ? null : skill.Range;
public SkillListViewModel(Skill skill)
public ICommand MouseLeftClickCommand { get; }
private void OnLeftMouseClick(object? obj)
{
worldHandler.RequestUseSkill(Id, false, false);
}
public SkillListViewModel(WorldHandler worldHandler, Skill skill)
{
this.worldHandler = worldHandler;
this.skill = skill;
skill.PropertyChanged += Skill_PropertyChanged;
MouseLeftClickCommand = new RelayCommand(OnLeftMouseClick);
}
private void Skill_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
@@ -61,6 +72,7 @@ namespace Client.Application.ViewModels
}
}
private readonly WorldHandler worldHandler;
private readonly Skill skill;
}
}

View File

@@ -53,10 +53,15 @@
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<StackPanel.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding MouseLeftClickCommand}" />
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding MouseLeftDoubleClickCommand}" />
<MouseBinding Gesture="RightClick" Command="{Binding MouseRightClickCommand}" />
</StackPanel.InputBindings>
<TextBlock FontSize="16" Text="{Binding Path=Name,Mode=OneWay}" />
<TextBlock FontSize="11">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}; distance: {1:F2}m; delta z: {2:F2}m">
<MultiBinding StringFormat="{}{0}; distance: {1:F0}; delta z: {2:F0}">
<Binding Path="BriefInfo" Mode="OneWay"/>
<Binding Path="Distance" Mode="OneWay"/>
<Binding Path="DeltaZ" Mode="OneWay"/>
@@ -71,6 +76,10 @@
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<DockPanel.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding MouseLeftClickCommand}" />
<MouseBinding Gesture="RightClick" Command="{Binding MouseRightClickCommand}" />
</DockPanel.InputBindings>
<Image DockPanel.Dock="Left" Source="{Binding Path=IconName, FallbackValue=./Assets/icons/_fallback.png, Mode=OneWay}" Height="32" Width="32" />
<StackPanel Margin="5">
<TextBlock FontSize="16">
@@ -83,7 +92,7 @@
</TextBlock>
<TextBlock FontSize="11">
<TextBlock.Text>
<MultiBinding StringFormat="{}Count {0}; distance: {1:F2}m; delta z: {2:F2}m">
<MultiBinding StringFormat="{}Count {0}; distance: {1:F0}; delta z: {2:F0}">
<Binding Path="Amount" Mode="OneWay"/>
<Binding Path="Distance" Mode="OneWay"/>
<Binding Path="DeltaZ" Mode="OneWay"/>
@@ -146,7 +155,8 @@
</Button.Resources>
<Button.Content>
<Grid>
<Image Source="{Binding Path=ImageSource}" Height="32" Width="32" />
<!--Image Source="{Binding Path=ImageSource}" Height="32" Width="32" /-->
<TextBlock Text="{Binding Name,Mode=OneWay}" />
</Grid>
</Button.Content>
<Button.ToolTip >
@@ -270,8 +280,8 @@
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock Padding="0 0 0 3" Text="{Binding Distance,Mode=OneWay,StringFormat='{}{0:F2}m'}"></TextBlock>
<TextBlock Padding="0 0 0 3" Text="{Binding DeltaZ,Mode=OneWay,StringFormat='{}{0:F2}m'}"></TextBlock>
<TextBlock Padding="0 0 0 3" Text="{Binding Distance,Mode=OneWay,StringFormat='{}{0:F0}'}"></TextBlock>
<TextBlock Padding="0 0 0 3" Text="{Binding DeltaZ,Mode=OneWay,StringFormat='{}{0:F0}'}"></TextBlock>
</StackPanel>
</DockPanel>
</Grid>