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 // must come first to prevent wxWidgets from including winsock.h on Windows
14 #include <libwebsockets.h>
16 #include "wx/wxprec.h"
22 #include "wx/notebook.h"
23 #include "wx/treectrl.h"
24 #include "wx/evtloop.h"
32 class StandaloneTimer : public wxTimer
38 StandaloneTimer(Standalone *stand);
45 class StandPopup : public wxFrame
50 wxStaticText* m_Label1;
51 wxStaticText* m_Label2;
54 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|wxCAPTION|wxFRAME_NO_TASKBAR );
58 void SetLabel1(const char *val)
60 m_Label1->SetLabel(val);
63 void SetLabel2(const char *val)
65 m_Label2->SetLabel(val);
69 class Standalone : public wxDialog
72 void createTab_Server(wxNotebook *parent);
73 void createTab_Multi(wxNotebook *parent);
74 void createTab_Player(wxNotebook *parent);
75 void createTab_GodStuff(wxNotebook *parent);
76 void createTab_Debug(wxNotebook *parent);
80 struct lws_context *stand_context;
81 struct lws *wsi_standalone;
82 struct lws_client_connect_info ccinfo;
83 StandaloneTimer *m_timer;
85 std::list<std::string> send_buf;
87 wxDECLARE_EVENT_TABLE();
105 wxTextCtrl* m_S_ServerName;
106 wxTextCtrl* m_S_HostPass;
107 wxStaticText* m_S_NumConn;
108 wxTextCtrl* m_S_Connections;
109 wxButton* m_S_btnKick;
110 wxButton* m_S_btnMRefresh;
111 wxButton* m_S_btnResetAll;
113 wxSlider* m_M_sliderFPS;
114 wxStaticText* m_M_FPS;
115 wxStaticText* m_M_FPSRel;
116 wxStaticText* m_M_MissionName;
117 wxStaticText* m_M_MissionTime;
118 wxStaticText* m_M_ngMaxPlayers;
119 wxStaticText* m_M_ngMaxObservers;
120 wxStaticText* m_M_ngSecurity;
121 wxStaticText* m_M_ngRespawns;
122 wxTreeCtrl* m_M_Goals;
123 wxTreeItemId m_M_GoalItems[3];
125 wxChoice* m_P_Players;
126 wxStaticText* m_P_ShipType;
127 wxStaticText* m_P_AvgPing;
128 wxStaticText* m_P_atsPriShots;
129 wxStaticText* m_P_atsPriHits;
130 wxStaticText* m_P_atsPriBHHits;
131 wxStaticText* m_P_atsPriHitPer;
132 wxStaticText* m_P_atsPriBHHitPer;
133 wxStaticText* m_P_atsSecShots;
134 wxStaticText* m_P_atsSecHits;
135 wxStaticText* m_P_atsSecBHHits;
136 wxStaticText* m_P_atsSecHitPer;
137 wxStaticText* m_P_atsSecBHHitPer;
138 wxStaticText* m_P_atsAssists;
139 wxStaticText* m_P_msPriShots;
140 wxStaticText* m_P_msPriHits;
141 wxStaticText* m_P_msPriBHHits;
142 wxStaticText* m_P_msPriHitPer;
143 wxStaticText* m_P_msPriBHHitPer;
144 wxStaticText* m_P_msSecShots;
145 wxStaticText* m_P_msSecHits;
146 wxStaticText* m_P_msSecBHHits;
147 wxStaticText* m_P_msSecHitPer;
148 wxStaticText* m_P_msSecBHHitPer;
149 wxStaticText* m_P_msAssists;
151 wxChoice* m_GS_Players;
152 wxTextCtrl* m_GS_msg;
153 wxTextCtrl* m_GS_Messages;
155 wxStaticText* m_D_State;
160 void OnClose( wxCloseEvent& event );
161 void OnShutdown( wxCommandEvent& event );
162 void OnServerNameChange( wxCommandEvent& event );
163 void OnHostPassChange( wxCommandEvent& event );
164 void OnKick( wxCommandEvent& event );
165 void OnMissionRefresh( wxCommandEvent& event );
166 void OnResetAll( wxCommandEvent& event );
167 void OnFPSSel( wxCommandEvent& event );
168 void OnServerMsg( wxCommandEvent& event );
169 void OnPinfoPlayer( wxCommandEvent& event );
173 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 );
176 bool startFreeSpace(int argc, wxCmdLineArgsArray& argv);
181 void wsMessage(const char *msg, size_t len);
182 void wsSend(std::string &msg);
184 std::list<std::string> &wsGetSendBuffer()
190 class StandaloneApp: public wxApp
193 Standalone *std_client;
196 virtual bool OnInit();
198 StandaloneApp() : std_client(nullptr)
204 wxASSERT(std_client != nullptr);
211 const char * goal_ord_xpm[] = {
229 ",,,,,,,,,,,,,,,,",
244 ",,,,,,,,,,,,,,,,"};
246 const char * goal_none_xpm[] = {
281 const char * goal_inc_xpm[] = {
316 const char * goal_com_xpm[] = {
351 const char * goal_fail_xpm[] = {
387 #endif // STAND_GUI_H