finish basic i18n and cfg loader

This commit is contained in:
2021-09-20 15:59:54 +08:00
parent 9d8f4b1727
commit 352c133620
8 changed files with 85 additions and 18 deletions

View File

@ -21,11 +21,13 @@ namespace BallanceTASEditor.UI {
mItemList = new List<TASFlowUIItem>();
mRectMap = new Dictionary<Rectangle, CellPosition>();
mItemCount = 0;
mIsHorizontalLayout = true;
SetItemCount(1);
}
public event Action Click;
private bool mIsHorizontalLayout;
private Grid uiCoreWindow;
private int mItemCount;
private List<TASFlowUIItem> mItemList;
@ -33,6 +35,13 @@ namespace BallanceTASEditor.UI {
public SelectionHelp SelectionHelp { get; set; }
public List<FrameDataDisplay> DataSources { get; set; }
public void ChangeLayout(bool isHorizontal) {
// the layout changed, re-construct elements
if (isHorizontal != mIsHorizontalLayout) {
// todo: change layout
}
}
public void RefreshDataSources() {
if (DataSources == null) return;
@ -135,6 +144,14 @@ namespace BallanceTASEditor.UI {
} else {
SelectionHelp.FirstClick(mItemList[pos.column - 1].rawFrame, pos.field);
}
} else if (e.MouseDevice.RightButton == MouseButtonState.Pressed) {
// if we click right button and there are no full selection in cursor mode
// try to add a first selection
if (SelectionHelp.GetToolMode() == ToolMode.Cursor) {
if (!SelectionHelp.IsDataReady()) {
SelectionHelp.FirstClick(mItemList[pos.column - 1].rawFrame, pos.field);
}
}
}
// note main window to process it.

View File

@ -34,9 +34,6 @@ namespace BallanceTASEditor.UI {
mDataGrid.Click += funcDataMenu_Click;
mSlider.ValueChanged += funcSlider_ValueChanged;
// display data
ChangeListLength(int.Parse(GlobalVariable.configManager.Configuration[ConfigManager.CfgNode_ItemCount]));
}
public void Dispose() {