improved variable names
This commit is contained in:
parent
fc2012080b
commit
6d941a5772
@ -368,25 +368,25 @@ class TeamSpeakPlugin implements CallbackListener, CommandListener, ManialinkPag
|
|||||||
$closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace);
|
$closeQuad->setSubStyle(Quad_Icons64x64_1::SUBSTYLE_QuitRace);
|
||||||
$closeQuad->setAction(ManialinkManager::ACTION_CLOSEWIDGET);
|
$closeQuad->setAction(ManialinkManager::ACTION_CLOSEWIDGET);
|
||||||
|
|
||||||
$servername = new Label_Text();
|
$serverName = new Label_Text();
|
||||||
$frame->add($servername);
|
$frame->add($serverName);
|
||||||
$servername->setY($height / 2 - 4);
|
$serverName->setY($height / 2 - 4);
|
||||||
$servername->setX(-70);
|
$serverName->setX(-70);
|
||||||
$servername->setStyle($servername::STYLE_TextCardMedium);
|
$serverName->setStyle($serverName::STYLE_TextCardMedium);
|
||||||
$servername->setHAlign('left');
|
$serverName->setHAlign('left');
|
||||||
$servername->setTextSize(1);
|
$serverName->setTextSize(1);
|
||||||
$servername->setText('$oServername:$o ' . $this->serverData['server']['virtualserver_name']);
|
$serverName->setText('$oServername:$o ' . $this->serverData['server']['virtualserver_name']);
|
||||||
$servername->setTextColor('fff');
|
$serverName->setTextColor('fff');
|
||||||
|
|
||||||
$serverversion = new Label_Text();
|
$serverVersion = new Label_Text();
|
||||||
$frame->add($serverversion);
|
$frame->add($serverVersion);
|
||||||
$serverversion->setY($height / 2 - 4);
|
$serverVersion->setY($height / 2 - 4);
|
||||||
$serverversion->setX(2);
|
$serverVersion->setX(2);
|
||||||
$serverversion->setStyle($serverversion::STYLE_TextCardMedium);
|
$serverVersion->setStyle($serverVersion::STYLE_TextCardMedium);
|
||||||
$serverversion->setHAlign('left');
|
$serverVersion->setHAlign('left');
|
||||||
$serverversion->setTextSize(1);
|
$serverVersion->setTextSize(1);
|
||||||
$serverversion->setText('$oServerversion:$o ' . $this->serverData['server']['virtualserver_version']);
|
$serverVersion->setText('$oServerversion:$o ' . $this->serverData['server']['virtualserver_version']);
|
||||||
$serverversion->setTextColor('fff');
|
$serverVersion->setTextColor('fff');
|
||||||
|
|
||||||
$clients = new Label_Text();
|
$clients = new Label_Text();
|
||||||
$frame->add($clients);
|
$frame->add($clients);
|
||||||
@ -405,50 +405,50 @@ class TeamSpeakPlugin implements CallbackListener, CommandListener, ManialinkPag
|
|||||||
$channels->setStyle($channels::STYLE_TextCardMedium);
|
$channels->setStyle($channels::STYLE_TextCardMedium);
|
||||||
$channels->setHAlign('left');
|
$channels->setHAlign('left');
|
||||||
$channels->setTextSize(1);
|
$channels->setTextSize(1);
|
||||||
$nochannels = 0;
|
$noChannels = 0;
|
||||||
foreach ($this->serverData['channels'] as $channel) {
|
foreach ($this->serverData['channels'] as $channel) {
|
||||||
if ($channel['channel_maxclients'] == 0 || strpos($channel['channel_name'], 'spacer') > 0) {
|
if ($channel['channel_maxclients'] == 0 || strpos($channel['channel_name'], 'spacer') > 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$nochannels++;
|
$noChannels++;
|
||||||
}
|
}
|
||||||
$channels->setText('$oChannels:$o ' . $nochannels);
|
$channels->setText('$oChannels:$o ' . $noChannels);
|
||||||
$channels->setTextColor('fff');
|
$channels->setTextColor('fff');
|
||||||
|
|
||||||
// Join button
|
// Join button
|
||||||
$joinbutton = new Label_Button();
|
$joinButton = new Label_Button();
|
||||||
$frame->add($joinbutton);
|
$frame->add($joinButton);
|
||||||
$joinbutton->setWidth(150);
|
$joinButton->setWidth(150);
|
||||||
$joinbutton->setY($height / 2 - 11.5);
|
$joinButton->setY($height / 2 - 11.5);
|
||||||
$joinbutton->setStyle($joinbutton::STYLE_CardButtonSmallWide);
|
$joinButton->setStyle($joinButton::STYLE_CardButtonSmallWide);
|
||||||
$joinbutton->setText('Join TeamSpeak: ' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERHOST) . ':' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERPORT));
|
$joinButton->setText('Join TeamSpeak: ' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERHOST) . ':' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERPORT));
|
||||||
$joinbutton->setTextColor('fff');
|
$joinButton->setTextColor('fff');
|
||||||
$url = 'ts3server://' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERHOST) . '/?port=' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERPORT) . '&nickname=' . rawurlencode(Formatter::stripCodes($player->nickname));
|
$url = 'ts3server://' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERHOST) . '/?port=' . $this->maniaControl->settingManager->getSettingValue($this, self::TEAMSPEAK_SERVERPORT) . '&nickname=' . rawurlencode(Formatter::stripCodes($player->nickname));
|
||||||
$joinbutton->setUrl($url);
|
$joinButton->setUrl($url);
|
||||||
|
|
||||||
$leftlistQuad = new Quad();
|
$leftListQuad = new Quad();
|
||||||
$frame->add($leftlistQuad);
|
$frame->add($leftListQuad);
|
||||||
$leftlistQuad->setSize((($width / 2) - 5), ($height - 18));
|
$leftListQuad->setSize((($width / 2) - 5), ($height - 18));
|
||||||
$leftlistQuad->setX(-36);
|
$leftListQuad->setX(-36);
|
||||||
$leftlistQuad->setY($height / 2 - 46);
|
$leftListQuad->setY($height / 2 - 46);
|
||||||
$leftlistQuad->setStyles($quadStyle, $quadSubstyle);
|
$leftListQuad->setStyles($quadStyle, $quadSubstyle);
|
||||||
|
|
||||||
$channels = array();
|
$channels = array();
|
||||||
$users = array();
|
$users = array();
|
||||||
$userid = 0;
|
$userId = 0;
|
||||||
$i = 0;
|
$index = 0;
|
||||||
$startx = -69.5;
|
$startX = -69.5;
|
||||||
foreach ($this->serverData['channels'] as $channel) {
|
foreach ($this->serverData['channels'] as $channel) {
|
||||||
if ($channel['channel_maxclients'] == 0 || strpos($channel['channel_name'], 'spacer') > 0) {
|
if ($channel['channel_maxclients'] == 0 || strpos($channel['channel_name'], 'spacer') > 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$channelLabel = new Label_Text();
|
$channelLabel = new Label_Text();
|
||||||
$frame->add($channelLabel);
|
$frame->add($channelLabel);
|
||||||
$y = 17.5 + ($i * 2.5);
|
$y = 17.5 + ($index * 2.5);
|
||||||
$channelLabel->setY($height / 2 - $y);
|
$channelLabel->setY($height / 2 - $y);
|
||||||
$x = $startx;
|
$x = $startX;
|
||||||
if ($channel['pid'] != 0) {
|
if ($channel['pid'] != 0) {
|
||||||
$x = $startx + 5;
|
$x = $startX + 5;
|
||||||
}
|
}
|
||||||
$channelLabel->setX($x);
|
$channelLabel->setX($x);
|
||||||
$channelLabel->setStyle($channelLabel::STYLE_TextCardMedium);
|
$channelLabel->setStyle($channelLabel::STYLE_TextCardMedium);
|
||||||
@ -461,19 +461,19 @@ class TeamSpeakPlugin implements CallbackListener, CommandListener, ManialinkPag
|
|||||||
$channelLabel->setText('$o' . $channel['channel_name'] . '$o (' . $channel['total_clients'] . ')');
|
$channelLabel->setText('$o' . $channel['channel_name'] . '$o (' . $channel['total_clients'] . ')');
|
||||||
$channelLabel->setTextColor('fff');
|
$channelLabel->setTextColor('fff');
|
||||||
|
|
||||||
$channels[$i] = $channelLabel;
|
$channels[$index] = $channelLabel;
|
||||||
|
|
||||||
$i++;
|
$index++;
|
||||||
foreach ($this->serverData['users'] as $user) {
|
foreach ($this->serverData['users'] as $user) {
|
||||||
if ($user['cid'] == $channel['cid']) {
|
if ($user['cid'] == $channel['cid']) {
|
||||||
$userLabel = new Label_Text();
|
$userLabel = new Label_Text();
|
||||||
$frame->add($userLabel);
|
$frame->add($userLabel);
|
||||||
$y = 17.5 + ($i * 2.5);
|
$y = 17.5 + ($index * 2.5);
|
||||||
$userLabel->setY($height / 2 - $y);
|
$userLabel->setY($height / 2 - $y);
|
||||||
if ($channel['pid'] != 0) {
|
if ($channel['pid'] != 0) {
|
||||||
$x = $startx + 7;
|
$x = $startX + 7;
|
||||||
} else {
|
} else {
|
||||||
$x = $startx + 2;
|
$x = $startX + 2;
|
||||||
}
|
}
|
||||||
$userLabel->setX($x);
|
$userLabel->setX($x);
|
||||||
$userLabel->setStyle($userLabel::STYLE_TextCardMedium);
|
$userLabel->setStyle($userLabel::STYLE_TextCardMedium);
|
||||||
@ -482,21 +482,21 @@ class TeamSpeakPlugin implements CallbackListener, CommandListener, ManialinkPag
|
|||||||
$userLabel->setScale(0.9);
|
$userLabel->setScale(0.9);
|
||||||
$userLabel->setText($user['client_nickname']);
|
$userLabel->setText($user['client_nickname']);
|
||||||
$userLabel->setTextColor('fff');
|
$userLabel->setTextColor('fff');
|
||||||
$users[$userid] = $userLabel;
|
$users[$userId] = $userLabel;
|
||||||
|
|
||||||
$userid++;
|
$userId++;
|
||||||
$i++;
|
$index++;
|
||||||
|
|
||||||
if ($i > 22) {
|
if ($index > 22) {
|
||||||
$i = 0;
|
$index = 0;
|
||||||
$startx = 2.5;
|
$startX = 2.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($i > 22) {
|
if ($index > 22) {
|
||||||
$i = 0;
|
$index = 0;
|
||||||
$startx = 2.5;
|
$startX = 2.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user