Skip to content

Commit

Permalink
Fixed mp connection. Exported mp classes to scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
qweasdd136963 committed Sep 29, 2018
1 parent fdc6fc5 commit f2771f3
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 17 deletions.
96 changes: 93 additions & 3 deletions src/xrGame/ui/UIWindow_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include "UILabel.h"
#include "UIMMShniaga.h"
#include "UISleepStatic.h"
#include "ServerList.h"
#include "UIMapInfo.h"
#include "xrUICore/ComboBox/UIComboBox.h"
#include "UIMapList.h"
#include "ScriptXMLInit.h"
#include "xrScriptEngine/ScriptExporter.hpp"

Expand All @@ -14,9 +18,12 @@ using namespace luabind::policy;

// clang-format off
SCRIPT_EXPORT(CDialogHolder, (), {
module(luaState)[class_<CDialogHolder>("CDialogHolder")
.def("AddDialogToRender", &CDialogHolder::AddDialogToRender)
.def("RemoveDialogToRender", &CDialogHolder::RemoveDialogToRender)];
module(luaState)
[
class_<CDialogHolder>("CDialogHolder")
.def("AddDialogToRender", &CDialogHolder::AddDialogToRender)
.def("RemoveDialogToRender", &CDialogHolder::RemoveDialogToRender)
];
});

SCRIPT_EXPORT(CUIDialogWnd, (CUIWindow), {
Expand Down Expand Up @@ -59,4 +66,87 @@ SCRIPT_EXPORT(CUIMMShniaga, (CUIWindow), {

SCRIPT_EXPORT(CUISleepStatic, (CUIStatic),
{ module(luaState)[class_<CUISleepStatic, CUIStatic>("CUISleepStatic").def(constructor<>())]; });

SCRIPT_EXPORT(SServerFilters, (), {
module(luaState)
[
class_<SServerFilters>("SServerFilters")
.def(constructor<>())
.def_readwrite("empty", &SServerFilters::empty)
.def_readwrite("full", &SServerFilters::full)
.def_readwrite("with_pass", &SServerFilters::with_pass)
.def_readwrite("without_pass", &SServerFilters::without_pass)
.def_readwrite("without_ff", &SServerFilters::without_ff)
.def_readwrite("listen_servers", &SServerFilters::listen_servers)
];
});

SCRIPT_EXPORT(connect_error_cb, (), {
module(luaState)
[
class_<connect_error_cb>("connect_error_cb")
.def(constructor<>())
.def(constructor<connect_error_cb::lua_object_type, connect_error_cb::lua_function_type>())
.def("bind", &connect_error_cb::bind)
.def("clear", &connect_error_cb::clear)
];
});

SCRIPT_EXPORT(CServerList, (CUIWindow), {
module(luaState)
[
class_<CServerList, CUIWindow>("CServerList")
.def(constructor<>())
.enum_("enum_connect_errcode")
[
value("ece_unique_nick_not_registred", int(ece_unique_nick_not_registred)),
value("ece_unique_nick_expired", int(ece_unique_nick_expired))
]
.def("SetConnectionErrCb", &CServerList::SetConnectionErrCb)
.def("ConnectToSelected", &CServerList::ConnectToSelected)
.def("SetFilters", &CServerList::SetFilters)
.def("SetPlayerName", &CServerList::SetPlayerName)
.def("RefreshList", &CServerList::RefreshGameSpyList)
.def("RefreshQuick", &CServerList::RefreshQuick)
.def("ShowServerInfo", &CServerList::ShowServerInfo)
.def("NetRadioChanged", &CServerList::NetRadioChanged)
.def("SetSortFunc", &CServerList::SetSortFunc)
];
});

SCRIPT_EXPORT(CUIMapList, (CUIWindow), {
module(luaState)[class_<CUIMapList, CUIWindow>("CUIMapList")
.def(constructor<>())
.def("SetWeatherSelector", &CUIMapList::SetWeatherSelector)
.def("SetModeSelector", &CUIMapList::SetModeSelector)
.def("OnModeChange", &CUIMapList::OnModeChange)
.def("LoadMapList", &CUIMapList::LoadMapList)
.def("SaveMapList", &CUIMapList::SaveMapList)
.def("GetCommandLine", &CUIMapList::GetCommandLine)
.def("SetServerParams", &CUIMapList::SetServerParams)
.def("GetCurGameType", &CUIMapList::GetCurGameType)
.def("StartDedicatedServer", &CUIMapList::StartDedicatedServer)
.def("SetMapPic", &CUIMapList::SetMapPic)
.def("SetMapInfo", &CUIMapList::SetMapInfo)
.def("ClearList", &CUIMapList::ClearList)
.def("IsEmpty", &CUIMapList::IsEmpty)];
});

SCRIPT_EXPORT(EnumGameIDs, (), {
class EnumGameIDs
{
};
module(luaState)
[
class_<EnumGameIDs>("GAME_TYPE")
.enum_("gametype")
[
value("GAME_UNKNOWN", int(-1)),
value("eGameIDDeathmatch", int(eGameIDDeathmatch)),
value("eGameIDTeamDeathmatch", int(eGameIDTeamDeathmatch)),
value("eGameIDArtefactHunt", int(eGameIDArtefactHunt)),
value("eGameIDCaptureTheArtefact", int(eGameIDCaptureTheArtefact))
]
];
});
// clang-format on
14 changes: 0 additions & 14 deletions src/xrUICore/ListBox/UIListBox_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,4 @@ SCRIPT_EXPORT(CUIListBoxItemMsgChain, (CUIListBoxItem), {
.def(constructor<float>())
];
});

SCRIPT_EXPORT(EnumGameIDs, (), {
class EnumGameIDs
{
};
module(luaState)
[
class_<EnumGameIDs>("GAME_TYPE")
.enum_("gametype")
[
value("GAME_UNKNOWN", int(-1))
]
];
});
// clang-format on

0 comments on commit f2771f3

Please sign in to comment.