장수 빙의에 장수 리스트 띄움

This commit is contained in:
2019-05-04 19:46:55 +09:00
parent d30a824481
commit 956dc82555
3 changed files with 191 additions and 6 deletions
+4 -2
View File
@@ -69,15 +69,17 @@ foreach($rawGeneralList as $rawGeneral){
$npc,
$age,
$nationArr['name'],
SpecCall($special),
SpecCall($special2),
getGenSpecial($special),
getGenSpecial($special2),
getGenChar($personal),
$name,
$name2,
$injury,
$leader,
$lbonus,
$power,
$intel,
getExpLevel($experience),
getHonor($experience),
getDed($dedication),
getLevel($level, $nationArr['level']),
+160 -1
View File
@@ -16,6 +16,25 @@ var templateSpecial =
</span>\
';
var templateGeneralRow =
'<tr>\
<td><img class="generalIcon" width="64" height="64" src="<%iconPath%>"></td>\
<td style="<%userCSS%>"><%name%><%nameAux%></td>\
<td><%age%>세</td>\
<td><%personalWithTooltip%></td>\
<td><%specialDomesticWithTooltip%> / <%speicalWarWithTooltip%></td>\
<td>Lv <%explevel%></td>\
<td><%nation%></td>\
<td><%experience%></td>\
<td><%dedication%></td>\
<td><%level%></td>\
<td><%total%></td>\
<td><%leader%></td>\
<td><%power%></td>\
<td><%intel%></td>\
<td><%killturn%></td>\
</tr>';
function pickGeneral(){
$btn = $(this);
@@ -115,7 +134,6 @@ function printGenerals(value){
var $card = $(TemplateEngine(templateGeneralCard, cardData));
console.log($card);
$('.card_holder').append($card);
$card.find('.select_btn').click(pickGeneral);
@@ -131,7 +149,132 @@ function printGenerals(value){
updateOutdateTimer();
}
function printGeneralList(value){
var tokenList = value.token;
var generalList = $.map(value.list, function(general){
general = {
no:general[0],
picture:general[1],
imgsvr:general[2],
npc:general[3],
age:general[4],
nation:general[5],
special:general[6],
special2:general[7],
personal:general[8],
name:general[9],
name2:general[10],
injury:general[11],
leader:general[12],
lbonus:general[13],
power:general[14],
intel:general[15],
explevel:general[16],
experience:general[17],
dedication:general[18],
level:general[19],
killturn:general[20],
connect:general[21],
reserved:0
};
if(general.npc < 2){
general.reserved = 2;
}
if(general.no in tokenList){
general.reserved = 1;
}
general.userCSS = "";
general.nameAux = "";
if(general.reserved == 1){
general.userCSS = 'color:violet';
}
else if(general.npc >= 2){
general.userCSS = 'color:cyan';
}
else if(general.npc == 1){
general.userCSS = 'color:skyblue';
}
if(general.name2){
general.nameAux += '<br><small>({0})</small>'.format(general.name2);
}
if(general.reserved == 1){
general.nameAux += '<br><small>({0}회)</small>'.format(tokenList[general.no]);
}
general.total = general.leader + general.power + general.intel;
general.iconPath = getIconPath(general.imgsvr, general.picture);
general.specialDomesticWithTooltip = TemplateEngine(templateSpecial, {
text:general.special,
info:specialInfo[general.special]
});
general.speicalWarWithTooltip = TemplateEngine(templateSpecial, {
text:general.special2,
info:specialInfo[general.special2]
});
general.personalWithTooltip = TemplateEngine(templateSpecial, {
text:general.personal,
info:characterInfo[general.personal]
});
return general;
});
generalList.sort(function(lhs, rhs){
if(lhs.reserved > rhs.reserved){
return -1;
}
if(lhs.reserved < rhs.reserved){
return 1;
}
if(lhs.total != rhs.total){
return rhs.total - lhs.total;
}
if(lhs.leader != rhs.leader){
return rhs.leader - lhs.total;
}
if(lhs.name < rhs.name){
return -1;
}
if(lhs.name > rhs.name){
return 1;
}
return 0;
});
window.generalList = generalList;
_printGeneralList(generalList);
}
function _printGeneralList(generalList){
var $generalTable = $('#general_list');
$generalTable.empty();
$.each(generalList, function(idx, general){
$generalTable.append(TemplateEngine(templateGeneralRow, general));
});
$generalTable.find('.obj_tooltip').tooltip({
title:function(){
return $.trim($(this).find('.tooltiptext').html());
},
html:true
});
$('#tb_general_list').show();
}
$(function($){
window.generalList = [];
$.post('j_get_select_npc_token.php').then(function(value){
if(!value.result){
@@ -165,4 +308,20 @@ $('#btn_pick_more').click(function(){
});
});
$('#btn_load_general_list').click(function(){
$.post({
url:'j_get_general_list.php',
dataType:'json',
data:{
with_token:true
}
}).then(function(result){
if(!result.result){
alert(result.reason);
return false;
}
printGeneralList(result);
});
});
});
+27 -3
View File
@@ -26,7 +26,7 @@ $nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation
<title><?=UniqueConst::$serverName?>: NPC빙의</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<meta name="viewport" content="style='width:1024" />
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('../css/config.css')?>
@@ -72,7 +72,7 @@ echo Json::encode($characterAll);
<?php
if ($gencount >= $maxgeneral) {
if ($gencount>= $maxgeneral) {
?>
<body>
@@ -103,8 +103,32 @@ history.go(-1);
</form>
</div>
<div class="with_border legacy_layout" style="text-align:center">
<button id="btn_pick_more" disabled="disabled" class="with_skin with_border">다른 장수 보기</button><br>
<button id="btn_pick_more" disabled="disabled" class="with_skin with_border">다른 장수 보기</button><button id="btn_load_general_list" class="with_skin with_border" style='margin-left:2ch;'>장수 목록 보기</button><br>
</div>
<table style='width:970px;table-layout: fixed;' class="tb_layout bg0" id='tb_general_list'>
<thead>
<tr class='bg1'>
<th style='width:64px;'>얼 굴</td>
<th style='width:140px;'>이 름</td>
<th style='width:40px;'>연령</td>
<th style='width:40px;'>성격</td>
<th style='width:80px;'>특기</td>
<th style='width:45px;'>레 벨</td>
<th style='width:140px;'>국 가</td>
<th style='width:50px;'>명 성</td>
<th style='width:50px;'>계 급</td>
<th style='width:75px;'>관 직</td>
<th style='width:60px;'>종능</td>
<th style='width:45px;'>통솔</td>
<th style='width:45px;'>무력</td>
<th style='width:45px;'>지력</td>
<th style='width:45px;'>삭턴</td>
</tr>
</thead>
<tbody id='general_list'>
</tbody>
</table>
<div class="with_border legacy_layout"><?=backButton()?></div>
<div class="with_border legacy_layout"><?=banner()?></div>
</div>