Implement Refresh

This commit is contained in:
smallmodel 2025-04-14 23:44:37 +02:00
parent f8bf8c33c6
commit 3964960d31
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 12 additions and 5 deletions

View file

@ -61,11 +61,12 @@ Event EV_UIInstantAction_Refresh
"Refresh the server list"
);
CLASS_DECLARATION(UIWidget, UIInstantAction, NULL) {
{&EV_UIInstantAction_AcceptServer, &UIInstantAction::Connect },
{&EV_UIInstantAction_RejectServer, &UIInstantAction::Reject },
{&EV_UIInstantAction_Cancel, &UIInstantAction::CancelRefresh},
{&EV_UIInstantAction_Refresh, NULL },
{&EV_UIInstantAction_Refresh, &UIInstantAction::Refresh },
{NULL, NULL }
};
@ -542,6 +543,11 @@ void UIInstantAction::CancelRefresh(Event *ev)
ServerListHalt(serverList[1]);
}
void UIInstantAction::Refresh(Event *ev)
{
state = IA_INITIALIZE;
}
void UIInstantAction::EnableServerInfo(bool enable)
{
if (enable) {

View file

@ -28,11 +28,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../gamespy/goaceng.h"
typedef struct {
int serverType;
int serverType;
} ServerGame_t;
typedef struct {
GServer server;
GServer server;
ServerGame_t serverGame;
bool rejected;
} IAServer_t;
@ -65,12 +65,13 @@ public:
void Reject(Event *ev);
void Draw();
void Update();
int AddServer(GServer server, const ServerGame_t& serverGame);
int AddServer(GServer server, const ServerGame_t& serverGame);
void CancelRefresh(Event *ev);
void Refresh(Event *ev);
void EnableServerInfo(bool enable);
private:
static void IAServerListCallBack(GServerList serverlist, int msg, void* instance, void* param1, void* param2);
static void IAServerListCallBack(GServerList serverlist, int msg, void *instance, void *param1, void *param2);
private:
bool doneList[2];