mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 04:26:03 +00:00
D2S chars reverted skills display
This commit is contained in:
parent
2a8ba701a7
commit
dc7e046077
@ -84,6 +84,7 @@ EOT;
|
|||||||
$radio .= "<label for='$difficulty'>$difficulty</label><br>";
|
$radio .= "<label for='$difficulty'>$difficulty</label><br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$skills = '';
|
||||||
/*
|
/*
|
||||||
'skills' =>
|
'skills' =>
|
||||||
array (size=1)
|
array (size=1)
|
||||||
@ -99,76 +100,12 @@ EOT;
|
|||||||
'col' => int 2
|
'col' => int 2
|
||||||
'icon' => int 0
|
'icon' => int 0
|
||||||
*/
|
*/
|
||||||
// $skillcounter = 1;
|
|
||||||
// foreach ($c->cData['skills']['skills'] as $k => $skill) {
|
|
||||||
// $skills .= "<input cmd='skills' style='width: 64px;' class='skill-$k skill' name='$skillcounter' type='number' min='0' max='255' value='{$skill['points']}'>: {$skill['skill']}<hr>";
|
|
||||||
// $skillcounter++;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// Sort the skills array by page
|
|
||||||
usort($c->cData['skills']['skills'], function($a, $b) {
|
|
||||||
return $a['page'] <=> $b['page'];
|
|
||||||
});
|
|
||||||
|
|
||||||
$skills = '';
|
|
||||||
$skillcounter = 1;
|
$skillcounter = 1;
|
||||||
$currentPage = null;
|
|
||||||
$tabLinks = '';
|
|
||||||
$tabContents = '';
|
|
||||||
|
|
||||||
foreach ($c->cData['skills']['skills'] as $k => $skill) {
|
foreach ($c->cData['skills']['skills'] as $k => $skill) {
|
||||||
// Check if the current skill is on a new page
|
$skills .= "<input cmd='skills' style='width: 64px;' class='skill-$k skill' name='$skillcounter' type='number' min='0' max='255' value='{$skill['points']}'>: {$skill['skill']}<hr>";
|
||||||
if ($skill['page'] !== $currentPage) {
|
|
||||||
// Close the previous tab content (if any)
|
|
||||||
if ($currentPage !== null) {
|
|
||||||
$tabContents .= "</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate tab link
|
|
||||||
$tabLinks .= "<li class='nav-item'>";
|
|
||||||
$tabLinks .= "<a class='nav-link" . ($currentPage === null ? " active" : "") . "' data-toggle='tab' href='#page{$skill['page']}'>Page {$skill['page']}</a>";
|
|
||||||
$tabLinks .= "</li>";
|
|
||||||
|
|
||||||
// Start a new tab content for the current page
|
|
||||||
$tabContents .= "<div id='page{$skill['page']}' class='tab-pane fade" . ($currentPage === null ? " show active" : "") . "' role='tabpanel'>";
|
|
||||||
$currentPage = $skill['page'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Append the skill to the current page content
|
|
||||||
$tabContents .= "<div class='row align-items-center'>";
|
|
||||||
$tabContents .= "<div class='col-md-3'>" . $skill['skill'] . "</div>";
|
|
||||||
$tabContents .= "<div class='col-md-9'>";
|
|
||||||
$tabContents .= "<input cmd='skills' style='width: 64px;' class='skill-$k skill' name='$skillcounter' type='number' min='0' max='255' value='{$skill['points']}'>";
|
|
||||||
$tabContents .= "</div>";
|
|
||||||
$tabContents .= "</div>";
|
|
||||||
|
|
||||||
$skillcounter++;
|
$skillcounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the last tab content
|
|
||||||
if ($currentPage !== null) {
|
|
||||||
$tabContents .= "</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate the complete tabs structure
|
|
||||||
$tabs = "<ul class='nav nav-tabs' role='tablist'>";
|
|
||||||
$tabs .= $tabLinks;
|
|
||||||
$tabs .= "</ul>";
|
|
||||||
$tabs .= "<div class='tab-content'>";
|
|
||||||
$tabs .= $tabContents;
|
|
||||||
$tabs .= "</div>";
|
|
||||||
|
|
||||||
// Combine the tabs structure and skills content
|
|
||||||
$skillsMarkup = "<div class='container'>$tabs</div>";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// dump($c['Waypoints']);
|
|
||||||
$tabContent .= <<<EOT
|
$tabContent .= <<<EOT
|
||||||
<div style="background: white; margin-top: 10px;" class="tab-pane fade" id="{$c->cData['CharacterName']}" role="tabpanel" aria-labelledby="{$c->cData['CharacterName']}-tab">
|
<div style="background: white; margin-top: 10px;" class="tab-pane fade" id="{$c->cData['CharacterName']}" role="tabpanel" aria-labelledby="{$c->cData['CharacterName']}-tab">
|
||||||
<form id='{$c->cData['CharacterName']}' class="charform {$c->cData['CharacterName']}" method="POST" action="/saveCharacter.php">
|
<form id='{$c->cData['CharacterName']}' class="charform {$c->cData['CharacterName']}" method="POST" action="/saveCharacter.php">
|
||||||
@ -242,7 +179,7 @@ $skillsMarkup = "<div class='container'>$tabs</div>";
|
|||||||
$radio-->
|
$radio-->
|
||||||
<div>
|
<div>
|
||||||
<h3>Skills</h3>
|
<h3>Skills</h3>
|
||||||
$skillsMarkup
|
$skills
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
Loading…
Reference in New Issue
Block a user