about summary refs log tree commit diff stats
path: root/tracker_frame.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-05-02 15:21:29 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-05-02 15:21:29 -0400
commit116ba412079ddf647d19a54d09eb61e67a2f9aac (patch)
tree07934e4fdd0723f1cd803cd37832c0f2302e3c53 /tracker_frame.cpp
parent22014b967d0d9651b72bffbe02aba75dc98180a4 (diff)
downloadlingo-ap-tracker-116ba412079ddf647d19a54d09eb61e67a2f9aac.tar.gz
lingo-ap-tracker-116ba412079ddf647d19a54d09eb61e67a2f9aac.tar.bz2
lingo-ap-tracker-116ba412079ddf647d19a54d09eb61e67a2f9aac.zip
Tracker connects to AP now
Diffstat (limited to 'tracker_frame.cpp')
-rw-r--r--tracker_frame.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tracker_frame.cpp b/tracker_frame.cpp index b33cce9..d58dfe8 100644 --- a/tracker_frame.cpp +++ b/tracker_frame.cpp
@@ -1,14 +1,21 @@
1#include "tracker_frame.h" 1#include "tracker_frame.h"
2 2
3#include "ap_state.h"
4#include "connection_dialog.h"
3#include "tracker_panel.h" 5#include "tracker_panel.h"
4 6
7enum TrackerFrameIds { ID_CONNECT = 1 };
8
5TrackerFrame::TrackerFrame() 9TrackerFrame::TrackerFrame()
6 : wxFrame(nullptr, wxID_ANY, "Lingo Archipelago Tracker") { 10 : wxFrame(nullptr, wxID_ANY, "Lingo Archipelago Tracker") {
7 ::wxInitAllImageHandlers(); 11 ::wxInitAllImageHandlers();
8 12
13 GetAPState().SetTrackerFrame(this);
14
9 SetSize(1280, 728); 15 SetSize(1280, 728);
10 16
11 wxMenu *menuFile = new wxMenu(); 17 wxMenu *menuFile = new wxMenu();
18 menuFile->Append(ID_CONNECT, "&Connect");
12 menuFile->Append(wxID_EXIT); 19 menuFile->Append(wxID_EXIT);
13 20
14 wxMenu *menuHelp = new wxMenu(); 21 wxMenu *menuHelp = new wxMenu();
@@ -25,13 +32,27 @@ TrackerFrame::TrackerFrame()
25 32
26 Bind(wxEVT_MENU, &TrackerFrame::OnAbout, this, wxID_ABOUT); 33 Bind(wxEVT_MENU, &TrackerFrame::OnAbout, this, wxID_ABOUT);
27 Bind(wxEVT_MENU, &TrackerFrame::OnExit, this, wxID_EXIT); 34 Bind(wxEVT_MENU, &TrackerFrame::OnExit, this, wxID_EXIT);
35 Bind(wxEVT_MENU, &TrackerFrame::OnConnect, this, ID_CONNECT);
28 36
29 new TrackerPanel(this); 37 new TrackerPanel(this);
30} 38}
31 39
40void TrackerFrame::SetStatusMessage(std::string message) {
41 SetStatusText(message);
42}
43
32void TrackerFrame::OnAbout(wxCommandEvent &event) { 44void TrackerFrame::OnAbout(wxCommandEvent &event) {
33 wxMessageBox("Lingo Archipelago Tracker by hatkirby", 45 wxMessageBox("Lingo Archipelago Tracker by hatkirby",
34 "About lingo-ap-tracker", wxOK | wxICON_INFORMATION); 46 "About lingo-ap-tracker", wxOK | wxICON_INFORMATION);
35} 47}
36 48
37void TrackerFrame::OnExit(wxCommandEvent &event) { Close(true); } 49void TrackerFrame::OnExit(wxCommandEvent &event) { Close(true); }
50
51void TrackerFrame::OnConnect(wxCommandEvent &event) {
52 ConnectionDialog dlg;
53
54 if (dlg.ShowModal() == wxID_OK) {
55 GetAPState().Connect(dlg.GetServerValue(), dlg.GetPlayerValue(),
56 dlg.GetPasswordValue());
57 }
58}