aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel/editor/EditorCanvas.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-01-09 14:43:54 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-01-09 14:43:54 +0100
commit518edf6f3050022fa4d1a15d147efe6665459863 (patch)
tree99bb53b970af942a0bef3f1801c9c2afaf1f73d1 /src/game_tab/right_panel/editor/EditorCanvas.cpp
parent445cc09d01f8e3beeb406e175b5a98d6be58ea9a (diff)
Bind settings of the Editor (still ongoing)
Diffstat (limited to 'src/game_tab/right_panel/editor/EditorCanvas.cpp')
-rw-r--r--src/game_tab/right_panel/editor/EditorCanvas.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp
index 19d81ec..b728d91 100644
--- a/src/game_tab/right_panel/editor/EditorCanvas.cpp
+++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp
@@ -31,8 +31,6 @@ void EditorCanvas::OnPaint(wxPaintEvent &event) {
wxSize sz = GetClientSize();
CGEditor::status.CanvasWidth = sz.GetWidth();
CGEditor::status.CanvasHeight = sz.GetHeight();
- CGEditor::status.UseMoveIcons =
- true; // Piece image should be drawn before the move ?
const wxPoint pt = wxGetMousePosition();
CGEditor::status.MouseX = pt.x - this->GetScreenPosition().x;
@@ -229,5 +227,15 @@ void EditorCanvas::SetMoves(HalfMove *moves, HalfMove *current) {
Refresh();
}
+void EditorCanvas::ApplyPreferences(){
+ CONFIG_OPEN(conf);
+ conf->SetPath("editor/");
+ CGEditor::status.MoveHeight=conf->Read("row_size", 50);
+ CGEditor::status.MoveWidth=conf->Read("col_size", 100);
+ CGEditor::status.UseMoveIcons=conf->Read("show_move_icons", true);
+ CONFIG_CLOSE(conf);
+ Refresh();
+}
+
wxBEGIN_EVENT_TABLE(EditorCanvas, wxPanel) EVT_PAINT(EditorCanvas::OnPaint)
EVT_MOUSE_EVENTS(EditorCanvas::MouseEvent) wxEND_EVENT_TABLE()