mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
In-game message macros available immediately in active games (#5113)
* In-game message macros available immediately in active games * fix formatting * init sayMenu actions with sayMenu as parent
This commit is contained in:
parent
500b694cc6
commit
b4bfa17cee
4 changed files with 6 additions and 2 deletions
|
|
@ -419,6 +419,7 @@ Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, T
|
|||
|
||||
if (local) {
|
||||
sayMenu = playerMenu->addMenu(QString());
|
||||
connect(&SettingsCache::instance().messages(), SIGNAL(messageMacrosChanged()), this, SLOT(initSayMenu()));
|
||||
initSayMenu();
|
||||
}
|
||||
|
||||
|
|
@ -1036,7 +1037,7 @@ void Player::initSayMenu()
|
|||
sayMenu->setEnabled(count > 0);
|
||||
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto *newAction = new QAction(SettingsCache::instance().messages().getMessageAt(i), this);
|
||||
auto *newAction = new QAction(SettingsCache::instance().messages().getMessageAt(i), sayMenu);
|
||||
if (i < 10) {
|
||||
newAction->setShortcut(QKeySequence("Ctrl+" + QString::number((i + 1) % 10)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue