mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Template/Update (Part 6)
* convert talent calculators
This commit is contained in:
41
endpoints/petcalc/petcalc.php
Normal file
41
endpoints/petcalc/petcalc.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aowow;
|
||||||
|
|
||||||
|
if (!defined('AOWOW_REVISION'))
|
||||||
|
die('illegal access');
|
||||||
|
|
||||||
|
|
||||||
|
class PetcalcBaseResponse extends TemplateResponse
|
||||||
|
{
|
||||||
|
protected string $template = 'talent';
|
||||||
|
protected string $pageName = 'petcalc';
|
||||||
|
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||||
|
protected array $breadcrumb = [1, 2];
|
||||||
|
|
||||||
|
protected array $dataLoader = ['pet-talents', 'pets'];
|
||||||
|
protected array $scripts = array(
|
||||||
|
[SC_JS_FILE, 'js/TalentCalc.js'],
|
||||||
|
[SC_CSS_FILE, 'css/talentcalc.css'],
|
||||||
|
[SC_CSS_FILE, 'css/talent.css'],
|
||||||
|
[SC_JS_FILE, 'js/petcalc.js'],
|
||||||
|
[SC_JS_FILE, 'js/swfobject.js'],
|
||||||
|
[SC_CSS_FILE, 'css/petcalc.css']
|
||||||
|
);
|
||||||
|
|
||||||
|
public bool $gDataKey = true;
|
||||||
|
public string $tcType = 'pc'; // PetCalculator
|
||||||
|
public string $chooseType;
|
||||||
|
|
||||||
|
protected function generate() : void
|
||||||
|
{
|
||||||
|
$this->h1 = Lang::main('petCalc');
|
||||||
|
$this->chooseType = Lang::main('chooseFamily');
|
||||||
|
|
||||||
|
array_unshift($this->title, $this->h1);
|
||||||
|
|
||||||
|
parent::generate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
39
endpoints/talent/talent.php
Normal file
39
endpoints/talent/talent.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Aowow;
|
||||||
|
|
||||||
|
if (!defined('AOWOW_REVISION'))
|
||||||
|
die('illegal access');
|
||||||
|
|
||||||
|
|
||||||
|
class TalentBaseResponse extends TemplateResponse
|
||||||
|
{
|
||||||
|
protected string $template = 'talent';
|
||||||
|
protected string $pageName = 'talent';
|
||||||
|
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||||
|
protected array $breadcrumb = [1, 0];
|
||||||
|
|
||||||
|
protected array $dataLoader = ['glyphs'];
|
||||||
|
protected array $scripts = array(
|
||||||
|
[SC_JS_FILE, 'js/TalentCalc.js'],
|
||||||
|
[SC_CSS_FILE, 'css/talentcalc.css'],
|
||||||
|
[SC_CSS_FILE, 'css/talent.css'],
|
||||||
|
[SC_JS_FILE, 'js/talent.js']
|
||||||
|
);
|
||||||
|
|
||||||
|
public bool $gDataKey = true;
|
||||||
|
public string $tcType = 'tc'; // TalentCalculator
|
||||||
|
public string $chooseType;
|
||||||
|
|
||||||
|
protected function generate() : void
|
||||||
|
{
|
||||||
|
$this->h1 = Lang::main('talentCalc');
|
||||||
|
$this->chooseType = Lang::main('chooseClass');
|
||||||
|
|
||||||
|
array_unshift($this->title, $this->h1);
|
||||||
|
|
||||||
|
parent::generate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -118,8 +118,8 @@ $lang = array(
|
|||||||
'compareTool' => "Gegenstandsvergleichswerkzeug",
|
'compareTool' => "Gegenstandsvergleichswerkzeug",
|
||||||
'talentCalc' => "Talentrechner",
|
'talentCalc' => "Talentrechner",
|
||||||
'petCalc' => "Begleiterrechner",
|
'petCalc' => "Begleiterrechner",
|
||||||
'chooseClass' => "Wählt eine Klasse",
|
'chooseClass' => "Wählt eine Klasse:",
|
||||||
'chooseFamily' => "Wählt eine Tierart",
|
'chooseFamily' => "Wählt eine Tierart:",
|
||||||
|
|
||||||
// search
|
// search
|
||||||
'search' => "Suche",
|
'search' => "Suche",
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ $lang = array(
|
|||||||
'compareTool' => "Item Comparison Tool",
|
'compareTool' => "Item Comparison Tool",
|
||||||
'talentCalc' => "Talent Calculator",
|
'talentCalc' => "Talent Calculator",
|
||||||
'petCalc' => "Hunter Pet Calculator",
|
'petCalc' => "Hunter Pet Calculator",
|
||||||
'chooseClass' => "Choose a class",
|
'chooseClass' => "Choose a class:",
|
||||||
'chooseFamily' => "Choose a pet family",
|
'chooseFamily' => "Choose a pet family:",
|
||||||
|
|
||||||
// search
|
// search
|
||||||
'search' => "Search",
|
'search' => "Search",
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ $lang = array(
|
|||||||
'compareTool' => "Herramienta de comparación de objetos",
|
'compareTool' => "Herramienta de comparación de objetos",
|
||||||
'talentCalc' => "Calculadora de talentos",
|
'talentCalc' => "Calculadora de talentos",
|
||||||
'petCalc' => "Calculadora de mascotas",
|
'petCalc' => "Calculadora de mascotas",
|
||||||
'chooseClass' => "Escoge una clase",
|
'chooseClass' => "Escoge una clase:",
|
||||||
'chooseFamily' => "Escoge una familia de mascota",
|
'chooseFamily' => "Escoge una familia de mascota:",
|
||||||
|
|
||||||
// search
|
// search
|
||||||
'search' => "Búsqueda",
|
'search' => "Búsqueda",
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ $lang = array(
|
|||||||
'compareTool' => "Outil de comparaison d'objets",
|
'compareTool' => "Outil de comparaison d'objets",
|
||||||
'talentCalc' => "Calculateur de Talents",
|
'talentCalc' => "Calculateur de Talents",
|
||||||
'petCalc' => "Calculateur de familiers",
|
'petCalc' => "Calculateur de familiers",
|
||||||
'chooseClass' => "Choisissez une classe",
|
'chooseClass' => "Choisissez une classe :",
|
||||||
'chooseFamily' => "Choisissez un familier",
|
'chooseFamily' => "Choisissez un familier :",
|
||||||
|
|
||||||
// search
|
// search
|
||||||
'search' => "Recherche",
|
'search' => "Recherche",
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ $lang = array(
|
|||||||
'compareTool' => "Инструмент сравнения предметов",
|
'compareTool' => "Инструмент сравнения предметов",
|
||||||
'talentCalc' => "Расчёт талантов",
|
'talentCalc' => "Расчёт талантов",
|
||||||
'petCalc' => "Расчёт умений питомцев",
|
'petCalc' => "Расчёт умений питомцев",
|
||||||
'chooseClass' => "Выберите класс",
|
'chooseClass' => "Выберите класс:",
|
||||||
'chooseFamily' => "Выберите семейство питомцев",
|
'chooseFamily' => "Выберите семейство питомцев:",
|
||||||
|
|
||||||
// search
|
// search
|
||||||
'search' => "Поиск",
|
'search' => "Поиск",
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ $lang = array(
|
|||||||
'compareTool' => "物品比较工具",
|
'compareTool' => "物品比较工具",
|
||||||
'talentCalc' => "天赋模拟器",
|
'talentCalc' => "天赋模拟器",
|
||||||
'petCalc' => "猎人宠物模拟器",
|
'petCalc' => "猎人宠物模拟器",
|
||||||
'chooseClass' => "选择一个职业",
|
'chooseClass' => "选择一个职业:",
|
||||||
'chooseFamily' => "选择一个宠物家族",
|
'chooseFamily' => "选择一个宠物家族:",
|
||||||
|
|
||||||
// search
|
// search
|
||||||
'search' => "搜索",
|
'search' => "搜索",
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Aowow;
|
|
||||||
|
|
||||||
if (!defined('AOWOW_REVISION'))
|
|
||||||
die('illegal access');
|
|
||||||
|
|
||||||
|
|
||||||
// tabId 1: Tools g_initHeader()
|
|
||||||
class TalentPage extends GenericPage
|
|
||||||
{
|
|
||||||
protected $tpl = 'talent';
|
|
||||||
protected $tabId = 1;
|
|
||||||
protected $path = [1];
|
|
||||||
protected $mode = CACHE_TYPE_NONE;
|
|
||||||
protected $gDataKey = true;
|
|
||||||
protected $scripts = array(
|
|
||||||
[SC_JS_FILE, 'js/TalentCalc.js'],
|
|
||||||
[SC_CSS_FILE, 'css/talentcalc.css'],
|
|
||||||
[SC_CSS_FILE, 'css/talent.css']
|
|
||||||
);
|
|
||||||
|
|
||||||
protected $tcType = 'tc'; // tc: TalentCalculator; pc: PetCalculator
|
|
||||||
private $isPetCalc = false;
|
|
||||||
|
|
||||||
public function __construct($pageCall, $__)
|
|
||||||
{
|
|
||||||
parent::__construct($pageCall, $__);
|
|
||||||
|
|
||||||
$this->isPetCalc = $pageCall == 'petcalc';
|
|
||||||
$this->name = $this->isPetCalc ? Lang::main('petCalc') : Lang::main('talentCalc');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function generateContent()
|
|
||||||
{
|
|
||||||
// add conditional js & css
|
|
||||||
if ($this->isPetCalc)
|
|
||||||
$this->addScript(
|
|
||||||
[SC_JS_FILE, '?data=pet-talents.pets'],
|
|
||||||
[SC_JS_FILE, 'js/petcalc.js'],
|
|
||||||
[SC_JS_FILE, 'js/swfobject.js'],
|
|
||||||
[SC_CSS_FILE, 'css/petcalc.css']
|
|
||||||
);
|
|
||||||
else
|
|
||||||
$this->addScript(
|
|
||||||
[SC_JS_FILE, '?data=glyphs'],
|
|
||||||
[SC_JS_FILE, 'js/talent.js']
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->tcType = $this->isPetCalc ? 'pc' : 'tc';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function generateTitle()
|
|
||||||
{
|
|
||||||
array_unshift($this->title, $this->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function generatePath()
|
|
||||||
{
|
|
||||||
$this->path[] = $this->isPetCalc ? 2 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
<?php namespace Aowow; ?>
|
<?php
|
||||||
|
namespace Aowow\Template;
|
||||||
|
|
||||||
<?php $this->brick('header'); ?>
|
use \Aowow\Lang;
|
||||||
|
|
||||||
|
$this->brick('header');
|
||||||
|
?>
|
||||||
<div class="main" id="main">
|
<div class="main" id="main">
|
||||||
<div class="main-precontents" id="main-precontents"></div>
|
<div class="main-precontents" id="main-precontents"></div>
|
||||||
<div class="main-contents" id="main-contents">
|
<div class="main-contents" id="main-contents">
|
||||||
@@ -14,7 +17,7 @@
|
|||||||
|
|
||||||
<div id="<?=$this->tcType; ?>-classes">
|
<div id="<?=$this->tcType; ?>-classes">
|
||||||
<div id="<?=$this->tcType; ?>-classes-outer">
|
<div id="<?=$this->tcType; ?>-classes-outer">
|
||||||
<div id="<?=$this->tcType; ?>-classes-inner"><p><?=($this->tcType == 'tc' ? Lang::main('chooseClass') : Lang::main('chooseFamily')) . Lang::main('colon'); ?></p></div>
|
<div id="<?=$this->tcType; ?>-classes-inner"><p><?=$this->chooseType; ?></p></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="<?=$this->tcType; ?>-itself"></div>
|
<div id="<?=$this->tcType; ?>-itself"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user