QtCraft API C++ classes QML types Handbook

QcClientSignEditor Class

The editor of a sign the server opened for the local player (decision E-766): the sign's position and lines (QcMsg::OpenSignEditor), and the lines the player writes (QcMsg::EditSign). More...

Header: #include <clientcore/session/QcClientSignEditor.h>
Inherits: QObject

Public Types

Sender

Public Functions

bool handle(const QcMessage &message)
bool isOpen() const
const QcSignText::Lines &lines() const
const QcClientSignEditor::Sender &messageSender() const
QcBlockPos pos() const
void setLines(const QcSignText::Lines &lines)
void setMessageSender(QcClientSignEditor::Sender sender)
bool write(const QcSignText::Lines &lines)

Signals

void closed()
void opened()

Detailed Description

The server checks and cleans them; the text everyone sees comes back as QcMsg::SignText into the world mirror. Part of QcClientSession; GUI-free.

Member Type Documentation

[alias] QcClientSignEditor::Sender

Sends a message to the server.

Member Function Documentation

[signal] void QcClientSignEditor::closed()

The editor closed and sent its lines (write()).

bool QcClientSignEditor::handle(const QcMessage &message)

Takes over message when it is OpenSignEditor. Returns false for other messages.

bool QcClientSignEditor::isOpen() const

Returns whether an editor is open.

const QcSignText::Lines &QcClientSignEditor::lines() const

Returns the lines as the server opened them or the player typed them.

See also setLines().

const QcClientSignEditor::Sender &QcClientSignEditor::messageSender() const

Returns how the editor sends to the server.

See also setMessageSender().

[signal] void QcClientSignEditor::opened()

The server opened the editor of a sign.

QcBlockPos QcClientSignEditor::pos() const

Returns where the sign is.

void QcClientSignEditor::setLines(const QcSignText::Lines &lines)

Sets lines, the lines as the player types them (pattern 1 of docs/UI-Leitfaden.md 5: the text holds at once); closing the editor sends them (the server refuses them from a dead player, so on death the typed text is lost). Ignored while no editor is open.

See also lines().

void QcClientSignEditor::setMessageSender(QcClientSignEditor::Sender sender)

Sets sender, how the editor sends to the server (the session's connection); a different name than QObject::sender().

See also messageSender().

bool QcClientSignEditor::write(const QcSignText::Lines &lines)

Sends lines for the open sign and closes the editor. Returns false when none is open.