-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add onClientChatboxLayoutChange event #3448
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, just left one comment.
std::stringstream ss; | ||
ss << std::stof(m_pChatScaleX->GetText()) << " " << std::stof(m_pChatScaleY->GetText()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SString constructor can do printf
formatting.
void SetChatLayoutChanged(bool changed) { m_bChatLayoutChanged = changed; }; | ||
bool GetChatLayoutChanged() const { return m_bChatLayoutChanged; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void SetChatLayoutChanged(bool changed) { m_bChatLayoutChanged = changed; }; | |
bool GetChatLayoutChanged() const { return m_bChatLayoutChanged; }; | |
void SetChatLayoutChanged(bool changed) { m_bChatLayoutChanged = changed; } | |
bool GetChatLayoutChanged() const { return m_bChatLayoutChanged; } |
@@ -13,6 +13,7 @@ | |||
#define ALLOC_STATS_MODULE_NAME "client" | |||
#include "SharedUtil.hpp" | |||
#include <core/CClientCommands.h> | |||
#include <../Client/core/CClientChatboxVariables.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header belongs in Client/sdk/core
if you want to interface between core and deathmatch.
int iR, iG, iB, iA; | ||
CLuaArguments chatboxItemList; | ||
|
||
for (unsigned int i = 0; i < MAX_CHATBOX_LAYOUT_CVARS; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use an array of struct for g_chatboxLayoutCVars
, and store the type of value next to the cvar name. For example:
enum class DummyType {
STRING,
BOOLEAN,
FLOAT1,
FLOAT2,
FLOAT4,
};
struct Dummy {
const char* name;
DummyType type;
};
Event: onClientChatboxLayoutChange
Description:
Triggered when the client changes any settings related to the chatbox layout.
Parameters:
chatboxLayout
: A table containing all CVars values related to the chatbox settings.Usage Example:
Resolves #696