Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Feb 5, 2020
1 parent 44a0143 commit b1f248a
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 3 deletions.
7 changes: 6 additions & 1 deletion includes/functions/LaboratoryPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use UniEngine\Engine\Modules\Development\Components\ModernQueue;
use UniEngine\Engine\Modules\Development\Screens\ResearchListPage\ModernQueuePlanetInfo;
use UniEngine\Engine\Modules\Development\Screens\ResearchListPage\ModernQueueLabUpgradeInfo;
use UniEngine\Engine\Includes\Helpers\Planets;
use UniEngine\Engine\Includes\Helpers\Users;

Expand Down Expand Up @@ -177,6 +178,9 @@ function LaboratoryPage(&$CurrentPlanet, $CurrentUser, $InResearch, $ThePlanet)
),
'timestamp' => $Now,
]);
$labsUpgradeInfoComponent = ModernQueueLabUpgradeInfo\render([
'planetsWithUnfinishedLabUpgrades' => []
]);

$queueComponent = ModernQueue\render([
'user' => &$CurrentUser,
Expand All @@ -187,7 +191,8 @@ function LaboratoryPage(&$CurrentPlanet, $CurrentUser, $InResearch, $ThePlanet)
'queueMaxLength' => Users\getMaxResearchQueueLength($CurrentUser),
'timestamp' => $Now,
'infoComponents' => [
$planetInfoComponent['componentHTML']
$planetInfoComponent['componentHTML'],
$labsUpgradeInfoComponent['componentHTML']
],

'getQueueElementCancellationLinkHref' => function ($queueElement) {
Expand Down
2 changes: 1 addition & 1 deletion language/en/buildings.lang
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $_Lang['InfoBox_ResearchTime'] = 'Research time';
$_Lang['Queue_Cancel_Research'] = 'Cancel research';
$_Lang['Queue_ResearchOn'] = 'Research conducted on ';
$_Lang['Queue_CantCancel_Premium_Lab'] = 'You cannot cancel research which required Dark Energy!';
$_Lang['Queue_LabInQueue'] = 'Queue is locked!<br/>Research lab is being upgraded on planets:<br/>%s';
$_Lang['Queue_LabInQueue'] = 'Queue is locked!<br/>Research lab is being upgraded on planets:';

$_Lang['Queue_ListView_Info'] = 'Research queue is available only when using the Grid Layout!';

Expand Down
2 changes: 1 addition & 1 deletion language/pl/buildings.lang
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $_Lang['InfoBox_ResearchTime'] = 'Czas badania';
$_Lang['Queue_Cancel_Research'] = 'Przerwij badanie';
$_Lang['Queue_ResearchOn'] = 'Badanie przeprowadzane na';
$_Lang['Queue_CantCancel_Premium_Lab'] = 'Nie można przerwać badania, które wymagało Ciemnej Energii!';
$_Lang['Queue_LabInQueue'] = 'Kolejka zablokowana!<br/>Laboratorium w rozbudowie na Planetach:<br/>%s';
$_Lang['Queue_LabInQueue'] = 'Kolejka zablokowana!<br/>Laboratorium w rozbudowie na Planetach:';

$_Lang['Queue_ListView_Info'] = 'Kolejka Badań jest dostępna tylko w Wyglądzie Kafelkowym!';

Expand Down
1 change: 1 addition & 0 deletions modules/development/_includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
include($includePath . './components/ModernQueue/ModernQueue.component.php');

include($includePath . './screens/ResearchListPage/ModernQueuePlanetInfo/ModernQueuePlanetInfo.component.php');
include($includePath . './screens/ResearchListPage/ModernQueueLabUpgradeInfo/ModernQueueLabUpgradeInfo.component.php');

});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace UniEngine\Engine\Modules\Development\Screens\ResearchListPage\ModernQueueLabUpgradeInfo;

// Arguments
// - $props (Object)
// - planetsWithUnfinishedLabUpgrades
//
// Returns: Object
// - componentHTML (String)
//
function render ($props) {
global $_Lang;

includeLang('worldElements.detailed');

$localTemplateLoader = createLocalTemplateLoader(__DIR__);

$planetsWithUnfinishedLabUpgrades = &$props['planetsWithUnfinishedLabUpgrades'];

$hasPlanetsWithUnfinishedLabUpgrades = !empty($planetsWithUnfinishedLabUpgrades);

$tplBodyCache = [
'queue_topinfo_planetlink' => $localTemplateLoader('row_infobox_planetlink'),
'queue_topinfo_otherplanetbox' => $localTemplateLoader('row_infobox_otherplanetbox'),
];

if (!$hasPlanetsWithUnfinishedLabUpgrades) {
return [
'componentHTML' => ''
];
}

$planetLinks = array_map(
function ($planet) use (&$tplBodyCache) {
$subcomponentTPLData = [
'Data_planetID' => $planet['id'],
'Data_planetName' => $planet['name'],
'Data_planetCoords_galaxy' => $planet['galaxy'],
'Data_planetCoords_system' => $planet['system'],
'Data_planetCoords_planet' => $planet['planet'],
];

return parsetemplate(
$tplBodyCache['queue_topinfo_planetlink'],
$subcomponentTPLData
);
},
$planetsWithUnfinishedLabUpgrades
);
$planetLinksHTML = implode('<br/>', $planetLinks);

return [
'componentHTML' => parsetemplate(
$tplBodyCache['queue_topinfo_otherplanetbox'],
[
'Lang_LabInQueue' => $_Lang['Queue_LabInQueue'],
'Data_planetLinks' => $planetLinksHTML
]
)
];
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

header("Location: ../index.php");

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<tr>
<th
class="pad5 red"
colspan="2"
>
{Lang_LabInQueue}:<br/>
{Data_planetLinks}
</th>
</tr>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<a class="orange" href="?cp={Data_planetID}&amp;re=0">
{Data_planetName}
[{Data_planetCoords_galaxy}:{Data_planetCoords_system}:{Data_planetCoords_planet}]
</a>

0 comments on commit b1f248a

Please sign in to comment.