Update CGEditor+debug

This commit is contained in:
Loic Guegan 2023-01-02 08:15:51 +01:00
parent dd24427d81
commit 4f2c68de60
3 changed files with 3 additions and 9 deletions

@ -1 +1 @@
Subproject commit 31c332da9ab426daa73b68772d0ef9c1b0744a50 Subproject commit 5e18d43a6ba4fd378178418de6b2ca7a67d64c21

View file

@ -63,12 +63,12 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game)
void GameTabLeftPanel::OnPlay(wxCommandEvent &event) { void GameTabLeftPanel::OnPlay(wxCommandEvent &event) {
wxLogDebug("Game tab received PLAY_MOVE_EVENT"); wxLogDebug("Game tab received PLAY_MOVE_EVENT");
if (game->Play(event.GetString().ToStdString())) { if (game->Play(event.GetString().ToStdString())) {
Notify(true);
// Notify other classes // Notify other classes
wxCommandEvent event(GAME_CHANGE, GetId()); wxCommandEvent event(GAME_CHANGE, GetId());
event.SetEventObject(this); event.SetEventObject(this);
ProcessEvent(event); ProcessEvent(event);
} }
Notify(true); // Redraw event is move failed! Otherwise piece not resets to it initial position after dragging
} }
void GameTabLeftPanel::Notify(bool skip_animation) { void GameTabLeftPanel::Notify(bool skip_animation) {

View file

@ -216,13 +216,7 @@ void EditorCanvas::MouseEvent(wxMouseEvent &event) {
// Handle editor events // Handle editor events
Update(); Update();
bool need_redraw=false; if(ProcessEvents()){
for(auto event: status.Events){
HandleEvent(event);
need_redraw=true;
}
if(need_redraw){
status.Events.clear();
Refresh(); Refresh();
Update(); Update();
} }