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();
103 wxTextCtrl* m_S_ServerName;
104 wxTextCtrl* m_S_HostPass;
105 wxStaticText* m_S_NumConn;
106 wxTextCtrl* m_S_Connections;
107 wxButton* m_S_btnKick;
108 wxButton* m_S_btnMRefresh;
109 wxButton* m_S_btnResetAll;
111 wxSlider* m_M_sliderFPS;
112 wxStaticText* m_M_FPS;
113 wxStaticText* m_M_FPSRel;
114 wxStaticText* m_M_MissionName;
115 wxStaticText* m_M_MissionTime;
116 wxStaticText* m_M_ngMaxPlayers;
117 wxStaticText* m_M_ngMaxObservers;
118 wxStaticText* m_M_ngSecurity;
119 wxStaticText* m_M_ngRespawns;
120 wxTreeCtrl* m_M_Goals;
121 wxTreeItemId m_M_GoalItems[3];
123 wxChoice* m_P_Players;
124 wxStaticText* m_P_ShipType;
125 wxStaticText* m_P_AvgPing;
126 wxStaticText* m_P_atsPriShots;
127 wxStaticText* m_P_atsPriHits;
128 wxStaticText* m_P_atsPriBHHits;
129 wxStaticText* m_P_atsPriHitPer;
130 wxStaticText* m_P_atsPriBHHitPer;
131 wxStaticText* m_P_atsSecShots;
132 wxStaticText* m_P_atsSecHits;
133 wxStaticText* m_P_atsSecBHHits;
134 wxStaticText* m_P_atsSecHitPer;
135 wxStaticText* m_P_atsSecBHHitPer;
136 wxStaticText* m_P_atsAssists;
137 wxStaticText* m_P_msPriShots;
138 wxStaticText* m_P_msPriHits;
139 wxStaticText* m_P_msPriBHHits;
140 wxStaticText* m_P_msPriHitPer;
141 wxStaticText* m_P_msPriBHHitPer;
142 wxStaticText* m_P_msSecShots;
143 wxStaticText* m_P_msSecHits;
144 wxStaticText* m_P_msSecBHHits;
145 wxStaticText* m_P_msSecHitPer;
146 wxStaticText* m_P_msSecBHHitPer;
147 wxStaticText* m_P_msAssists;
149 wxChoice* m_GS_Players;
150 wxTextCtrl* m_GS_msg;
151 wxTextCtrl* m_GS_Messages;
153 wxStaticText* m_D_State;
158 void OnClose( wxCloseEvent& event );
159 void OnShutdown( wxCommandEvent& event );
160 void OnServerNameChange( wxCommandEvent& event );
161 void OnHostPassChange( wxCommandEvent& event );
162 void OnKick( wxCommandEvent& event );
163 void OnMissionRefresh( wxCommandEvent& event );
164 void OnResetAll( wxCommandEvent& event );
165 void OnFPSSel( wxCommandEvent& event );
166 void OnServerMsg( wxCommandEvent& event );
167 void OnPinfoPlayer( wxCommandEvent& event );
171 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 );
174 bool startFreeSpace(int argc, wxCmdLineArgsArray& argv);
179 void wsMessage(const char *msg, size_t len);
180 void wsSend(std::string &msg);
182 std::list<std::string> &wsGetSendBuffer()
188 class StandaloneApp: public wxApp
191 Standalone *std_client;
194 virtual bool OnInit();
196 StandaloneApp() : std_client(nullptr)
202 wxASSERT(std_client != nullptr);
209 const char * goal_ord_xpm[] = {
227 ",,,,,,,,,,,,,,,,",
242 ",,,,,,,,,,,,,,,,"};
244 const char * goal_none_xpm[] = {
279 const char * goal_inc_xpm[] = {
314 const char * goal_com_xpm[] = {
349 const char * goal_fail_xpm[] = {
385 #endif // STAND_GUI_H