feat: add view models for all entities
@ -9,20 +9,21 @@ using Client.Domain.Transports;
|
||||
using Client.Infrastructure.Transports;
|
||||
using Client.Domain.Entities;
|
||||
using Client.Domain.Service;
|
||||
using BaseApp = System.Windows.Application;
|
||||
using Client.Domain.ValueObjects;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System.Reflection;
|
||||
using Client.Application.Views;
|
||||
using Client.Domain.ViewModels;
|
||||
using Client.Application.ViewModels;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : BaseApp
|
||||
public partial class App : System.Windows.Application
|
||||
{
|
||||
public static IHost? AppHost { get; private set; }
|
||||
public static IConfiguration? AppConfig { get; private set; }
|
||||
|
||||
public App()
|
||||
{
|
||||
@ -40,7 +41,7 @@ namespace Client
|
||||
var startupForm = AppHost.Services.GetRequiredService<MainWindow>();
|
||||
startupForm.Show();
|
||||
|
||||
var application = AppHost.Services.GetRequiredService<Application>();
|
||||
var application = AppHost.Services.GetRequiredService<Bot>();
|
||||
application.StartAsync();
|
||||
|
||||
base.OnStartup(e);
|
||||
@ -63,8 +64,8 @@ namespace Client
|
||||
.AddSingleton(typeof(IConfiguration), config)
|
||||
.AddSingleton<MainWindow>()
|
||||
.AddSingleton(
|
||||
typeof(Application),
|
||||
x => new Application(
|
||||
typeof(Bot),
|
||||
x => new Bot(
|
||||
x.GetRequiredService<TransportInterface>(),
|
||||
x.GetRequiredService<MessageParserInterface>(),
|
||||
x.GetRequiredService<EntityHandlerFactoryInterface>(),
|
||||
@ -86,11 +87,13 @@ namespace Client
|
||||
.AddTransient(typeof(EntityFactoryInterface<Player>), typeof(EntityFactory<Player>))
|
||||
.AddTransient(typeof(EntityFactoryInterface<ChatMessage>), typeof(EntityFactory<ChatMessage>))
|
||||
|
||||
.AddSingleton<EntityHandler<Hero>>()
|
||||
.AddSingleton<EntityHandler<Drop>>()
|
||||
.AddSingleton<EntityHandler<NPC>>()
|
||||
.AddSingleton<EntityHandler<Player>>()
|
||||
.AddSingleton<ChatMessageHandler>();
|
||||
.AddSingleton<HeroHandler>()
|
||||
.AddSingleton<DropHandler>()
|
||||
.AddSingleton<NpcHandler>()
|
||||
.AddSingleton<PlayerHandler>()
|
||||
.AddSingleton<ChatMessageHandler>()
|
||||
|
||||
.AddSingleton(typeof(MainViewModelInterface), typeof(MainViewModel));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
55
Client/Application/ViewModels/ChatMessageViewModel.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using Client.Domain.Enums;
|
||||
using Client.Domain.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public class ChatMessageViewModel
|
||||
{
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return message.Name + ": " + message.Text;
|
||||
}
|
||||
}
|
||||
|
||||
public SolidColorBrush Color
|
||||
{
|
||||
get
|
||||
{
|
||||
SolidColorBrush? color;
|
||||
if (!colors.TryGetValue(message.Channel, out color))
|
||||
{
|
||||
color = defaultColor;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
public ChatMessageViewModel(ChatMessage message)
|
||||
{
|
||||
this.message = message;
|
||||
|
||||
colors = new Dictionary<ChatChannelEnum, SolidColorBrush>
|
||||
{
|
||||
{ ChatChannelEnum.Shout, Brushes.OrangeRed },
|
||||
{ ChatChannelEnum.Tell, Brushes.Magenta },
|
||||
{ ChatChannelEnum.Party, Brushes.LimeGreen },
|
||||
{ ChatChannelEnum.Clan, Brushes.Violet },
|
||||
{ ChatChannelEnum.Gm, Brushes.Red },
|
||||
{ ChatChannelEnum.Trade, Brushes.HotPink }
|
||||
};
|
||||
}
|
||||
|
||||
private readonly ChatMessage message;
|
||||
private readonly Dictionary<ChatChannelEnum, SolidColorBrush> colors;
|
||||
private readonly SolidColorBrush defaultColor = Brushes.Black;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public interface CreatureListViewModelInterface
|
||||
{
|
||||
uint Id { get; }
|
||||
string Title { get; }
|
||||
string Info { get; }
|
||||
float Distance { get; }
|
||||
float DeltaZ { get; }
|
||||
}
|
||||
}
|
113
Client/Application/ViewModels/DropListViewModel.cs
Normal file
@ -0,0 +1,113 @@
|
||||
using Client.Domain.Common;
|
||||
using Client.Domain.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public class DropListViewModel : NotifyPropertyChanged
|
||||
{
|
||||
public uint Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return drop.Id;
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return drop.Name;
|
||||
}
|
||||
}
|
||||
|
||||
public uint Amount
|
||||
{
|
||||
get
|
||||
{
|
||||
return drop.Amount;
|
||||
}
|
||||
}
|
||||
|
||||
public uint ItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
return drop.ItemId;
|
||||
}
|
||||
}
|
||||
|
||||
public float Distance
|
||||
{
|
||||
get
|
||||
{
|
||||
return drop.Transform.Position.HorizontalDistance(hero.Transform.Position) / 100;
|
||||
}
|
||||
}
|
||||
public float DeltaZ
|
||||
{
|
||||
get
|
||||
{
|
||||
return (drop.Transform.Position.Z - hero.Transform.Position.Z) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
public string IconName
|
||||
{
|
||||
get
|
||||
{
|
||||
return "/Assets/icons/" + drop.IconName + ".png";
|
||||
}
|
||||
}
|
||||
|
||||
public DropListViewModel(Drop drop, Hero hero)
|
||||
{
|
||||
this.drop = drop;
|
||||
this.hero = hero;
|
||||
|
||||
drop.PropertyChanged += Drop_PropertyChanged;
|
||||
drop.Transform.Position.PropertyChanged += DropPosition_PropertyChanged;
|
||||
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
|
||||
}
|
||||
|
||||
private void HeroPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Distance");
|
||||
OnPropertyChanged("DeltaZ");
|
||||
}
|
||||
|
||||
private void DropPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Distance");
|
||||
OnPropertyChanged("DeltaZ");
|
||||
}
|
||||
|
||||
private void Drop_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Name")
|
||||
{
|
||||
OnPropertyChanged("Name");
|
||||
}
|
||||
if (e.PropertyName == "Amount")
|
||||
{
|
||||
OnPropertyChanged("Amount");
|
||||
}
|
||||
if (e.PropertyName == "ItemId")
|
||||
{
|
||||
OnPropertyChanged("ItemId");
|
||||
}
|
||||
if (e.PropertyName == "IconName")
|
||||
{
|
||||
OnPropertyChanged("IconName");
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Drop drop;
|
||||
private readonly Hero hero;
|
||||
}
|
||||
}
|
124
Client/Application/ViewModels/HeroSummaryInfoViewModel.cs
Normal file
@ -0,0 +1,124 @@
|
||||
using Client.Domain.Common;
|
||||
using Client.Domain.Entities;
|
||||
using Client.Domain.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public class HeroSummaryInfoViewModel : NotifyPropertyChanged
|
||||
{
|
||||
public string Fullname
|
||||
{
|
||||
get
|
||||
{
|
||||
return hero.FullName.Nickname;
|
||||
}
|
||||
}
|
||||
public string Race
|
||||
{
|
||||
get
|
||||
{
|
||||
//toto race string
|
||||
return hero.Phenotype.Race.ToString();
|
||||
}
|
||||
}
|
||||
public string Class
|
||||
{
|
||||
get
|
||||
{
|
||||
//todo class string
|
||||
return hero.Phenotype.Class.ToString();
|
||||
}
|
||||
}
|
||||
public string Level
|
||||
{
|
||||
get
|
||||
{
|
||||
return hero.ExperienceInfo.Level.ToString();
|
||||
}
|
||||
}
|
||||
public Vector3 Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return hero.Transform.Position;
|
||||
}
|
||||
}
|
||||
public ExperienceInfo Experience
|
||||
{
|
||||
get
|
||||
{
|
||||
return hero.ExperienceInfo;
|
||||
}
|
||||
}
|
||||
public HeroSummaryInfoViewModel(Hero hero)
|
||||
{
|
||||
this.hero = hero;
|
||||
|
||||
hero.FullName.PropertyChanged += FullName_PropertyChanged;
|
||||
hero.Phenotype.PropertyChanged += Phenotype_PropertyChanged;
|
||||
hero.ExperienceInfo.PropertyChanged += ExperienceInfo_PropertyChanged;
|
||||
hero.Transform.Position.PropertyChanged += Position_PropertyChanged;
|
||||
}
|
||||
|
||||
private void Position_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Position");
|
||||
}
|
||||
|
||||
private void Phenotype_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Class")
|
||||
{
|
||||
OnPropertyChanged("Class");
|
||||
}
|
||||
if (e.PropertyName == "Race")
|
||||
{
|
||||
OnPropertyChanged("Race");
|
||||
}
|
||||
}
|
||||
|
||||
private void ExperienceInfo_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Level")
|
||||
{
|
||||
OnPropertyChanged("Level");
|
||||
}
|
||||
if (e.PropertyName == "Exp" || e.PropertyName == "ExpToLevel")
|
||||
{
|
||||
OnPropertyChanged("Experience");
|
||||
}
|
||||
}
|
||||
|
||||
private void FullName_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Nickname")
|
||||
{
|
||||
OnPropertyChanged("Fullname");
|
||||
}
|
||||
}
|
||||
|
||||
private void Hero_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Fullname")
|
||||
{
|
||||
OnPropertyChanged("Fullname");
|
||||
}
|
||||
if (e.PropertyName == "Phenotype")
|
||||
{
|
||||
OnPropertyChanged("Class");
|
||||
OnPropertyChanged("Race");
|
||||
}
|
||||
if (e.PropertyName == "ExperienceInfo")
|
||||
{
|
||||
OnPropertyChanged("Level");
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Hero hero;
|
||||
}
|
||||
}
|
101
Client/Application/ViewModels/MainViewModel.cs
Normal file
@ -0,0 +1,101 @@
|
||||
using Client.Domain.Common;
|
||||
using Client.Domain.Entities;
|
||||
using Client.Domain.ValueObjects;
|
||||
using Client.Domain.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public class MainViewModel : NotifyPropertyChanged, MainViewModelInterface
|
||||
{
|
||||
|
||||
public void AddChatMessage(ChatMessage chatMessage)
|
||||
{
|
||||
ChatMessages.Add(new ChatMessageViewModel(chatMessage));
|
||||
}
|
||||
|
||||
public void CreateHero(Hero hero)
|
||||
{
|
||||
Hero = new HeroSummaryInfoViewModel(hero);
|
||||
this.hero = hero;
|
||||
OnPropertyChanged("Hero");
|
||||
}
|
||||
public void DeleteHero()
|
||||
{
|
||||
Hero = null;
|
||||
hero = null;
|
||||
OnPropertyChanged("Hero");
|
||||
}
|
||||
|
||||
public void AddNpc(NPC npc)
|
||||
{
|
||||
if (hero != null)
|
||||
{
|
||||
Creatures.Add(new NpcListViewModel(npc, hero));
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveNpc(NPC npc)
|
||||
{
|
||||
foreach (var item in Creatures)
|
||||
{
|
||||
if (item.Id == npc.Id)
|
||||
{
|
||||
Creatures.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddPlayer(Player player)
|
||||
{
|
||||
if (hero != null)
|
||||
{
|
||||
Creatures.Add(new PlayerListViewModel(player, hero));
|
||||
}
|
||||
}
|
||||
|
||||
public void RemovePlayer(Player player)
|
||||
{
|
||||
foreach (var item in Creatures)
|
||||
{
|
||||
if (item.Id == player.Id)
|
||||
{
|
||||
Creatures.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddDrop(Drop drop)
|
||||
{
|
||||
if (hero != null)
|
||||
{
|
||||
Drops.Add(new DropListViewModel(drop, hero));
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveDrop(Drop drop)
|
||||
{
|
||||
foreach (var item in Drops)
|
||||
{
|
||||
if (item.Id == drop.Id)
|
||||
{
|
||||
Drops.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<ChatMessageViewModel> ChatMessages { get; } = new ObservableCollection<ChatMessageViewModel>();
|
||||
public ObservableCollection<CreatureListViewModelInterface> Creatures { get; } = new ObservableCollection<CreatureListViewModelInterface>();
|
||||
public ObservableCollection<DropListViewModel> Drops { get; } = new ObservableCollection<DropListViewModel>();
|
||||
public HeroSummaryInfoViewModel? Hero { get; private set; }
|
||||
public Hero? hero;
|
||||
}
|
||||
}
|
107
Client/Application/ViewModels/NpcListViewModel.cs
Normal file
@ -0,0 +1,107 @@
|
||||
using Client.Domain.Common;
|
||||
using Client.Domain.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public class NpcListViewModel : NotifyPropertyChanged, CreatureListViewModelInterface
|
||||
{
|
||||
public uint Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return npc.Id;
|
||||
}
|
||||
}
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
string result = "";
|
||||
|
||||
if (npc.IsDead())
|
||||
{
|
||||
result += "Dead ";
|
||||
}
|
||||
result += npc.FullName.Nickname + "[" + npc.NpcId + "]";
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public string Info
|
||||
{
|
||||
get
|
||||
{
|
||||
string result = "Npc";
|
||||
|
||||
if (npc.IsHostile)
|
||||
{
|
||||
result = "Monster";
|
||||
//todo aggr
|
||||
}
|
||||
//todo level
|
||||
return result;
|
||||
}
|
||||
}
|
||||
public float Distance
|
||||
{
|
||||
get
|
||||
{
|
||||
return npc.Transform.Position.HorizontalDistance(hero.Transform.Position) / 100;
|
||||
}
|
||||
}
|
||||
public float DeltaZ
|
||||
{
|
||||
get
|
||||
{
|
||||
return (npc.Transform.Position.Z - hero.Transform.Position.Z) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
public NpcListViewModel(NPC npc, Hero hero)
|
||||
{
|
||||
this.npc = npc;
|
||||
this.hero = hero;
|
||||
|
||||
npc.VitalStats.PropertyChanged += VitalStats_PropertyChanged;
|
||||
npc.FullName.PropertyChanged += FullName_PropertyChanged;
|
||||
npc.Transform.Position.PropertyChanged += NpcPosition_PropertyChanged;
|
||||
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
|
||||
}
|
||||
|
||||
private void NpcPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Distance");
|
||||
OnPropertyChanged("DeltaZ");
|
||||
}
|
||||
|
||||
private void HeroPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Distance");
|
||||
OnPropertyChanged("DeltaZ");
|
||||
}
|
||||
|
||||
private void FullName_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Nickname")
|
||||
{
|
||||
OnPropertyChanged("Title");
|
||||
}
|
||||
}
|
||||
|
||||
private void VitalStats_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Hp" || e.PropertyName == "MaxHp")
|
||||
{
|
||||
OnPropertyChanged("Title");
|
||||
}
|
||||
}
|
||||
|
||||
private readonly NPC npc;
|
||||
private readonly Hero hero;
|
||||
}
|
||||
}
|
92
Client/Application/ViewModels/PlayerListViewModel.cs
Normal file
@ -0,0 +1,92 @@
|
||||
using Client.Domain.Common;
|
||||
using Client.Domain.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Application.ViewModels
|
||||
{
|
||||
public class PlayerListViewModel : NotifyPropertyChanged, CreatureListViewModelInterface
|
||||
{
|
||||
public uint Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return player.Id;
|
||||
}
|
||||
}
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return player.FullName.Nickname;
|
||||
}
|
||||
}
|
||||
public string Info
|
||||
{
|
||||
get
|
||||
{
|
||||
//todo race and class strings
|
||||
return player.Phenotype.Race.ToString() + ", " + player.Phenotype.Class.ToString();
|
||||
}
|
||||
}
|
||||
public float Distance
|
||||
{
|
||||
get
|
||||
{
|
||||
return player.Transform.Position.HorizontalDistance(hero.Transform.Position) / 100;
|
||||
}
|
||||
}
|
||||
public float DeltaZ
|
||||
{
|
||||
get
|
||||
{
|
||||
return (player.Transform.Position.Z - hero.Transform.Position.Z) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
public PlayerListViewModel(Player player, Hero hero)
|
||||
{
|
||||
this.player = player;
|
||||
this.hero = hero;
|
||||
|
||||
player.Phenotype.PropertyChanged += Phenotype_PropertyChanged;
|
||||
player.FullName.PropertyChanged += FullName_PropertyChanged;
|
||||
player.Transform.Position.PropertyChanged += PlayerPosition_PropertyChanged;
|
||||
hero.Transform.Position.PropertyChanged += HeroPosition_PropertyChanged;
|
||||
}
|
||||
|
||||
private void Phenotype_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Race" || e.PropertyName == "Class")
|
||||
{
|
||||
OnPropertyChanged("Info");
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayerPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Distance");
|
||||
OnPropertyChanged("DeltaZ");
|
||||
}
|
||||
|
||||
private void HeroPosition_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged("Distance");
|
||||
OnPropertyChanged("DeltaZ");
|
||||
}
|
||||
|
||||
private void FullName_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "Nickname")
|
||||
{
|
||||
OnPropertyChanged("Title");
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Player player;
|
||||
private readonly Hero hero;
|
||||
}
|
||||
}
|
157
Client/Application/Views/MainWindow.xaml
Normal file
@ -0,0 +1,157 @@
|
||||
<Window x:Class="Client.Application.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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"
|
||||
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="600" Width="1024">
|
||||
<Window.Resources>
|
||||
<CollectionViewSource x:Key="SortedCreatures" Source="{Binding Creatures}" IsLiveSortingRequested="True">
|
||||
<CollectionViewSource.SortDescriptions>
|
||||
<scm:SortDescription PropertyName="Distance" Direction="Ascending" />
|
||||
</CollectionViewSource.SortDescriptions>
|
||||
</CollectionViewSource>
|
||||
<CollectionViewSource x:Key="SortedDrops" Source="{Binding Drops}" IsLiveSortingRequested="True">
|
||||
<CollectionViewSource.SortDescriptions>
|
||||
<scm:SortDescription PropertyName="Distance" Direction="Ascending" />
|
||||
</CollectionViewSource.SortDescriptions>
|
||||
</CollectionViewSource>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="454"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition Height="240"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding ChatMessages, Mode=OneWay}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock FontSize="12" Text="{Binding Path=Text, Mode=OneWay}" Foreground="{Binding Path=Color, Mode=OneWay}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<TabControl Grid.Row="0" Grid.Column="1">
|
||||
<TabItem>
|
||||
<TabItem.Header>Environment</TabItem.Header>
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"></RowDefinition>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox ItemsSource="{Binding Source={StaticResource SortedCreatures}}" Grid.Row="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock FontSize="16" Text="{Binding Path=Title}" />
|
||||
<TextBlock FontSize="11">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}; distance: {1:F2}m; delta z: {2:F2}m">
|
||||
<Binding Path="Info"/>
|
||||
<Binding Path="Distance"/>
|
||||
<Binding Path="DeltaZ"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<ListBox ItemsSource="{Binding Source={StaticResource SortedDrops}}" Grid.Row="1">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel>
|
||||
<Image DockPanel.Dock="Left" Source="{Binding Path=IconName, FallbackValue=./Assets/icons/_fallback.png}" Height="32" Width="32" />
|
||||
<StackPanel Margin="5">
|
||||
<TextBlock FontSize="16">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}[{1}]">
|
||||
<Binding Path="Name"/>
|
||||
<Binding Path="ItemId"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="11">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}Count {0}; distance: {1:F2}m; delta z: {2:F2}m">
|
||||
<Binding Path="Amount"/>
|
||||
<Binding Path="Distance"/>
|
||||
<Binding Path="DeltaZ"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" DataContext="{Binding Hero, Mode=OneWay}" Margin="4">
|
||||
<TextBlock FontSize="16" Text="{Binding Path=Fullname, Mode=OneWay}"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock FontSize="12">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}, {1} {2}lvl">
|
||||
<Binding Path="Race"/>
|
||||
<Binding Path="Class"/>
|
||||
<Binding Path="Level"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<DockPanel>
|
||||
<StackPanel DockPanel.Dock="Left" Margin="0 0 5 0">
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">Position:</TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">Exp:</TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">Weight:</TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">Adena:</TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">Inv. slots:</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0:F0}, {1:F0}, {2:F0}">
|
||||
<Binding Path="Position.X"/>
|
||||
<Binding Path="Position.Y"/>
|
||||
<Binding Path="Position.Z"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}/{1}">
|
||||
<Binding Path="Experience.Exp"/>
|
||||
<Binding Path="Experience.ExpToLevel"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}/{1}">
|
||||
<Binding Path="Weight.Current"/>
|
||||
<Binding Path="Weight.Max"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="12" Text="{Binding Path=Money}" Padding="0 0 0 3"></TextBlock>
|
||||
<TextBlock FontSize="12" Padding="0 0 0 3">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}/{1}">
|
||||
<Binding Path="Slots.Current"/>
|
||||
<Binding Path="Slots.Max"/>
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Client.Domain.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -13,16 +14,20 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Client
|
||||
namespace Client.Application.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
private readonly MainViewModelInterface mainViewModel;
|
||||
|
||||
public MainWindow(MainViewModelInterface mainViewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.mainViewModel = mainViewModel;
|
||||
DataContext = mainViewModel;
|
||||
}
|
||||
}
|
||||
}
|
BIN
Client/Assets/icons/CooltimeEnd001.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Client/Assets/icons/CooltimeEnd002.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Client/Assets/icons/CooltimeEnd003.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
Client/Assets/icons/CooltimeEnd004.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/CooltimeEnd005.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
Client/Assets/icons/CooltimeEnd006.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
Client/Assets/icons/CooltimeEnd007.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
Client/Assets/icons/CooltimeEnd008.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
Client/Assets/icons/CooltimeEnd009.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/ToggleEffect001.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Client/Assets/icons/ToggleEffect002.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
Client/Assets/icons/ToggleEffect003.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
Client/Assets/icons/ToggleEffect004.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
Client/Assets/icons/ToggleEffect005.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/ToggleEffect006.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/ToggleEffect007.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/ToggleEffect008.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/ToggleEffect009.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
Client/Assets/icons/ToggleEffect010.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
Client/Assets/icons/ToggleEffect011.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
Client/Assets/icons/ToggleEffect012.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
Client/Assets/icons/ToggleEffect013.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
Client/Assets/icons/_fallback.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
Client/Assets/icons/cooltime0.png
Normal file
After Width: | Height: | Size: 960 B |
BIN
Client/Assets/icons/cooltime1.png
Normal file
After Width: | Height: | Size: 974 B |
BIN
Client/Assets/icons/cooltime10.png
Normal file
After Width: | Height: | Size: 983 B |
BIN
Client/Assets/icons/cooltime100.png
Normal file
After Width: | Height: | Size: 981 B |
BIN
Client/Assets/icons/cooltime101.png
Normal file
After Width: | Height: | Size: 985 B |
BIN
Client/Assets/icons/cooltime102.png
Normal file
After Width: | Height: | Size: 985 B |
BIN
Client/Assets/icons/cooltime103.png
Normal file
After Width: | Height: | Size: 985 B |
BIN
Client/Assets/icons/cooltime104.png
Normal file
After Width: | Height: | Size: 989 B |
BIN
Client/Assets/icons/cooltime105.png
Normal file
After Width: | Height: | Size: 989 B |
BIN
Client/Assets/icons/cooltime106.png
Normal file
After Width: | Height: | Size: 989 B |
BIN
Client/Assets/icons/cooltime107.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
Client/Assets/icons/cooltime108.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
Client/Assets/icons/cooltime109.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
Client/Assets/icons/cooltime11.png
Normal file
After Width: | Height: | Size: 986 B |
BIN
Client/Assets/icons/cooltime110.png
Normal file
After Width: | Height: | Size: 995 B |
BIN
Client/Assets/icons/cooltime111.png
Normal file
After Width: | Height: | Size: 995 B |
BIN
Client/Assets/icons/cooltime112.png
Normal file
After Width: | Height: | Size: 995 B |
BIN
Client/Assets/icons/cooltime113.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime114.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime115.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime116.png
Normal file
After Width: | Height: | Size: 1003 B |
BIN
Client/Assets/icons/cooltime117.png
Normal file
After Width: | Height: | Size: 1003 B |
BIN
Client/Assets/icons/cooltime118.png
Normal file
After Width: | Height: | Size: 1004 B |
BIN
Client/Assets/icons/cooltime119.png
Normal file
After Width: | Height: | Size: 1004 B |
BIN
Client/Assets/icons/cooltime12.png
Normal file
After Width: | Height: | Size: 986 B |
BIN
Client/Assets/icons/cooltime120.png
Normal file
After Width: | Height: | Size: 1004 B |
BIN
Client/Assets/icons/cooltime121.png
Normal file
After Width: | Height: | Size: 1007 B |
BIN
Client/Assets/icons/cooltime122.png
Normal file
After Width: | Height: | Size: 1007 B |
BIN
Client/Assets/icons/cooltime123.png
Normal file
After Width: | Height: | Size: 1011 B |
BIN
Client/Assets/icons/cooltime124.png
Normal file
After Width: | Height: | Size: 1011 B |
BIN
Client/Assets/icons/cooltime125.png
Normal file
After Width: | Height: | Size: 1011 B |
BIN
Client/Assets/icons/cooltime126.png
Normal file
After Width: | Height: | Size: 1013 B |
BIN
Client/Assets/icons/cooltime127.png
Normal file
After Width: | Height: | Size: 1013 B |
BIN
Client/Assets/icons/cooltime128.png
Normal file
After Width: | Height: | Size: 1012 B |
BIN
Client/Assets/icons/cooltime129.png
Normal file
After Width: | Height: | Size: 1012 B |
BIN
Client/Assets/icons/cooltime13.png
Normal file
After Width: | Height: | Size: 986 B |
BIN
Client/Assets/icons/cooltime130.png
Normal file
After Width: | Height: | Size: 1013 B |
BIN
Client/Assets/icons/cooltime131.png
Normal file
After Width: | Height: | Size: 1013 B |
BIN
Client/Assets/icons/cooltime132.png
Normal file
After Width: | Height: | Size: 1015 B |
BIN
Client/Assets/icons/cooltime133.png
Normal file
After Width: | Height: | Size: 1015 B |
BIN
Client/Assets/icons/cooltime134.png
Normal file
After Width: | Height: | Size: 1014 B |
BIN
Client/Assets/icons/cooltime135.png
Normal file
After Width: | Height: | Size: 1015 B |
BIN
Client/Assets/icons/cooltime136.png
Normal file
After Width: | Height: | Size: 1012 B |
BIN
Client/Assets/icons/cooltime137.png
Normal file
After Width: | Height: | Size: 1012 B |
BIN
Client/Assets/icons/cooltime138.png
Normal file
After Width: | Height: | Size: 1012 B |
BIN
Client/Assets/icons/cooltime139.png
Normal file
After Width: | Height: | Size: 1010 B |
BIN
Client/Assets/icons/cooltime14.png
Normal file
After Width: | Height: | Size: 986 B |
BIN
Client/Assets/icons/cooltime140.png
Normal file
After Width: | Height: | Size: 1010 B |
BIN
Client/Assets/icons/cooltime141.png
Normal file
After Width: | Height: | Size: 1009 B |
BIN
Client/Assets/icons/cooltime142.png
Normal file
After Width: | Height: | Size: 1009 B |
BIN
Client/Assets/icons/cooltime143.png
Normal file
After Width: | Height: | Size: 1007 B |
BIN
Client/Assets/icons/cooltime144.png
Normal file
After Width: | Height: | Size: 1007 B |
BIN
Client/Assets/icons/cooltime145.png
Normal file
After Width: | Height: | Size: 1004 B |
BIN
Client/Assets/icons/cooltime146.png
Normal file
After Width: | Height: | Size: 1004 B |
BIN
Client/Assets/icons/cooltime147.png
Normal file
After Width: | Height: | Size: 1004 B |
BIN
Client/Assets/icons/cooltime148.png
Normal file
After Width: | Height: | Size: 1002 B |
BIN
Client/Assets/icons/cooltime149.png
Normal file
After Width: | Height: | Size: 1002 B |
BIN
Client/Assets/icons/cooltime15.png
Normal file
After Width: | Height: | Size: 990 B |
BIN
Client/Assets/icons/cooltime150.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime151.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime152.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime153.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime154.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
Client/Assets/icons/cooltime155.png
Normal file
After Width: | Height: | Size: 993 B |
BIN
Client/Assets/icons/cooltime156.png
Normal file
After Width: | Height: | Size: 993 B |
BIN
Client/Assets/icons/cooltime157.png
Normal file
After Width: | Height: | Size: 993 B |
BIN
Client/Assets/icons/cooltime158.png
Normal file
After Width: | Height: | Size: 991 B |