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 Standalone : public wxDialog
46 void createTab_Server(wxNotebook *parent);
47 void createTab_Multi(wxNotebook *parent);
48 void createTab_Player(wxNotebook *parent);
49 void createTab_GodStuff(wxNotebook *parent);
50 void createTab_Debug(wxNotebook *parent);
54 struct lws_context *stand_context;
55 struct lws *wsi_standalone;
56 struct lws_client_connect_info ccinfo;
57 StandaloneTimer *m_timer;
59 std::list<std::string> send_buf;
61 wxDECLARE_EVENT_TABLE();
74 wxTextCtrl* m_S_ServerName;
75 wxTextCtrl* m_S_HostPass;
76 wxStaticText* m_S_NumConn;
77 wxTextCtrl* m_S_Connections;
78 wxButton* m_S_btnKick;
79 wxButton* m_S_btnMRefresh;
80 wxButton* m_S_btnResetAll;
82 wxSlider* m_M_sliderFPS;
83 wxStaticText* m_M_FPS;
84 wxStaticText* m_M_FPSRel;
85 wxStaticText* m_M_MissionName;
86 wxStaticText* m_M_MissionTime;
87 wxStaticText* m_M_ngMaxPlayers;
88 wxStaticText* m_M_ngMaxObservers;
89 wxStaticText* m_M_ngSecurity;
90 wxStaticText* m_M_ngRespawns;
91 wxTreeCtrl* m_M_Goals;
93 wxChoice* m_P_Players;
94 wxStaticText* m_P_ShipType;
95 wxStaticText* m_P_AvgPing;
96 wxStaticText* m_P_atsPriShots;
97 wxStaticText* m_P_atsPriHits;
98 wxStaticText* m_P_atsPriBHHits;
99 wxStaticText* m_P_atsPriHitPer;
100 wxStaticText* m_P_atsPriBHHitPer;
101 wxStaticText* m_P_atsSecShots;
102 wxStaticText* m_P_atsSecHits;
103 wxStaticText* m_P_atsSecBHHits;
104 wxStaticText* m_P_atsSecHitPer;
105 wxStaticText* m_P_atsSecBHHitPer;
106 wxStaticText* m_P_atsAssists;
107 wxStaticText* m_P_msPriShots;
108 wxStaticText* m_P_msPriHits;
109 wxStaticText* m_P_msPriBHHits;
110 wxStaticText* m_P_msPriHitPer;
111 wxStaticText* m_P_msPriBHHitPer;
112 wxStaticText* m_P_msSecShots;
113 wxStaticText* m_P_msSecHits;
114 wxStaticText* m_P_msSecBHHits;
115 wxStaticText* m_P_msSecHitPer;
116 wxStaticText* m_P_msSecBHHitPer;
117 wxStaticText* m_P_msAssists;
119 wxChoice* m_GS_Players;
120 wxTextCtrl* m_GS_Messages;
122 wxStaticText* m_D_State;
125 void OnClose( wxCloseEvent& event );
126 void OnShutdown( wxCommandEvent& event );
130 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 );
133 bool startFreeSpace();
138 void wsMessage(const char *msg, size_t len);
139 void wsSend(std::string &msg);
141 std::list<std::string> &wsGetSendBuffer()
147 class StandaloneApp: public wxApp
150 Standalone *std_client;
153 virtual bool OnInit();
154 virtual void OnEventLoopEnter(wxEventLoopBase *loop);
156 StandaloneApp() : std_client(nullptr)
162 wxASSERT(std_client != nullptr);
168 #endif // STAND_GUI_H