Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add onClientChatboxLayoutChange event #3448

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

Open
XJMLN wants to merge 7 commits into multitheftauto:master
base: master
Choose a base branch
Loading
from XJMLN:feature/onChatboxLayoutChange

Conversation

@XJMLN
Copy link
Contributor

@XJMLN XJMLN commented Jun 9, 2024

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:

addEventHandler("onClientChatboxLayoutChange", root,
 function(chatboxLayout)
 iprint(chatboxLayout)
 end
)

Resolves #696

esmail9900 and Fernando-A-Rocha reacted with rocket emoji
Copy link
Member

@Lpsd Lpsd left a 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.

Comment on lines +3636 to +3637
std::stringstream ss;
ss << std::stof(m_pChatScaleX->GetText()) << " " << std::stof(m_pChatScaleY->GetText());
Copy link
Member

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.

Comment on lines +431 to +432
void SetChatLayoutChanged(bool changed) { m_bChatLayoutChanged = changed; };
bool GetChatLayoutChanged() const { return m_bChatLayoutChanged; };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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; }

#define ALLOC_STATS_MODULE_NAME "client"
#include "SharedUtil.hpp"
#include <core/CClientCommands.h>
#include <../Client/core/CClientChatboxVariables.h>
Copy link
Member

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++)
Copy link
Member

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;
};

@FileEX FileEX added enhancement New feature or request feedback Further information is requested labels Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tederis tederis tederis left review comments

@botder botder botder requested changes

@Lpsd Lpsd Lpsd requested changes

+1 more reviewer

@Fernando-A-Rocha Fernando-A-Rocha Fernando-A-Rocha approved these changes

Reviewers whose approvals may not affect merge requirements

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

enhancement New feature or request feedback Further information is requested

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

onChatboxLayoutChange event

AltStyle によって変換されたページ (->オリジナル) /