some tweaks
still non playable cartridges Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
@@ -1,25 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include <wx/frame.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/webview.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
struct SimPoint {
|
||||
double lat;
|
||||
double lon;
|
||||
};
|
||||
|
||||
struct ZoneInfo {
|
||||
double lat;
|
||||
double lon;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
class MapSimFrame : public wxFrame {
|
||||
public:
|
||||
MapSimFrame(wxWindow* parent, double centerLat = 53.3, double centerLon = 10.39, const std::vector<std::pair<double, double>>& zoneCoords = {});
|
||||
MapSimFrame(wxWindow* parent,
|
||||
double centerLat = 53.3, double centerLon = 10.39,
|
||||
const std::vector<ZoneInfo>& zoneInfos = {});
|
||||
|
||||
void AddSimPoint(double lat, double lon);
|
||||
void StartSimulation();
|
||||
|
||||
private:
|
||||
wxWebView* m_webView;
|
||||
std::vector<SimPoint> m_route;
|
||||
std::vector<std::pair<double, double>> m_zoneCoords;
|
||||
void OnWebViewEvent(wxWebViewEvent& event);
|
||||
void OnPlay(wxCommandEvent& event);
|
||||
wxWebView* m_webView = nullptr;
|
||||
wxTimer m_simTimer;
|
||||
size_t m_simIndex = 0;
|
||||
|
||||
std::vector<SimPoint> m_route;
|
||||
std::vector<ZoneInfo> m_zoneInfos;
|
||||
bool m_pageLoaded = false;
|
||||
|
||||
void SendPositionToEngine(double lat, double lon);
|
||||
|
||||
void syncZonesOnMap();
|
||||
|
||||
void OnScriptMessage(wxWebViewEvent& event);
|
||||
void OnWebViewLoaded(wxWebViewEvent& event);
|
||||
void OnGameStateChanged(wxEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void OnPlay(wxCommandEvent& event);
|
||||
void OnClear(wxCommandEvent& event);
|
||||
void OnSimTimer(wxTimerEvent& event);
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
int getSelectedButton() const { return m_selectedButton; }
|
||||
|
||||
private:
|
||||
void onButton(wxCommandEvent &event);
|
||||
void onButton(const wxCommandEvent &event);
|
||||
|
||||
int m_selectedButton = -1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user