You scored phrase for game service messages. Game layout bug fix.

This commit is contained in:
John Preston 2016-09-29 12:10:32 +03:00
parent 139882113d
commit 73a8d27bfd
3 changed files with 13 additions and 7 deletions

View File

@ -581,8 +581,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_action_pinned_media_location" = "a location mark";
"lng_action_pinned_media_sticker" = "a sticker";
"lng_action_pinned_media_emoji_sticker" = "a {emoji} sticker";
"lng_action_pinned_media_game" = "a game «{game}»";
"lng_action_pinned_media_game" = "the game «{game}»";
"lng_action_game_score" = "{from} scored {count:#|#|#} in {game}";
"lng_action_game_you_scored" = "You scored {count:#|#|#} in {game}";
"lng_profile_migrate_reached" = "{count:_not_used_|# member|# members} limit reached";
"lng_profile_migrate_body" = "To get over this limit, you can upgrade your group to a supergroup.";

View File

@ -2959,7 +2959,8 @@ void HistoryGame::initDimensions() {
_minh = 0;
int32 titleMinHeight = _title.isEmpty() ? 0 : _lineHeight;
int32 descMaxLines = (4 + (titleMinHeight ? 0 : 1));
// enable any count of lines in game description / message
int descMaxLines = 4096;
int32 descriptionMinHeight = _description.isEmpty() ? 0 : qMin(_description.minHeight(), descMaxLines * _lineHeight);
if (!_title.isEmpty()) {

View File

@ -1968,7 +1968,7 @@ bool HistoryService::preparePinnedText(const QString &from, QString *outText, Li
bool HistoryService::prepareGameScoreText(const QString &from, QString *outText, Links *outLinks) {
bool result = false;
QString text;
QString gameTitle;
ClickHandlerPtr second;
auto gamescore = Get<HistoryServiceGameScore>();
@ -1981,15 +1981,19 @@ bool HistoryService::prepareGameScoreText(const QString &from, QString *outText,
}
return lang(lng_deleted_message);
};
text = lng_action_game_score(lt_from, from, lt_count, gamescore->score, lt_game, getGameTitle());
gameTitle = getGameTitle();
result = true;
} else if (gamescore && gamescore->msgId) {
text = lng_action_game_score(lt_from, from, lt_count, gamescore->score, lt_game, lang(lng_contacts_loading));
gameTitle = lang(lng_contacts_loading);
result = true;
} else {
text = lng_action_game_score(lt_from, from, lt_count, gamescore->score, lt_game, lang(lng_deleted_message));
gameTitle = lang(lng_deleted_message);
}
if (_from->isSelf()) {
*outText = lng_action_game_you_scored(lt_count, gamescore->score, lt_game, gameTitle);
} else {
*outText = lng_action_game_score(lt_from, from, lt_count, gamescore->score, lt_game, gameTitle);
}
*outText = text;
if (second) {
outLinks->push_back(second);
}