diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-19 16:33:44 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-19 16:33:44 +0100 |
| commit | a1289dec3dcec278f9cf6d18a001b3146b11b7b2 (patch) | |
| tree | 99fcdcba7f08f57994ec11c4c68c87339dff8ef3 /src/game_tab/right_panel/editor/EditorCanvas.cpp | |
| parent | aa6ec0ea601ac2a0b11752d210ce67fdb85ee60f (diff) | |
Integrate CMI
Diffstat (limited to 'src/game_tab/right_panel/editor/EditorCanvas.cpp')
| -rw-r--r-- | src/game_tab/right_panel/editor/EditorCanvas.cpp | 55 |
1 files changed, 7 insertions, 48 deletions
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp index 0e413c8..9f9c2e3 100644 --- a/src/game_tab/right_panel/editor/EditorCanvas.cpp +++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp @@ -115,52 +115,7 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) { dc->DrawRectangle(recToDraw); } if(e.prop & cgeditor::Property::Nag){ - if(text=="$0") - text=""; - else if(text=="$1") - text="!"; - else if(text=="$2") - text="?"; - else if(text=="$3") - text="!!"; - else if(text=="$4") - text="??"; - else if(text=="$5") - text="!?"; - else if(text=="$6") - text="?!"; - else if(text=="$10") - text="="; - else if(text=="$13") - text="∞"; - else if(text=="$14") - text="⩲"; - else if(text=="$15") - text="⩱"; - else if(text=="$16") - text="±"; - else if(text=="$17") - text="∓"; - else if(text=="$18") - text="+-"; - else if(text=="$19") - text="-+"; - else if(text=="$22"||text=="$23") - text="⨀"; - else if(text=="$26"||text=="$27") - text="○"; - else if(text=="$32"||text=="$33") - text="⟳"; - else if(text=="$36"||text=="$37") - text="↑"; - else if(text=="$40"||text=="$41") - text="→"; - else if(text=="$44" || text=="$45") - text="⯹"; - else if(text=="$138" || text=="$139") - text="⨁"; - else - text="NA"; + text=e.text; } // Draw move text if (CGEditor::status.UseMoveIcons) { @@ -177,12 +132,16 @@ void EditorCanvas::DrawElement(const cgeditor::Element &e) { void EditorCanvas::HandleEvent(const cgeditor::Event &e) { if (e.type == cgeditor::Event::Goto) { game->SetCurrent((HalfMove *)e.move); + SyncCache(); } else if (e.type == cgeditor::Event::Delete) { - game->DeleteMove((HalfMove *)e.move); + game->DeleteMove((HalfMove *)e.move); + SyncCache(); } else if (e.type == cgeditor::Event::Promote) { game->PromoteMove((HalfMove *)e.move); + SyncCache(); } else if (e.type == cgeditor::Event::SetAsMainline) { - game->SetMoveAsMainline((HalfMove *)e.move); + game->SetMoveAsMainline((HalfMove *)e.move); + SyncCache(); } wxCommandEvent event(GAME_CHANGE, GetId()); event.SetEventObject(this); |
