Skip to content

Commit

Permalink
[47] English localization for talents page; display character glyphs;…
Browse files Browse the repository at this point in the history
… dual talents specialization support temporary disabled
  • Loading branch information
Shadez committed Jan 15, 2010
1 parent fc842af commit 79b95fa
Show file tree
Hide file tree
Showing 27 changed files with 26,592 additions and 361 deletions.
11 changes: 4 additions & 7 deletions character-sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 46
* @revision 47
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -68,11 +68,8 @@
if($guilds->extractPlayerGuildId()) {
$armory->tpl->assign('guildName', $guilds->getGuildName());
}

// Таланты
// Отображение 2й ветки талантов будет работать, если на ядро установлен соответствующий патч
// !Поддерживается ТОЛЬКО порт от KiriX!
$tp = '';
/*
if($armory->armoryconfig['useDualSpec'] == true) {
$armory->tpl->assign('dualSpec', true);
$ds = 0;
Expand Down Expand Up @@ -104,7 +101,7 @@
$disabledspec = ($activespec == 1) ? 0 : 1;
$armory->tpl->assign('disabledDS_'.$disabledspec, ' disabledSpec');
}
else {
else {*/
for($i=0;$i<3;$i++) {
if($i) {
$tp .= " / ";
Expand All @@ -120,7 +117,7 @@
$armory->tpl->assign('tree_js', $talent_trees);
$armory->tpl->assign('disabledDS_1', ' disabledSpec');
$armory->tpl->assign('currentTreeIcon', $currentTreeIcon);
}
//}
// Профессии
$trade_skills = $characters->extractCharacterProfessions();
// Обрезаем кол-во профессий до 2х (в случае, если на сервере выставлено
Expand Down
69 changes: 66 additions & 3 deletions character-talents.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 46
* @revision 47
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand All @@ -25,6 +25,7 @@
define('__ARMORY__', true);
define('load_characters_class', true);
define('load_guilds_class', true);
define('load_items_class', true);
define('load_achievements_class', true);
define('load_items_class', true);

Expand Down Expand Up @@ -64,8 +65,70 @@
$armory->tpl->assign('guildName', $guilds->getGuildName());
}
//TODO: Dualspec
$talents = $characters->extractCharacterTalents();
$armory->tpl->assign('talents', $talents);
// Таланты
// Отображение 2й ветки талантов будет работать, если на ядро установлен соответствующий патч
// !Поддерживается ТОЛЬКО порт от KiriX!
$tp = '';/*
if($armory->armoryconfig['useDualSpec'] == true) {
$ds = 0;
while($ds<2) {
for($i=0;$i<3;$i++) {
if($i) {
$tp .= " / ";
}
$tp .= $characters->talentCounting($characters->getTabOrBuild($characters->class, 'tab', $i), true, $ds);
}
// Если у персонажа ещё нет двойной специализации
if($tp == ' / / ') {
$armory->tpl->assign('dualSpecError', true);
}
else {
$armory->tpl->assign('dualSpec', true);
$talent_trees = explode(' / ', $tp);
$currentTree = Utils::GetMaxArray($talent_trees);
$currentTreeName = $characters->ReturnTalentTreesNames($characters->class, $currentTree);
$currentTreeIcon = $characters->ReturnTalentTreeIcon($characters->class, $currentTree);
$armory->tpl->assign('talents_builds_'.$ds, $tp);
$armory->tpl->assign('treeName_'.$ds, $currentTreeName);
$armory->tpl->assign('treeIcon_'.$ds, $currentTreeIcon);
$armory->tpl->assign('ds_'.$ds, $talent_trees);
$tp = ''; // Очищаем предыдущую ветку
$ds++;
}
}
$armory->tpl->assign('disabledDS_0', false);
$armory->tpl->assign('disabledDS_1', false);
$activespec = $armory->cDB->selectCell("SELECT `activespec` FROM `characters` WHERE `guid`=? LIMIT 1", $characters->guid);
$disabledspec = ($activespec == 1) ? 0 : 1;
$armory->tpl->assign('disabledDS_'.$disabledspec, true);
for($i=0;$i<2;$i++) {
$armory->tpl->assign('talents_'.$i, $characters->extractCharacterTalents(true, $i));
}
}
else {
*/
for($i=0;$i<3;$i++) {
if($i) {
$tp .= " / ";
}
$tp .= $characters->talentCounting($characters->getTabOrBuild($characters->class, 'tab', $i));
}
$talent_trees = explode(' / ', $tp);
$currentTree = Utils::GetMaxArray($talent_trees);
$currentTreeName = $characters->ReturnTalentTreesNames($characters->class, $currentTree);
$currentTreeIcon = $characters->ReturnTalentTreeIcon($characters->class, $currentTree);
$armory->tpl->assign('talents_builds', $tp);
$armory->tpl->assign('treeName', $currentTreeName);
$armory->tpl->assign('tree_js', $talent_trees);
$armory->tpl->assign('disabledDS_1', ' disabledSpec');
$armory->tpl->assign('currentTreeIcon', $currentTreeIcon);
$talents = $characters->extractCharacterTalents();
$armory->tpl->assign('talents', $talents);
$glyphs = $characters->extractCharacterGlyphs();
$armory->tpl->assign('bigGlyphs', $glyphs['big']);
$armory->tpl->assign('smallGlyphs', $glyphs['small']);
//}

switch($characters->class) {
case 1:
$tplName = 'warrior_'.$_locale;
Expand Down
8 changes: 4 additions & 4 deletions includes/armory_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 46
* @revision 47
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -31,7 +31,7 @@
die('<b>Error:</b> can not load connector class!');
}

define('DB_VERSION', 'armory_r46');
define('DB_VERSION', 'armory_r47');
$armory = new Connector;
$armory->tpl->template_dir = 'includes/template/';
$armory->tpl->compile_dir = 'includes/cache/';
Expand All @@ -47,7 +47,7 @@

$utils = new Utils;

/** Login **/
/** Login
if(isset($_GET['login']) && $_GET['login'] == 1) {
header('Location: login.xml');
}
Expand All @@ -61,7 +61,7 @@
$armory->tpl->assign('myVaultCharacters', $utils->getCharsArray());
$armory->tpl->assign('selectedVaultCharacter', $utils->getCharacter());
}
/** End login **/
End login **/

if(isset($_GET['locale'])) {
$tmp = strtolower($_GET['locale']);
Expand Down
29 changes: 28 additions & 1 deletion includes/classes/class.characters.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 46
* @revision 47
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -670,6 +670,33 @@ public function extractCharacterTalents($dualSpec=false, $specCount='') {
return $bild;
}

public function extractCharacterGlyphs() {
if(!$this->guid) {
return false;
}
$locale = (isset($_SESSION['armoryLocale'])) ? $_SESSION['armoryLocale'] : $this->armoryconfig['defaultLocale'];
$glyphData = array();
$glyphData['big'] = array();
$glyphData['small'] = array();
$glyphFields = array('0' => 1319, '1' => 1320, '2' => 1321, '3' => 1322, '4' => 1323, '5' => 1324);
for($i=0;$i<6;$i++) {
$glyph_id = $this->GetDataField($glyphFields[$i]);
$glyph_info = $this->aDB->selectRow("
SELECT `type`, `name_".$locale."` AS `name`, `description_".$locale."` AS `description`
FROM `glyphproperties` WHERE `id`=?", $glyph_id);
if(!$glyph_info) {
continue;
}
if($glyph_info['type'] == 0) {
$glyphData['big'][$i] = $glyph_info;
}
elseif($glyph_info['type'] == 1) {
$glyphData['small'][$i] = $glyph_info;
}
}
return $glyphData;
}

public function ReturnTalentTreesNames($class, $key) {
switch($class) {
case 1:
Expand Down
7 changes: 2 additions & 5 deletions includes/classes/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 32
* @revision 47
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -59,8 +59,5 @@
$ArmoryConfig['settings']['cache_lifetime'] = 2; // In days
$ArmoryConfig['settings']['minlevel'] = 10; // Character must have this level or higher to be shown in Armory
$ArmoryConfig['settings']['minGmLevelToShow'] = 3; // Show characters : 0 - only players, 1 - moderators, 2 - GMs, 3 - everyone
$ArmoryConfig['settings']['defaultLocale'] = 'ru_ru'; // Can be 'ru_ru' or 'en_gb' (limited English support!)
$ArmoryConfig['settings']['useDualSpec'] = false; // Use Dual specialization talent view (!requires MaNGOS core patch!)
// Armory supports KiriX's version ONLY (can be found here:
// http://getmangos.com/community/showthread.php?t=8580)
$ArmoryConfig['settings']['defaultLocale'] = 'ru_ru'; // Can be 'ru_ru' or 'en_gb'
?>
38 changes: 31 additions & 7 deletions includes/template/character_talents_start.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,52 @@
</div>
</div>
</div>
<div class="header_break">
<!---->
</div>
<script src="_js/character/talents.js" type="text/javascript"></script>
<div class="talentGlyphBg">
<div class="talentGlyphFooter">
<div class="talentGlyphHeaderMultiSpec">
<div class="talentGlyphHeader">
<div id="glyphHolder">
<div id="glyphSet_2" style="display: none">
</div>
<div id="glyphSet_1">
{{foreach from=$bigGlyphs item=glyph}}
<div class="staticTip glyph major" onmouseover="makeGlyphTooltip('{{$glyph.name}}','{{#armory_character_talents_major_glyph#}}','{{$glyph.description}}')">
<span><img class="majorGlyphIcon" src="images/talents/glyph-small-major-1.gif" />{{$glyph.name}}</span>
</div>

{{/foreach}}

{{foreach from=$smallGlyphs item=glyph}}
<div class="staticTip glyph minor" onmouseover="makeGlyphTooltip('{{$glyph.name}}','{{#armory_character_talents_major_glyph#}}','{{$glyph.description}}')">
<span><img class="minorGlyphIcon" src="images/talents/glyph-small-minor-1.gif" />{{$glyph.name}}</span>
</div>

{{/foreach}}
</div>
</div>
{{if $dualSpec}}
<div class="talentSpecSwitchHolder">
<table class="talentSpecSwitch">
<tr>
<td id="group_1"><a class="inActiveTalents" href="javascript:void(0)" id="group_1_link" onclick="switchTalentSpec('','1', '{{$spec_0.build}}')">
<td {{if $disabledDS_0 == true}}class="selectedSet"{{/if}} id="group_1">
<a class="{{if $disabledDS_0 == false}}inA{{else}}a{{/if}}ctiveTalents" href="javascript:void(0)" id="group_1_link" onclick="switchTalentSpec('1','1', '{{$talents_0}}')">
<div>
<img src="wow-icons/_images/21x21/{{$spec_0.icon}}.png" />{{$spec_0.name}}</div>
<img src="wow-icons/_images/21x21/{{$treeIcon_0}}.png" />{{$treeName_0}}</div>
</a>
<div class="buildPointer">

<!---->
</div>
</td>
<td id="group_2"><a class="activeTalents" href="javascript:void(0)" id="group_2_link" onclick="switchTalentSpec('1','2', '{{$spec_1.build}}')">
<td {{if $$disabledDS_1 == true}}class="selectedSet"{{/if}} id="group_2">
<a class="{{if $disabledDS_1 == false}}inA{{else}}a{{/if}}ctiveTalents" href="javascript:void(0)" id="group_2_link" onclick="switchTalentSpec('','2', '{{$talents_1}}')">
<div>
<img src="wow-icons/_images/21x21/{{$spec_1.icon}}.png" />{{$spec_1.name}}</div>
<img src="wow-icons/_images/21x21/{{$treeIcon_1}}.png" />{{$treeName_1}}</div>
</a>
<div class="buildPointer">

<!---->
</div>
</td>
</tr>
Expand Down
Loading

0 comments on commit 79b95fa

Please sign in to comment.