mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
feat: add friend/ignore management (AddFriend, RemoveFriend, AddIgnore, DelIgnore)
AddFriend(name, note) and RemoveFriend(name) manage the friends list. AddIgnore(name) and DelIgnore(name) manage the ignore list. ShowFriends() is a stub (friends panel is ImGui-rendered). All backed by existing GameHandler methods that send the appropriate CMSG_ADD_FRIEND, CMSG_DEL_FRIEND, CMSG_ADD_IGNORE, CMSG_DEL_IGNORE packets to the server.
This commit is contained in:
parent
75db30c91e
commit
a503d09d9b
1 changed files with 30 additions and 0 deletions
|
|
@ -5182,6 +5182,36 @@ void LuaEngine::registerCoreAPI() {
|
||||||
if (gh) gh->requestPvpLog();
|
if (gh) gh->requestPvpLog();
|
||||||
return 0;
|
return 0;
|
||||||
}},
|
}},
|
||||||
|
// --- Social (Friend/Ignore) ---
|
||||||
|
{"AddFriend", [](lua_State* L) -> int {
|
||||||
|
auto* gh = getGameHandler(L);
|
||||||
|
const char* name = luaL_checkstring(L, 1);
|
||||||
|
const char* note = luaL_optstring(L, 2, "");
|
||||||
|
if (gh) gh->addFriend(name, note);
|
||||||
|
return 0;
|
||||||
|
}},
|
||||||
|
{"RemoveFriend", [](lua_State* L) -> int {
|
||||||
|
auto* gh = getGameHandler(L);
|
||||||
|
const char* name = luaL_checkstring(L, 1);
|
||||||
|
if (gh) gh->removeFriend(name);
|
||||||
|
return 0;
|
||||||
|
}},
|
||||||
|
{"AddIgnore", [](lua_State* L) -> int {
|
||||||
|
auto* gh = getGameHandler(L);
|
||||||
|
const char* name = luaL_checkstring(L, 1);
|
||||||
|
if (gh) gh->addIgnore(name);
|
||||||
|
return 0;
|
||||||
|
}},
|
||||||
|
{"DelIgnore", [](lua_State* L) -> int {
|
||||||
|
auto* gh = getGameHandler(L);
|
||||||
|
const char* name = luaL_checkstring(L, 1);
|
||||||
|
if (gh) gh->removeIgnore(name);
|
||||||
|
return 0;
|
||||||
|
}},
|
||||||
|
{"ShowFriends", [](lua_State* L) -> int {
|
||||||
|
(void)L; // Friends panel is shown via ImGui, not Lua
|
||||||
|
return 0;
|
||||||
|
}},
|
||||||
// --- Who ---
|
// --- Who ---
|
||||||
{"GetNumWhoResults", [](lua_State* L) -> int {
|
{"GetNumWhoResults", [](lua_State* L) -> int {
|
||||||
auto* gh = getGameHandler(L);
|
auto* gh = getGameHandler(L);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue