Skip to content

Commit

Permalink
[413] Layout changes; max allowed selected characters updated to 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed Oct 24, 2010
1 parent 064a6ae commit 08c0319
Show file tree
Hide file tree
Showing 12 changed files with 242 additions and 40 deletions.
4 changes: 2 additions & 2 deletions _css/character-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
.tabs {left:22px; margin:0;}

#charList {position:static; clear:both;}
.topcharlist {height:287px; background:url(../images/select-topcharlist.gif) 0 0 no-repeat; position:relative; margin:0 0 -20px 0; top:0; left:0;}
.topcharlist {height:357px; background:url(../images/select-topcharlist.jpg) 0 0 no-repeat; position:relative; margin:0 0 -20px 0; top:0; left:0;}
.topcharlist h5{font:bold 14px/26px Arial, Helvetica, sans-serif; margin:0 auto; text-align:center; display: block; letter-spacing:-1px; width:260px; height:26px; color:#724503; position:relative; top:23px;}
.sel-char { }
.sel-char h1 {color:#c3830a;padding:5px 0 10px 20px !important; background:url('../images/expand-tile.jpg') repeat-x 0 0; margin:0;}
Expand Down Expand Up @@ -87,4 +87,4 @@ border-width:1px 1px 1px 1px;border-style:solid;border-color:#5494bd;-moz-border

.hide div div {float:left; display:inline; position:relative;}

.noSelectedChars { padding: 10px; border-top: 2px solid #935202; background-color: #e3c574; }
.noSelectedChars { padding: 10px; border-top: 2px solid #935202; background-color: #e3c574; }
18 changes: 18 additions & 0 deletions _js/armory.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,24 @@ function checkArrows(){
$("#currPageTxt").html(currPage);
$("#totalPageTxt").html(totalPages);
}

function changeMainCharacter(name, realm) {
$.ajax({
url: 'character-select-submit-json.xml',
data: {
cn: name,
r: realm
},
dataType: 'json',
type: 'GET',
success: function(data, status) {
if (data.success) {
location.reload(true);
}
}
});
}

/*****************************************************
* End Bookmarks
*****************************************************/
Expand Down
66 changes: 53 additions & 13 deletions _layout/character-select.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:include href="includes.xsl"/>


<xsl:template name="charactersTable"><style type="text/css" media="screen, projection">
@import "_css/character-select.css";
</style>
Expand All @@ -25,6 +27,24 @@
setTipText("<xsl:value-of select="$loc/strs/character/str[@id='character.tip.primary']"/>");
});
}

$(function() {
$('.selSecondaryChar').click(function() {
var that = $(this);
var name = that.parent().find('h6 a').html();
var realm = that.parent().find('.char-realm').html();

changeMainCharacter(name, realm);
});

$('.charListIcons').click(function() {
var that = $(this);
var name = that.parent().find('.menu-char-name').val();
var realm = that.parent().find('.menu-char-realm').val();

changeMainCharacter(name, realm);
});
});
</script>

<div class="sel-char">
Expand Down Expand Up @@ -64,9 +84,13 @@
<td style="text-align:left; padding-left: 3px;">
<span style="display: none;"><xsl:value-of select="@name" /></span>

<xsl:call-template name="characterPromote" />
<xsl:call-template name="characterPromote">
<xsl:with-param name="char" select="current()" />
</xsl:call-template>

<a href="character-sheet.xml?{@url}"><xsl:value-of select="@name" /></a>
<input type="hidden" class="menu-char-name" value="{@name}" />
<input type="hidden" class="menu-char-realm" value="{@realm}" />
</td>
<td style="text-align:right; padding-right:3px; font-weight: bold; width: 50px;">
<span style="display: none;"><xsl:value-of select="@achPoints" /></span>
Expand Down Expand Up @@ -185,18 +209,20 @@

<!-- prints icon-link to add characters (gets called in table row) -->
<xsl:template name="characterPromote">
<a href="javascript:void(0)">
<xsl:choose>
<xsl:when test="count(/page/characters/character/@selected) = 3">
<!-- if we're at max character count, grey out links -->
<xsl:param name="char" />

<a href="javascript:void(0)" class="charListIcons add_on staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='makePrimary']}');">
<!--<xsl:choose>
<xsl:when test="count(/page/characters/character/@selected) = 5">
if we're at max character count, grey out links
<xsl:attribute name="class">charListIcons add_off staticTip</xsl:attribute>
<xsl:attribute name="onmouseover">setTipText("<xsl:value-of select="$loc/strs/character-select/str[@id='easyAccessLimit']"/>");</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">charListIcons add_on staticTip</xsl:attribute>
<xsl:attribute name="onmouseover">setTipText("<xsl:value-of select="$loc/strs/character-select/str[@id='addToEasyAccess']"/>");</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>-->
</a>
</xsl:template>

Expand Down Expand Up @@ -251,17 +277,20 @@

<!-- prints secondary characters in top character area -->
<xsl:template name="printSecondaryChars">
<xsl:if test="count(/page/characters/character/@selected) &gt; 1">
<xsl:if test="count(/page/characters/character/@selected) &gt; 1">

<xsl:for-each select="/page/characters/character[@selected = '2']">
<div class="select-char2">
<a id="{@url}" class="selChar selSecondaryChar staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='makePrimary']}');"
href="javascript:void(0)"> </a>
<a class="delChar staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='removeFromEasyAccess']}');" href="javascript:void(0)"></a>
<img class="staticTip" onmouseover="setTipText('{$loc/strs/races/str[@id=concat('armory.races.race.',current()/@raceId)]}');"
<a id="{@url}" class="selChar selSecondaryChar staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='makePrimary']}');" href="javascript:void(0)"></a>

<!--<a class="delChar staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='removeFromEasyAccess']}');" href="javascript:void(0)"></a>-->

<img class="staticTip" onmouseover="setTipText('{$loc/strs/races/str[@id=concat('armory.races.race.',current()/@raceId)]}');"
src="images/icons/race/{current()/@raceId}-{current()/@genderId}.gif" />
<img class="staticTip" onmouseover="setTipText('{$loc/strs/classes/str[@id=concat('armory.classes.class.',current()/@classId)]}');"
src="images/icons/class/{current()/@classId}.gif" />
<h6><a href="character-sheet.xml?{@url}"><xsl:value-of select="@name" /></a></h6>&#160;(<xsl:value-of select="@level" />) -

<h6><a href="character-sheet.xml?{@url}"><xsl:value-of select="@name" /></a></h6>&#160;(<xsl:value-of select="@level" />) -
<span class="char-realm"><xsl:value-of select="current()/@realm" /></span>
</div>
</xsl:for-each>
Expand All @@ -272,9 +301,20 @@
<xsl:when test="count(/page/characters/character/@selected) = '1'">
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
</xsl:when>
<xsl:when test="count(/page/characters/character/@selected) = '2'">
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
</xsl:when>
<xsl:when test="count(/page/characters/character/@selected) = '3'">
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
</xsl:when>
<xsl:when test="count(/page/characters/character/@selected) = '4'">
<div class="select-char2"><h6><xsl:value-of select="$loc/strs/character-select/str[@id='availableSlot']"/></h6></div>
</xsl:when>
</xsl:choose>
</xsl:template>
Expand All @@ -298,4 +338,4 @@
</xsl:template>


</xsl:stylesheet>
</xsl:stylesheet>
6 changes: 2 additions & 4 deletions _layout/nav/bookmarks.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@

<xsl:param name="charNode" />

<xsl:variable name="txtClassbm" select="$loc/strs/classes/str[@id=concat('armory.classes.class.', $charNode/@classId,'.', $charNode/@genderId)]" />

<div class="menuItem bmlist">

<a href="javascript:void(0);" class="rmBookmark staticTip"
Expand All @@ -136,15 +134,15 @@
<a class="character-achievement staticTip" onMouseOver="setTipText('{$loc/strs/login/str[@id='armory.login.achievements']}');"
href="character-achievements.xml?{@url}"><xsl:value-of select="@achPoints"/></a>

<em class="classId{@classId} staticTip" onmouseover="setTipText('{$txtClassbm}')"></em>
<em class="classId{@classId} staticTip" onmouseover="setTipText('{@classText}')"></em>
<a href="character-sheet.xml?{@url}" class="charName"><xsl:value-of select="@name"/></a>
<span>&#160;-&#160;<xsl:value-of select="@realm"/></span>

<p>
<xsl:apply-templates mode="printf" select="$loc/strs/character/str[@id='charLevelStr']">
<xsl:with-param name="param1" select="@level" />
<xsl:with-param name="param2" select="''" />
<xsl:with-param name="param3" select="$txtClassbm" />
<xsl:with-param name="param3" select="@classText" />
</xsl:apply-templates>
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions _layout/nav/user-menu.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<xsl:attribute name="style"></xsl:attribute>
</xsl:if>

<img src="images/icons/icon-guildmaster.gif" alt="" class="staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='primaryChar']}')" />
<img src="images/icons/icon-guildmaster.gif" alt="Selected" class="staticTip" onmouseover="setTipText('{$loc/strs/character-select/str[@id='primaryChar']}')" />
</div>

<div class="menuItemAvatar">
Expand All @@ -158,7 +158,7 @@
</div>

<div class="menuItemMeta">
<a href="/vault/character-calendar.xml?{@url}" class="user-alerts staticTip" style="display: none;" onmouseover="setTipText('{$loc/strs/login/str[@id='armory.login.calendar.pending']}')">0</a>
<a href="character-calendar.xml?{@url}" class="user-alerts staticTip" style="display: none;" onmouseover="setTipText('{$loc/strs/login/str[@id='armory.login.calendar.pending']}')">0</a>

<a href="character-sheet.xml?{@url}" class="charName js-character-name"><xsl:value-of select="@name" /></a> -
<span class="js-character-realm"><xsl:value-of select="@realm" /></span>
Expand Down
4 changes: 2 additions & 2 deletions bookmarks.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 345
* @revision 413
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand Down Expand Up @@ -53,7 +53,7 @@
$bookmarks_count = $utils->GetBookmarksCount();
$xml->XMLWriter()->startElement('characters');
$xml->XMLWriter()->writeAttribute('count', $bookmarks_count);
$xml->XMLWriter()->writeAttribute('max', 60);
$xml->XMLWriter()->writeAttribute('max', MAX_BOOKMARKS_COUNT);
$character_bookmarks = $utils->GetBookmarks();
if(is_array($character_bookmarks)) {
foreach($character_bookmarks as $bookmark) {
Expand Down
66 changes: 66 additions & 0 deletions character-select-submit-json.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 413
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**/

define('__ARMORY__', true);
if(!@include('includes/armory_loader.php')) {
die('<b>Fatal error:</b> unable to load system files.');
}
$fail = false;
if(!isset($_GET['cn']) || !isset($_GET['r'])) {
$fail = true;
}
else {
$charName = $utils->escape($_GET['cn']);
$realmName = $utils->escape($_GET['r']);
$realmId = $utils->GetRealmIdByName($realmName);
$charGuid = $utils->GetCharacterGUID($charName, $realmId);
if(!$charGuid) {
$fail = true;
}
else {
// Character was found, try to set him/her as primary character.
if(!$utils->SetNewPrimaryCharacter($charGuid, $realmId)) {
$fail = true;
}
else {
// Everything ok.
header('Content-type: text/plain');
die('{"success":true}');
}
}
}
if($fail) {
header('Content-type: text/xml');
// Load XSLT template
$xml->LoadXSLT('error/error.xsl');
$xml->XMLWriter()->startElement('page');
$xml->XMLWriter()->writeAttribute('globalSearch', 1);
$xml->XMLWriter()->writeAttribute('lang', $armory->GetLocale());
$xml->XMLWriter()->startElement('errorhtml');
$xml->XMLWriter()->endElement(); //errorhtml
$xml->XMLWriter()->endElement(); //page
echo $xml->StopXML();
exit;
}
?>
13 changes: 6 additions & 7 deletions character-select-submit.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 348
* @revision 413
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Expand All @@ -27,13 +27,12 @@
die('<b>Fatal error:</b> unable to load system files.');
}
if(!isset($_SESSION['accountId'])) {
$armory->Log()->writeLog('character-select-submit : session not found!');
exit;
}
if(isset($_GET)) {
$totalCharsCount = $armory->aDB->selectCell("SELECT COUNT(`guid`) FROM `ARMORYDBPREFIX_login_characters` WHERE `account`=%d", $_SESSION['accountId']);
$armory->aDB->query("DELETE FROM `ARMORYDBPREFIX_login_characters` WHERE `account`='%d'", $_SESSION['accountId']);
for($i = 1; $i < 4; $i++) {
$totalCharsCount = $utils->CountSelectedCharacters();
$utils->DropAllSelectedCharacters(true);
for($i = 1; $i < MAX_SELECTED_CHARACTERS_COUNT+1; $i++) {
if(isset($_GET['cn' . $i]) && isset($_GET['r' . $i])) {
$realmName = urldecode($_GET['r' . $i]);
$realm_id = $utils->GetRealmIdByName($realmName);
Expand All @@ -48,7 +47,7 @@
$realm_info = $armory->realmData[$realm_id];
$db = new ArmoryDatabaseHandler($realm_info['host_characters'], $realm_info['user_characters'], $realm_info['pass_characters'], $realm_info['name_characters'], $realm_info['charset_characters'], $armory->Log());
if(!$db) {
$armory->Log()->writeLog('character-select-submit : unable to connect to MySQL database (host: %s, user: %s, password: %s, name: %s)', $realm_info['host_characters'], $realm_infoa['user_characters'], $realm_info['pass_characters'], $realm_info['name_characters']);
// Error message will appear in ArmoryDatabaseHandler::ArmoryDatabaseHandler();
continue;
}
$char_data = $db->selectRow("SELECT `guid`, `name`, `class`, `race`, `gender`, `level`, `account` FROM `characters` WHERE `name`='%s' AND `account`=%d LIMIT 1", $utils->escape($_GET['cn' . $i]), $_SESSION['accountId']);
Expand All @@ -64,7 +63,7 @@
$char_data['selected'] = $i;
}
$char_data['num'] = $i;
$armory->aDB->query("INSERT INTO `armory_login_characters` VALUES (%d, %d, %d, '%s', %d, %d, %d, %d, %d, %d)", $char_data['account'], $i, $char_data['guid'], $char_data['name'], $char_data['class'], $char_data['race'], $char_data['gender'], $char_data['level'], $realm_id, $char_data['selected']);
$utils->AddCharacterAsSelected($char_data, $realm_id, $i);
}
}
}
Expand Down
Binary file added images/select-topcharlist.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

2 comments on commit 08c0319

@SignFinder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Axxus
Copy link

@Axxus Axxus commented on 08c0319 Oct 27, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ArmoryConfig['settings']['minGmLevelToShow'] = 0; param is not working properly since rev 404

Please sign in to comment.