징병 불가능한 병종도 표기

This commit is contained in:
2020-01-28 02:15:51 +09:00
parent 9094434c16
commit ab48082bb8
2 changed files with 21 additions and 4 deletions
+7 -3
View File
@@ -244,9 +244,8 @@ function command_11($turn, $command, bool $is모병 = false) {
foreach(GameUnitConst::byType($armType) as $unit){
$crewObj = new \stdClass;
if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){
continue; //TODO: 불가능한 병종도 보여줄 필요가 있음.
}
$crewObj->showDefault = 'true';
$crewObj->id = $unit->id;
@@ -256,6 +255,11 @@ function command_11($turn, $command, bool $is모병 = false) {
else{
$crewObj->bgcolor = 'limegreen';
}
if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){
$crewObj->showDefault = 'false';
$crewObj->bgcolor = 'red';
}
$crewObj->baseRice = $unit->rice * getTechCost($tech);
$crewObj->baseCost = CharCost($unit->costWithTech($tech), $me['personal']);
+14 -1
View File
@@ -12,7 +12,8 @@
<table class='tb_layout' style='margin:auto;'>
<thead>
<?php if($commandName=='모병'): ?>
<tr><td align=center colspan=11>모병은 가격 2배의 자금이 소요됩니다.</td></tr>
<tr><td colspan=11><div style='float:right'><input type='checkbox' id="show_unavailable_troops">불가능한 병종 표시</input></div><div style='text-align:center;'>모병은 가격 2배의 자금이 소요됩니다.</div>
</td></tr>
<?php endif; ?>
<tr>
<td colspan=11 align=center class='bg2'>
@@ -43,6 +44,7 @@
<?php foreach($armTypeCrews as $crewObj): ?>
<tr
id="crewType<?=$crewObj->id?>"
class="show_default_<?=$crewObj->showDefault?>"
style='height:64px;background-color:<?=$crewObj->bgcolor?>'
data-rice="<?=$crewObj->baseRice?>"
data-cost="<?=$crewObj->baseCost?>"
@@ -177,5 +179,16 @@ $(function(){
});
$('.btn_fill').click();
$('#show_unavailable_troops').change(function(){
var show = $('#show_unavailable_troops').is(":checked");
if(show){
$('.show_default_false').show();
}
else{
$('.show_default_false').hide();
}
});
$('.show_default_false').hide();
});
</script>