mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-05 07:32:17 +03:00
feat(ui): implement Script_GetPlayerTradeMoney
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
This commit is contained in:
parent
3366ea2c89
commit
72d2c3b1a2
12
src/ui/game/CGTradeInfo.cpp
Normal file
12
src/ui/game/CGTradeInfo.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "ui/game/CGTradeInfo.hpp"
|
||||
|
||||
uint32_t CGTradeInfo::s_playerMoney;
|
||||
WOWGUID CGTradeInfo::s_tradingPlayer;
|
||||
|
||||
uint32_t CGTradeInfo::GetPlayerTradeMoney() {
|
||||
return CGTradeInfo::s_playerMoney;
|
||||
}
|
||||
|
||||
WOWGUID CGTradeInfo::GetTradePartner() {
|
||||
return CGTradeInfo::s_tradingPlayer;
|
||||
}
|
||||
19
src/ui/game/CGTradeInfo.hpp
Normal file
19
src/ui/game/CGTradeInfo.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef UI_GAME_C_G_TRADE_INFO_HPP
|
||||
#define UI_GAME_C_G_TRADE_INFO_HPP
|
||||
|
||||
#include "util/GUID.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
class CGTradeInfo {
|
||||
public:
|
||||
// Public static functions
|
||||
static uint32_t GetPlayerTradeMoney();
|
||||
static WOWGUID GetTradePartner();
|
||||
|
||||
private:
|
||||
// Private static variables
|
||||
static uint32_t s_playerMoney;
|
||||
static WOWGUID s_tradingPlayer;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -1,5 +1,7 @@
|
||||
#include "ui/game/TradeInfoScript.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "ui/game/CGTradeInfo.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
namespace {
|
||||
@ -41,7 +43,13 @@ int32_t Script_CancelTradeAccept(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_GetPlayerTradeMoney(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (CGTradeInfo::GetTradePartner()) {
|
||||
lua_pushnumber(L, CGTradeInfo::GetPlayerTradeMoney());
|
||||
} else {
|
||||
lua_pushnumber(L, 0);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Script_GetTargetTradeMoney(lua_State* L) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user