![]() |
DDNet documentation
|
#include <chat.h>
Classes | |
| class | CLine |
| class | CRateablePlayer |
| struct | CCommand |
| struct | CHistoryEntry |
Public Member Functions | |
| CChat () | |
| int | Sizeof () const override |
| bool | IsActive () const |
| void | AddLine (int ClientId, int Team, const char *pLine) |
| void | EnableMode (int Team) |
| void | DisableMode () |
| void | RegisterCommand (const char *pName, const char *pParams, const char *pHelpText) |
| void | UnregisterCommand (const char *pName) |
| void | Echo (const char *pString) |
| void | OnWindowResize () override |
| void | OnConsoleInit () override |
| void | OnStateChange (int NewState, int OldState) override |
| void | OnRender () override |
| void | OnPrepareLines (float y) |
| void | Reset () |
| void | OnRelease () override |
| void | OnMessage (int MsgType, void *pRawMsg) override |
| bool | OnInput (const IInput::CEvent &Event) override |
| void | OnInit () override |
| void | RebuildChat () |
| void | ClearLines () |
| void | EnsureCoherentFontSize () const |
| void | EnsureCoherentWidth () const |
| float | FontSize () const |
| float | MessagePaddingX () const |
| float | MessagePaddingY () const |
| float | MessageTeeSize () const |
| float | MessageRounding () const |
| void | SendChat (int Team, const char *pLine) |
| void | SendChatQueued (const char *pLine) |
| Public Member Functions inherited from CComponent | |
| virtual void | OnShutdown () |
| virtual void | OnReset () |
| virtual void | OnUpdate () |
| virtual void | OnNewSnapshot () |
| virtual void | OnMapLoad () |
| virtual bool | OnCursorMove (float x, float y, IInput::ECursorType CursorType) |
| virtual bool | OnTouchState (std::vector< IInput::CTouchFingerState > &vTouchFingerStates) |
| Public Member Functions inherited from CComponentInterfaces | |
| virtual void | OnInterfacesInit (CGameClient *pClient) |
| virtual | ~CComponentInterfaces ()=default |
Static Public Attributes | |
| static constexpr float | MESSAGE_TEE_PADDING_RIGHT = 0.5f |
Private Types | |
| enum | { MAX_LINES = 64 } |
| enum | { CLIENT_MSG = -2 , SERVER_MSG = -1 } |
| enum | { MODE_NONE = 0 , MODE_ALL , MODE_TEAM } |
| enum | { CHAT_SERVER = 0 , CHAT_HIGHLIGHT , CHAT_CLIENT , CHAT_NUM } |
Private Member Functions | |
| bool | LineShouldHighlight (const char *pLine, const char *pName) |
| void | StoreSave (const char *pText) |
Static Private Member Functions | |
| static void | ConSay (IConsole::IResult *pResult, void *pUserData) |
| static void | ConSayTeam (IConsole::IResult *pResult, void *pUserData) |
| static void | ConChat (IConsole::IResult *pResult, void *pUserData) |
| static void | ConShowChat (IConsole::IResult *pResult, void *pUserData) |
| static void | ConEcho (IConsole::IResult *pResult, void *pUserData) |
| static void | ConClearChat (IConsole::IResult *pResult, void *pUserData) |
| static void | ConchainChatOld (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) |
| static void | ConchainChatFontSize (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) |
| static void | ConchainChatWidth (IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData) |
Private Attributes | |
| CLineInputBuffered< MAX_CHAT_LENGTH > | m_Input |
| bool | m_PrevScoreBoardShowed |
| bool | m_PrevShowChat |
| CLine | m_aLines [MAX_LINES] |
| int | m_CurrentLine |
| int | m_Mode |
| bool | m_Show |
| bool | m_CompletionUsed |
| int | m_CompletionChosen |
| char | m_aCompletionBuffer [MAX_CHAT_LENGTH] |
| int | m_PlaceholderOffset |
| int | m_PlaceholderLength |
| CRateablePlayer | m_aPlayerCompletionList [MAX_CLIENTS] |
| int | m_PlayerCompletionListLength |
| std::vector< CCommand > | m_vServerCommands |
| bool | m_ServerCommandsNeedSorting |
| CHistoryEntry * | m_pHistoryEntry |
| CStaticRingBuffer< CHistoryEntry, 64 *1024, CRingBufferBase::FLAG_RECYCLE > | m_History |
| int | m_PendingChatCounter |
| int64_t | m_LastChatSend |
| int64_t | m_aLastSoundPlayed [CHAT_NUM] |
| bool | m_IsInputCensored |
| char | m_aCurrentInputText [MAX_CHAT_LENGTH] |
| bool | m_EditingNewLine |
| bool | m_ServerSupportsCommandInfo |
Static Private Attributes | |
| static constexpr float | CHAT_HEIGHT_FULL = 200.0f |
| static constexpr float | CHAT_HEIGHT_MIN = 50.0f |
| static constexpr float | CHAT_FONTSIZE_WIDTH_RATIO = 2.5f |
| static char | ms_aDisplayText [MAX_CHAT_LENGTH] = "" |
Additional Inherited Members | |
| Protected Member Functions inherited from CComponentInterfaces | |
| class CGameClient * | GameClient () const |
| class IClient * | Client () const |
| class IKernel * | Kernel () const |
| class IEngine * | Engine () const |
| class IGraphics * | Graphics () const |
| class ITextRender * | TextRender () const |
| class IInput * | Input () const |
| class IStorage * | Storage () const |
| class CUi * | Ui () const |
| class ISound * | Sound () const |
| class CRenderTools * | RenderTools () const |
| class CRenderMap * | RenderMap () const |
| class IConfigManager * | ConfigManager () const |
| class CConfig * | Config () const |
| class IConsole * | Console () const |
| class IDemoPlayer * | DemoPlayer () const |
| class IDemoRecorder * | DemoRecorder (int Recorder) const |
| class IFavorites * | Favorites () const |
| class IServerBrowser * | ServerBrowser () const |
| class CLayers * | Layers () const |
| class CCollision * | Collision () const |
| int64_t | time () const |
| float | LocalTime () const |
| class IHttp * | Http () const |
| CChat::CChat | ( | ) |
| void CChat::AddLine | ( | int | ClientId, |
| int | Team, | ||
| const char * | pLine ) |
| void CChat::ClearLines | ( | ) |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
| void CChat::DisableMode | ( | ) |
| void CChat::Echo | ( | const char * | pString | ) |
| void CChat::EnableMode | ( | int | Team | ) |
| void CChat::EnsureCoherentFontSize | ( | ) | const |
| void CChat::EnsureCoherentWidth | ( | ) | const |
|
inline |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Called to let the components register their console commands.
Reimplemented from CComponent.
|
overridevirtual |
Called to let the components run initialization code.
Reimplemented from CComponent.
|
overridevirtual |
|
overridevirtual |
Called when receiving a network message.
| Msg | The message type. |
| pRawMsg | The message data. |
Reimplemented from CComponent.
| void CChat::OnPrepareLines | ( | float | y | ) |
|
overridevirtual |
Called when the input gets released, for example when a text box loses focus.
Reimplemented from CComponent.
|
overridevirtual |
Called when the component should get rendered.
The render order depends on the component insertion order.
Reimplemented from CComponent.
|
overridevirtual |
This method is called when the client changes state, e.g from offline to online.
Reimplemented from CComponent.
|
overridevirtual |
Called when the window has been resized.
Reimplemented from CComponent.
| void CChat::RebuildChat | ( | ) |
| void CChat::RegisterCommand | ( | const char * | pName, |
| const char * | pParams, | ||
| const char * | pHelpText ) |
| void CChat::Reset | ( | ) |
| void CChat::SendChat | ( | int | Team, |
| const char * | pLine ) |
| void CChat::SendChatQueued | ( | const char * | pLine | ) |
|
inlineoverridevirtual |
Gets the size of the non-abstract component.
Implements CComponent.
|
private |
| void CChat::UnregisterCommand | ( | const char * | pName | ) |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexpr |
|
staticprivate |