some tweaks

still non playable cartridges

Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
2026-06-02 23:21:56 +02:00
parent 6e29dde558
commit 92045ec6df
15 changed files with 1802 additions and 838 deletions
+34 -7
View File
@@ -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();
};