2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on the
13 #include "wx/wxprec.h"
19 #include "wx/notebook.h"
20 #include "wx/treectrl.h"
21 #include "wx/evtloop.h"
23 #include <libwebsockets.h>
30 class StandaloneTimer : public wxTimer
36 StandaloneTimer(Standalone *stand);
43 class StandPopup : public wxFrame
48 wxStaticText* m_Label1;
49 wxStaticText* m_Label2;
52 StandPopup( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Popup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFRAME_FLOAT_ON_PARENT|wxFRAME_TOOL_WINDOW );
56 void SetLabel1(const char *val)
58 m_Label1->SetLabel(val);
61 void SetLabel2(const char *val)
63 m_Label2->SetLabel(val);
67 class Standalone : public wxDialog
70 void createTab_Server(wxNotebook *parent);
71 void createTab_Multi(wxNotebook *parent);
72 void createTab_Player(wxNotebook *parent);
73 void createTab_GodStuff(wxNotebook *parent);
74 void createTab_Debug(wxNotebook *parent);
78 struct lws_context *stand_context;
79 struct lws *wsi_standalone;
80 struct lws_client_connect_info ccinfo;
81 StandaloneTimer *m_timer;
83 std::list<std::string> send_buf;
85 wxDECLARE_EVENT_TABLE();
100 wxTextCtrl* m_S_ServerName;
101 wxTextCtrl* m_S_HostPass;
102 wxStaticText* m_S_NumConn;
103 wxTextCtrl* m_S_Connections;
104 wxButton* m_S_btnKick;
105 wxButton* m_S_btnMRefresh;
106 wxButton* m_S_btnResetAll;
108 wxSlider* m_M_sliderFPS;
109 wxStaticText* m_M_FPS;
110 wxStaticText* m_M_FPSRel;
111 wxStaticText* m_M_MissionName;
112 wxStaticText* m_M_MissionTime;
113 wxStaticText* m_M_ngMaxPlayers;
114 wxStaticText* m_M_ngMaxObservers;
115 wxStaticText* m_M_ngSecurity;
116 wxStaticText* m_M_ngRespawns;
117 wxTreeCtrl* m_M_Goals;
119 wxChoice* m_P_Players;
120 wxStaticText* m_P_ShipType;
121 wxStaticText* m_P_AvgPing;
122 wxStaticText* m_P_atsPriShots;
123 wxStaticText* m_P_atsPriHits;
124 wxStaticText* m_P_atsPriBHHits;
125 wxStaticText* m_P_atsPriHitPer;
126 wxStaticText* m_P_atsPriBHHitPer;
127 wxStaticText* m_P_atsSecShots;
128 wxStaticText* m_P_atsSecHits;
129 wxStaticText* m_P_atsSecBHHits;
130 wxStaticText* m_P_atsSecHitPer;
131 wxStaticText* m_P_atsSecBHHitPer;
132 wxStaticText* m_P_atsAssists;
133 wxStaticText* m_P_msPriShots;
134 wxStaticText* m_P_msPriHits;
135 wxStaticText* m_P_msPriBHHits;
136 wxStaticText* m_P_msPriHitPer;
137 wxStaticText* m_P_msPriBHHitPer;
138 wxStaticText* m_P_msSecShots;
139 wxStaticText* m_P_msSecHits;
140 wxStaticText* m_P_msSecBHHits;
141 wxStaticText* m_P_msSecHitPer;
142 wxStaticText* m_P_msSecBHHitPer;
143 wxStaticText* m_P_msAssists;
145 wxChoice* m_GS_Players;
146 wxTextCtrl* m_GS_msg;
147 wxTextCtrl* m_GS_Messages;
149 wxStaticText* m_D_State;
154 void OnClose( wxCloseEvent& event );
155 void OnShutdown( wxCommandEvent& event );
156 void OnKick( wxCommandEvent& event );
157 void OnMissionRefresh( wxCommandEvent& event );
158 void OnResetAll( wxCommandEvent& event );
159 void OnFPSSel( wxCommandEvent& event );
160 void OnServerMsg( wxCommandEvent& event );
164 Standalone( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Freespace Standalone"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxCLOSE_BOX|wxDIALOG_NO_PARENT );
167 bool startFreeSpace(int argc, wxCmdLineArgsArray& argv);
172 void wsMessage(const char *msg, size_t len);
173 void wsSend(std::string &msg);
175 std::list<std::string> &wsGetSendBuffer()
181 class StandaloneApp: public wxApp
184 Standalone *std_client;
187 virtual bool OnInit();
189 StandaloneApp() : std_client(nullptr)
195 wxASSERT(std_client != nullptr);
201 #endif // STAND_GUI_H