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/GameTabRightPanel.cpp | |
| parent | aa6ec0ea601ac2a0b11752d210ce67fdb85ee60f (diff) | |
Integrate CMI
Diffstat (limited to 'src/game_tab/right_panel/GameTabRightPanel.cpp')
| -rw-r--r-- | src/game_tab/right_panel/GameTabRightPanel.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/game_tab/right_panel/GameTabRightPanel.cpp b/src/game_tab/right_panel/GameTabRightPanel.cpp index 21b4ed7..5d933b8 100644 --- a/src/game_tab/right_panel/GameTabRightPanel.cpp +++ b/src/game_tab/right_panel/GameTabRightPanel.cpp @@ -28,7 +28,7 @@ GameTabRightPanel::GameTabRightPanel(wxFrame *parent, std::shared_ptr<Game> game nag_panel->Bind(wxEVT_BUTTON, [p=this](wxCommandEvent &e){ HalfMove *m = p->game->GetCurrentMove(); if (m != nullptr) { - m->nag=p->GetNagFromStr(((wxButton*)e.GetEventObject())->GetLabel().ToStdString()); + m->SetNAG(p->editor_canvas->GetNAGId(((wxButton*)e.GetEventObject())->GetLabel().ToStdString())); p->editor_canvas->Refresh(); } }); @@ -103,9 +103,9 @@ void GameTabRightPanel::OnCommentChange(wxCommandEvent &event) { wxLogDebug("GameTabRightPanel: comment input change"); HalfMove *m = game->GetCurrentMove(); if (m != nullptr) { - m->comment=event.GetString().Trim().ToStdString(); + m->SetComment(event.GetString().Trim().ToStdString()); // Remove newlines: - for(char &c:m->comment){ + for(char &c:m->GetComment()){ if(c=='\n') c=' '; } @@ -150,7 +150,7 @@ void GameTabRightPanel::Notify() { HalfMove *m = game->GetCurrentMove(); if (m != nullptr) { comment_input->ChangeValue( - m->comment); // ChangeValue do not raise events + m->GetComment()); // ChangeValue do not raise events } editor_canvas->SetMoves(game->GetMoves(), m); // Put it here for now: @@ -190,49 +190,49 @@ void GameTabRightPanel::RefreshTagsList() { } } -std::string GameTabRightPanel::GetNagFromStr(std::string str){ +std::uint8_t GameTabRightPanel::GetNagFromStr(std::string str){ // TODO: Bind more NAG! if(str=="!") - return "$1"; + return 1; else if(str=="?") - return "$2"; + return 2; else if(str=="!!") - return "$3"; + return 3; else if(str=="??") - return "$4"; + return 4; else if(str=="!?") - return "$5"; + return 5; else if(str=="?!") - return "$6"; + return 6; else if(str=="=") - return "$10"; + return 10; else if(str=="∞") - return "$13"; + return 13; else if(str=="⩲") - return "$14"; + return 14; else if(str=="⩱") - return "$15"; + return 15; else if(str=="±") - return "$16"; + return 16; else if(str=="∓") - return "$17"; + return 17; else if(str=="+-") - return "$18"; + return 18; else if(str=="-+") - return "$19"; + return 19; else if(str=="⨀") - return "$22"; + return 22; else if(str=="○") - return "$26"; + return 26; else if(str=="⟳") - return "$32"; + return 32; else if(str=="↑") - return "$36"; + return 36; else if(str=="→") - return "$40"; + return 40; else if(str=="⯹") - return "$44"; + return 44; else if(str=="⨁") - return "$138"; - return ""; + return 138; + return 0; } |
