added UIScript CreateCurrentServerFavorite to add the current joined server to favourites
This commit is contained in:
parent
d59e70ff2a
commit
fea894cd5e
1
deps/asio
vendored
Submodule
1
deps/asio
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 722f7e2be05a51c69644662ec514d6149b2b7ef8
|
@ -688,6 +688,18 @@ namespace Components
|
|||||||
{
|
{
|
||||||
ServerList::StoreFavourite(Dvar::Var("ui_favoriteAddress").Get<std::string>());
|
ServerList::StoreFavourite(Dvar::Var("ui_favoriteAddress").Get<std::string>());
|
||||||
});
|
});
|
||||||
|
UIScript::Add("CreateCurrentServerFavorite", []()
|
||||||
|
{
|
||||||
|
if (Dvar::Var("cl_ingame").Get<bool>())
|
||||||
|
{
|
||||||
|
Network::Address address(reinterpret_cast<Game::netadr_t*>(0xA1E888));
|
||||||
|
std::string addressText = address.GetString();
|
||||||
|
if (addressText != "0.0.0.0:0")
|
||||||
|
{
|
||||||
|
ServerList::StoreFavourite(addressText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Add required ownerDraws
|
// Add required ownerDraws
|
||||||
UIScript::AddOwnerDraw(220, ServerList::UpdateSource);
|
UIScript::AddOwnerDraw(220, ServerList::UpdateSource);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user