aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2022-06-04 06:26:32 +0300
committerGitHub <noreply@github.com>2022-06-03 22:26:32 -0500
commitd4e395627131befea60d19a35373582894eb17d3 (patch)
tree5536ab0a6367cc867fab12b28a1c8e2e8f9db6e9 /src
parentc3a5bfb98a50396a75b29bb39c4b3eb25b1353c5 (diff)
improve placeholder text for IC and OOC (#753)
* improve placeholder text for IC and OOC * Keep showname box placeholder at "showname" so as not to be confusing * Apply my own suggestions * Revert "Keep showname box placeholder at "showname" so as not to be confusing" This reverts commit bad5507b9e4b9501d27b7b46e66c5e1cc2eb9859. * Bring back showname for showname box let "update_character" handle placeholder text properly Fix spectator placeholder text not appearing if switching to spectator using /switch, etc. * fix an oopsie Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/charselect.cpp7
-rw-r--r--src/courtroom.cpp10
2 files changed, 7 insertions, 10 deletions
diff --git a/src/charselect.cpp b/src/charselect.cpp
index 7b9308a4..d57d7518 100644
--- a/src/charselect.cpp
+++ b/src/charselect.cpp
@@ -188,13 +188,6 @@ void Courtroom::char_clicked(int n_char)
enter_courtroom();
set_courtroom_size();
}
-
- if (n_char != -1) {
- ui_ic_chat_name->setPlaceholderText(char_list.at(n_char).name);
- }
- else {
- ui_ic_chat_name->setPlaceholderText("Spectator");
- }
}
void Courtroom::put_button_in_place(int starting, int chars_on_this_page)
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index c525ef14..ee977150 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -173,7 +173,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
ui_ic_chat_message = new QLineEdit(this);
ui_ic_chat_message->setFrame(false);
- ui_ic_chat_message->setPlaceholderText(tr("Message"));
+ ui_ic_chat_message->setPlaceholderText(tr("Message in-character"));
ui_ic_chat_message_filter = new AOLineEditFilter();
ui_ic_chat_message_filter->preserve_selection = true;
ui_ic_chat_message->installEventFilter(ui_ic_chat_message_filter);
@@ -191,6 +191,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
ui_ooc_chat_message = new QLineEdit(this);
ui_ooc_chat_message->setFrame(false);
ui_ooc_chat_message->setObjectName("ui_ooc_chat_message");
+ ui_ooc_chat_message->setPlaceholderText(tr("Message out-of-character"));
ui_ooc_chat_name = new QLineEdit(this);
ui_ooc_chat_name->setFrame(false);
@@ -1553,9 +1554,12 @@ void Courtroom::update_character(int p_cid)
}
}
- if (m_cid != -1) // there is no name at char_list -1, and we crash if we try
- // to find one
+ if (m_cid != -1) {
ui_ic_chat_name->setPlaceholderText(char_list.at(m_cid).name);
+ }
+ else {
+ ui_ic_chat_name->setPlaceholderText("Spectator");
+ }
ui_char_select_background->hide();
ui_ic_chat_message->setEnabled(m_cid != -1);
ui_ic_chat_message->setFocus();