Skip to content

Commit

Permalink
0.91.23 Fix shadow in text output
Browse files Browse the repository at this point in the history
  • Loading branch information
araszka committed Jul 4, 2020
1 parent 5a920e9 commit 716199d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/Classes/ChatMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ public function getMessage(): string
$parts .= $part;
}

$message = sprintf('$s$%s$<$fff%s$> $s%s', $this->color, $this->icon, $parts);
$message = ($this->icon ? $this->icon . ' ' : '') . sprintf('$%s%s', $this->color, $parts);

if (substr($message, -1) != '.') {
$message .= '.';
}

return $message;
return '$z$s' . preg_replace('/\$s/i', '', $message);
}

/**
Expand Down
1 change: 0 additions & 1 deletion core/Classes/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public static function sendRecordsChunk(string $table, string $configId, string
$fill = config($configId . '.rows', 16);

if ($count <= $fill) {
dump("default");
$recordsJson = DB::table($table)
->selectRaw('Rank as rank, `' . $table . '`.Score as score, NickName as name, Login as login, "[]" as cps')
->leftJoin('players', 'players.id', '=', $table . '.Player')
Expand Down
6 changes: 4 additions & 2 deletions core/Controllers/ChatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,17 @@ public static function playerChat(Player $player, $text)
{
Log::write('<fg=yellow>[' . $player . '] ' . $text . '</>', true);

$name = $player->NickName;
$name = preg_replace('/\$s/i', '', $player->NickName);
$text = preg_replace('/\$s/i', '', $text);

if ($player->isSpectator()) {
$name = '$<$eee$> $fff' . $name;
}

$chatColor = config('theme.chat.text');
$groupIcon = $player->group->chat_prefix ?? '';
$groupColor = $player->group->color ?? $chatColor;
$chatText = sprintf('$<$%s%s [$<%s$>]$> $%s%s', $groupColor, $groupIcon, $name, $chatColor, $text);
$chatText = sprintf('$z$s$<$%s%s [$<%s$>]$> $%s%s', $groupColor, $groupIcon, secondary($name), $chatColor, $text);

Server::ChatSendServerMessage($chatText);
}
Expand Down
3 changes: 3 additions & 0 deletions core/Modules/Dedimania/Dedimania.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public static function sendUpdatedDedis(Player $player = null)
Utility::sendRecordsChunk(self::TABLE, 'locals', 'LocalRecords.update', $player);
}

/**
* @param Map $map
*/
public static function beginMap(Map $map)
{
self::getChallengeRecords($map, ModeController::isTimeAttack());
Expand Down
6 changes: 4 additions & 2 deletions core/Modules/Statistics/Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ public static function showScores(Collection $players)
//Top Ranks
$statCollection->push(new StatisticWidget('Rank', " Top Ranks", '', '.', null, true, false));

//Top Donators
$statCollection->push(new StatisticWidget('Donations', " Top Donators", '', ' Planets'));
//Top Planets-Donators
if(isManiaPlanet()){
$statCollection->push(new StatisticWidget('Donations', " Top Donators", '', ' Planets'));
}

//Round average
if (self::$scores->count() > 0) {
Expand Down
2 changes: 1 addition & 1 deletion core/Modules/Statistics/Templates/widgets.latte.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<frame pos="{$statisticWidget->pos}" scale="{$statisticWidget->scale ?? 0.75}" data-show="{$statisticWidget->show ?? 6}">
<quad class="bg-dark" z-index="-1" size="50 {($statisticWidget->config->show ?? 6) * 4 + 8}" opacity="0.8"/>
<label class="text-light" pos="2 -3" z-index="1" size="48 3" text="{$statisticWidget->title}" textsize=".8" valign="center"/>
<quad class="bg-accent" z-index="0" size="50 6" bgcolor="{config('colors.ui.widget.header.color')}c"/>
<quad class="bg-accent" z-index="0" size="50 6"/>
<frame pos="0 -5" size="50 {($statisticWidget->config->show ?? 6) * 5}">
{foreach $statisticWidget->records as $player => $stat}
{if $statisticWidget->nameLeft}
Expand Down
4 changes: 2 additions & 2 deletions core/Modules/Statistics/statistics.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"show": 6
},
"Donations": {
"pos": "80 89",
"pos": "80 63.68",
"scale": 0.76,
"show": 6
},
Expand All @@ -40,7 +40,7 @@
"show": 6
},
"PopularMaps": {
"pos": "80 63.68",
"pos": "80 89",
"scale": 0.76,
"show": 6
}
Expand Down
2 changes: 1 addition & 1 deletion core/global-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function now(): Carbon
*/
function secondary(string $str = ""): string
{
return '$<$' . config('theme.chat.highlight') . $str . '$>';
return '$<$fff$' . config('theme.chat.highlight') . $str . '$>';
}

/**
Expand Down

0 comments on commit 716199d

Please sign in to comment.