-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added custom dynamic tables - Added/fixed TLK string support for custom objects and dynamic tables - Added support for missing ERF resource types - Fixed some UI bugs
- Loading branch information
Showing
119 changed files
with
1,813 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
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="using:Eos.Usercontrols" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="Eos.Usercontrols.CustomDynamicTableComboBox" | ||
x:Name="ucCustomDynamicTableComboBox"> | ||
<UserControl.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceInclude Source="/Assets/ConverterResources.axaml"/> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</UserControl.Resources> | ||
|
||
<Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:CustomDynamicTableComboBox}}}"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="Auto"/> | ||
<ColumnDefinition Width="Auto"/> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Button x:Name="cbCustomDynamicTables" Grid.Column="0" Click="btSearch_Click" HorizontalContentAlignment="Stretch" MinHeight="22"> | ||
<Button.Content> | ||
<TextBlock Text="{Binding ElementName=ucCustomDynamicTableComboBox, Path=SelectedValue.Label}" Margin="3,0,0,0"/> | ||
</Button.Content> | ||
</Button> | ||
|
||
<Button x:Name="btClear" Grid.Column="1" Content="🞪" Click="btClear_Click" Margin="2,0,0,0" | ||
Height="{Binding ElementName=cbCustomDynamicTables, Path=Bounds.Height}" Width="{Binding ElementName=cbCustomDynamicTables, Path=Bounds.Height}" | ||
IsVisible="{Binding ElementName=ucCustomDynamicTableComboBox, Path=IsNullable}"/> | ||
<Button x:Name="btGoto" Grid.Column="2" Margin="2,0,0,0" Content="👁" Click="btGoto_Click" | ||
Height="{Binding ElementName=cbCustomDynamicTables, Path=Bounds.Height}" Width="{Binding ElementName=cbCustomDynamicTables, Path=Bounds.Height}"/> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Data; | ||
using Avalonia.Interactivity; | ||
using Eos.Models; | ||
using Eos.Models.Tables; | ||
using Eos.Repositories; | ||
using Eos.Services; | ||
using Eos.ViewModels.Base; | ||
using Eos.ViewModels.Dialogs; | ||
|
||
namespace Eos.Usercontrols | ||
{ | ||
public partial class CustomDynamicTableComboBox : UserControl | ||
{ | ||
public CustomDynamicTableComboBox() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public static readonly StyledProperty<CustomDynamicTable?> CustomDynamicTableTemplateProperty = AvaloniaProperty.Register<CustomDynamicTableComboBox, CustomDynamicTable?>("CustomDynamicTableTemplate", null); | ||
public static readonly StyledProperty<CustomDynamicTableInstance?> SelectedValueProperty = AvaloniaProperty.Register<CustomDynamicTableComboBox, CustomDynamicTableInstance?>("SelectedValue", null, false, BindingMode.TwoWay); | ||
public static readonly StyledProperty<bool> IsNullableProperty = AvaloniaProperty.Register<CustomDynamicTableComboBox, bool>("IsNullable", true); | ||
|
||
public CustomDynamicTable? CustomDynamicTableTemplate | ||
{ | ||
get { return GetValue(CustomDynamicTableTemplateProperty); } | ||
set { SetValue(CustomDynamicTableTemplateProperty, value); } | ||
} | ||
|
||
public CustomDynamicTableInstance? SelectedValue | ||
{ | ||
get { return GetValue(SelectedValueProperty); } | ||
set { SetValue(SelectedValueProperty, value); } | ||
} | ||
|
||
public bool IsNullable | ||
{ | ||
get { return GetValue(IsNullableProperty); } | ||
set { SetValue(IsNullableProperty, value); } | ||
} | ||
|
||
private void btClear_Click(object sender, RoutedEventArgs e) | ||
{ | ||
SetValue(SelectedValueProperty, null); | ||
} | ||
|
||
private void btSearch_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if (CustomDynamicTableTemplate != null) | ||
{ | ||
var viewModel = new CustomDynamicTableInstanceSearchViewModel(CustomDynamicTableTemplate, MasterRepository.Project.CustomDynamicTableRepositories[CustomDynamicTableTemplate]); | ||
WindowService.OpenDialog(viewModel); | ||
if (viewModel.ResultModel != null) | ||
SetValue(SelectedValueProperty, viewModel.ResultModel); | ||
} | ||
} | ||
|
||
private void btGoto_Click(object sender, RoutedEventArgs e) | ||
{ | ||
MessageDispatcher.Send(MessageType.OpenDetail, SelectedValue, true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
eos-edit/ViewModels/CustomDynamicTableInstanceViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using Eos.Models; | ||
using Eos.Models.Tables; | ||
using Eos.Types; | ||
using Eos.ViewModels.Base; | ||
using ReactiveUI; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reactive; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Eos.ViewModels | ||
{ | ||
public class CustomDynamicTableInstanceViewModel : DataDetailViewModel<CustomDynamicTableInstance> | ||
{ | ||
public CustomDynamicTableInstanceViewModel() : base() | ||
{ | ||
DeleteCustomDynTableItemCommand = ReactiveCommand.Create<CustomDynamicTableInstanceItem>(DeleteCustomDynTableItem); | ||
AddCustomDynTableItemCommand = ReactiveCommand.Create(AddItemPropertyTableItem); | ||
|
||
MoveUpCommand = ReactiveCommand.Create<CustomDynamicTableInstanceItem>(MoveUp); | ||
MoveDownCommand = ReactiveCommand.Create<CustomDynamicTableInstanceItem>(MoveDown); | ||
} | ||
|
||
public CustomDynamicTableInstanceViewModel(CustomDynamicTableInstance instance) : base(instance) | ||
{ | ||
DeleteCustomDynTableItemCommand = ReactiveCommand.Create<CustomDynamicTableInstanceItem>(DeleteCustomDynTableItem); | ||
AddCustomDynTableItemCommand = ReactiveCommand.Create(AddItemPropertyTableItem); | ||
|
||
MoveUpCommand = ReactiveCommand.Create<CustomDynamicTableInstanceItem>(MoveUp); | ||
MoveDownCommand = ReactiveCommand.Create<CustomDynamicTableInstanceItem>(MoveDown); | ||
} | ||
|
||
protected override HashSet<String> GetHeaderSourceFields() | ||
{ | ||
return new HashSet<String>() | ||
{ | ||
"Label" | ||
}; | ||
} | ||
|
||
protected override string GetHeader() | ||
{ | ||
return Data.Label; | ||
} | ||
|
||
private void AddItemPropertyTableItem() | ||
{ | ||
var newItem = new CustomDynamicTableInstanceItem(Data); | ||
Data.Add(newItem); | ||
NotifyPropertyChanged("Data"); | ||
} | ||
|
||
private void DeleteCustomDynTableItem(CustomDynamicTableInstanceItem item) | ||
{ | ||
this.Data.Remove(item); | ||
NotifyPropertyChanged("Data"); | ||
} | ||
|
||
private void MoveUp(CustomDynamicTableInstanceItem item) | ||
{ | ||
var index = Data.Items.IndexOf(item); | ||
if (index > 0) | ||
Data.Items.Move(index, index - 1); | ||
} | ||
|
||
private void MoveDown(CustomDynamicTableInstanceItem item) | ||
{ | ||
var index = Data.Items.IndexOf(item); | ||
if (index < Data.Items.Count - 1) | ||
Data.Items.Move(index, index + 1); | ||
} | ||
|
||
public ReactiveCommand<CustomDynamicTableInstanceItem, Unit> DeleteCustomDynTableItemCommand { get; private set; } | ||
public ReactiveCommand<Unit, Unit> AddCustomDynTableItemCommand { get; private set; } | ||
|
||
public ReactiveCommand<CustomDynamicTableInstanceItem, Unit> MoveUpCommand { get; private set; } | ||
public ReactiveCommand<CustomDynamicTableInstanceItem, Unit> MoveDownCommand { get; private set; } | ||
} | ||
} |
Oops, something went wrong.