Rename team_* variables + add to deprecated

This commit is contained in:
slawkens 2023-07-13 15:13:15 +02:00
parent e7ef1679a0
commit 48ceada956
4 changed files with 39 additions and 32 deletions

View File

@ -17,19 +17,26 @@ $deprecatedConfig = [
'visitors_counter_ttl', 'visitors_counter_ttl',
'views_counter', 'views_counter',
'outfit_images_url', 'outfit_images_url',
'outfit_images_wrong_looktypes',
'item_images_url', 'item_images_url',
'account_country', 'account_country',
'team_display_outfit', 'online_record',
'team_display_status', 'online_vocations',
'team_display_world', 'online_vocations_images',
'team_display_lastlogin', 'online_skulls',
'online_outfit',
'online_afk',
'team_display_outfit' => 'team_outfit',
'team_display_status' => 'team_status',
'team_display_world' => 'team_world',
'team_display_lastlogin' => 'team_lastlogin',
'multiworld', 'multiworld',
]; ];
foreach ($deprecatedConfig as $value) { foreach ($deprecatedConfig as $key => $value) {
config( config(
[ [
$value, (is_string($key) ? $key : $value),
setting('core.'.$value) setting('core.'.$value)
] ]
); );

View File

@ -23,7 +23,7 @@ if(!$groups->count())
$outfit_addons = false; $outfit_addons = false;
$outfit = ''; $outfit = '';
if($config['team_display_outfit']) { if(setting('core.team_outfit')) {
$outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype';
if($db->hasColumn('players', 'lookaddons')) { if($db->hasColumn('players', 'lookaddons')) {
$outfit .= ', lookaddons'; $outfit .= ', lookaddons';
@ -56,12 +56,12 @@ foreach($groupList as $id => $group)
$members[] = array( $members[] = array(
'group_name' => $group->getName(), 'group_name' => $group->getName(),
'player' => $member, 'player' => $member,
'outfit' => $config['team_display_outfit'] ? $config['outfit_images_url'] . '?id=' . $member->getLookType() . ($outfit_addons ? '&addons=' . $member->getLookAddons() : '') . '&head=' . $member->getLookHead() . '&body=' . $member->getLookBody() . '&legs=' . $member->getLookLegs() . '&feet=' . $member->getLookFeet() : null, 'outfit' => setting('core.team_outfit') ? setting('core.outfit_images_url') . '?id=' . $member->getLookType() . ($outfit_addons ? '&addons=' . $member->getLookAddons() : '') . '&head=' . $member->getLookHead() . '&body=' . $member->getLookBody() . '&legs=' . $member->getLookLegs() . '&feet=' . $member->getLookFeet() : null,
'status' => $config['team_display_status'] ? $member->isOnline() : null, 'status' => setting('core.team_status') ? $member->isOnline() : null,
'link' => getPlayerLink($member->getName()), 'link' => getPlayerLink($member->getName()),
'flag_image' => $config['account_country'] ? getFlagImage($member->getAccount()->getCountry()) : null, 'flag_image' => setting('core.account_country') ? getFlagImage($member->getAccount()->getCountry()) : null,
'world_name' => ($config['multiworld'] || $config['team_display_world']) ? getWorldName($member->getWorldId()) : null, 'world_name' => (setting('core.multiworld') || setting('core.team_world')) ? getWorldName($member->getWorldId()) : null,
'last_login' => $config['team_display_lastlogin'] ? $lastLogin : null 'last_login' => setting('core.team_lastlogin') ? $lastLogin : null
); );
} }

View File

@ -588,25 +588,25 @@ Sent by MyAAC,<br/>
'options' => ['normal table', 'in boxes, grouped by group id'], 'options' => ['normal table', 'in boxes, grouped by group id'],
'default' => 1, 'default' => 1,
], ],
'team_display_status' => [ 'team_status' => [
'name' => 'Display Online Status', 'name' => 'Display Online Status',
'type' => 'boolean', 'type' => 'boolean',
'desc' => '', 'desc' => '',
'default' => true, 'default' => true,
], ],
'team_display_lastlogin' => [ 'team_lastlogin' => [
'name' => 'Display Last Login', 'name' => 'Display Last Login',
'type' => 'boolean', 'type' => 'boolean',
'desc' => '', 'desc' => '',
'default' => true, 'default' => true,
], ],
'team_display_world' => [ 'team_world' => [
'name' => 'Display World', 'name' => 'Display World',
'type' => 'boolean', 'type' => 'boolean',
'desc' => '', 'desc' => '',
'default' => false, 'default' => false,
], ],
'team_display_outfit' => [ 'team_outfit' => [
'name' => 'Display Outfit', 'name' => 'Display Outfit',
'type' => 'boolean', 'type' => 'boolean',
'desc' => '', 'desc' => '',

View File

@ -25,7 +25,7 @@
<b>Group</b> <b>Group</b>
</td> </td>
{% if config.team_display_outfit %} {% if setting('core.team_outfit') %}
<td width="5%" class="white"> <td width="5%" class="white">
<b>Outfit</b> <b>Outfit</b>
</td> </td>
@ -35,19 +35,19 @@
<b>Name</b> <b>Name</b>
</td> </td>
{% if config.team_display_status %} {% if setting('core.team_status') %}
<td class="white"> <td class="white">
<b>Status</b> <b>Status</b>
</td> </td>
{% endif %} {% endif %}
{% if (config.multiworld or config.team_display_world) %} {% if (setting('core.multiworld') or setting('core.team_world')) %}
<td class="white"> <td class="white">
<b>World</b> <b>World</b>
</td> </td>
{% endif %} {% endif %}
{% if config.team_display_lastlogin %} {% if setting('core.team_lastlogin') %}
<td class="white"> <td class="white">
<b>Last login</b> <b>Last login</b>
</td> </td>
@ -61,7 +61,7 @@
<tr bgcolor="{{ getStyle(i) }}" style="height: 32px;"> <tr bgcolor="{{ getStyle(i) }}" style="height: 32px;">
<td>{{ group.group_name|capitalize }}</td> <td>{{ group.group_name|capitalize }}</td>
{% if config.team_display_outfit %} {% if setting('core.team_outfit') %}
<td> <td>
<img style="position: absolute; margin-top: {% if member.player.looktype in config.outfit_images_wrong_looktypes %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/> <img style="position: absolute; margin-top: {% if member.player.looktype in config.outfit_images_wrong_looktypes %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/>
</td> </td>
@ -74,7 +74,7 @@
{{ member.link|raw }} {{ member.link|raw }}
</td> </td>
{% if config.team_display_status %} {% if setting('core.team_status') %}
<td> <td>
{% if member.status %} {% if member.status %}
<span style="color: green"><b>Online</b></span> <span style="color: green"><b>Online</b></span>
@ -84,13 +84,13 @@
</td> </td>
{% endif %} {% endif %}
{% if (config.multiworld or config.team_display_world) %} {% if (setting('core.multiworld') or setting('core.team_world')) %}
<td> <td>
<span><b>{{ member.world_name }}</b></span> <span><b>{{ member.world_name }}</b></span>
</td> </td>
{% endif %} {% endif %}
{% if config.team_display_lastlogin %} {% if setting('core.team_lastlogin') %}
<td> <td>
<span>{{ member.last_login }}</span> <span>{{ member.last_login }}</span>
</td> </td>
@ -107,7 +107,7 @@
<table cellspacing="1" cellpadding="4" border="0" width="100%"> <table cellspacing="1" cellpadding="4" border="0" width="100%">
<tr bgcolor="{{ config.vdarkborder }}"> <tr bgcolor="{{ config.vdarkborder }}">
{% if config.team_display_outfit %} {% if setting('core.team_outfit') %}
<td width="5%" class="white"> <td width="5%" class="white">
<b>Outfit</b> <b>Outfit</b>
</td> </td>
@ -117,19 +117,19 @@
<b>Name</b> <b>Name</b>
</td> </td>
{% if config.team_display_status %} {% if setting('core.team_status') %}
<td class="white"> <td class="white">
<b>Status</b> <b>Status</b>
</td> </td>
{% endif %} {% endif %}
{% if (config.multiworld or config.team_display_world) %} {% if (setting('core.multiworld') or setting('core.team_world')) %}
<td class="white"> <td class="white">
<b>World</b> <b>World</b>
</td> </td>
{% endif %} {% endif %}
{% if config.team_display_lastlogin %} {% if setting('core.team_lastlogin') %}
<td class="white"> <td class="white">
<b>Last login</b> <b>Last login</b>
</td> </td>
@ -139,7 +139,7 @@
{% for member in group.members %} {% for member in group.members %}
{% set i = i + 1 %} {% set i = i + 1 %}
<tr bgcolor="{{ getStyle(i) }}" style="height: 32px;"> <tr bgcolor="{{ getStyle(i) }}" style="height: 32px;">
{% if config.team_display_outfit %} {% if setting('core.team_outfit') %}
<td> <td>
<img style="position: absolute; margin-top: {% if member.player.looktype in config.outfit_images_wrong_looktypes %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/> <img style="position: absolute; margin-top: {% if member.player.looktype in config.outfit_images_wrong_looktypes %}-16px;margin-left:-0px;{% else %} -45px; margin-left: -30px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/>
</td> </td>
@ -152,7 +152,7 @@
{{ member.link|raw }} {{ member.link|raw }}
</td> </td>
{% if config.team_display_status %} {% if setting('core.team_status') %}
<td> <td>
{% if member.status %} {% if member.status %}
<span style="color: green"><b>Online</b></span> <span style="color: green"><b>Online</b></span>
@ -162,13 +162,13 @@
</td> </td>
{% endif %} {% endif %}
{% if (config.multiworld or config.team_display_world) %} {% if (setting('core.multiworld') or setting('core.team_world')) %}
<td> <td>
<span><b>{{ member.world_name }}</b></span> <span><b>{{ member.world_name }}</b></span>
</td> </td>
{% endif %} {% endif %}
{% if config.team_display_lastlogin %} {% if setting('core.team_lastlogin') %}
<td> <td>
<span>{{ member.last_login }}</span> <span>{{ member.last_login }}</span>
</td> </td>