징병 불가능한 병종도 표기
This commit is contained in:
+7
-3
@@ -244,9 +244,8 @@ function command_11($turn, $command, bool $is모병 = false) {
|
|||||||
|
|
||||||
foreach(GameUnitConst::byType($armType) as $unit){
|
foreach(GameUnitConst::byType($armType) as $unit){
|
||||||
$crewObj = new \stdClass;
|
$crewObj = new \stdClass;
|
||||||
if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){
|
$crewObj->showDefault = 'true';
|
||||||
continue; //TODO: 불가능한 병종도 보여줄 필요가 있음.
|
|
||||||
}
|
|
||||||
|
|
||||||
$crewObj->id = $unit->id;
|
$crewObj->id = $unit->id;
|
||||||
|
|
||||||
@@ -257,6 +256,11 @@ function command_11($turn, $command, bool $is모병 = false) {
|
|||||||
$crewObj->bgcolor = 'limegreen';
|
$crewObj->bgcolor = 'limegreen';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$unit->isValid($ownCities, $ownRegions, $relativeYear, $tech)){
|
||||||
|
$crewObj->showDefault = 'false';
|
||||||
|
$crewObj->bgcolor = 'red';
|
||||||
|
}
|
||||||
|
|
||||||
$crewObj->baseRice = $unit->rice * getTechCost($tech);
|
$crewObj->baseRice = $unit->rice * getTechCost($tech);
|
||||||
$crewObj->baseCost = CharCost($unit->costWithTech($tech), $me['personal']);
|
$crewObj->baseCost = CharCost($unit->costWithTech($tech), $me['personal']);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
<table class='tb_layout' style='margin:auto;'>
|
<table class='tb_layout' style='margin:auto;'>
|
||||||
<thead>
|
<thead>
|
||||||
<?php if($commandName=='모병'): ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=11 align=center class='bg2'>
|
<td colspan=11 align=center class='bg2'>
|
||||||
@@ -43,6 +44,7 @@
|
|||||||
<?php foreach($armTypeCrews as $crewObj): ?>
|
<?php foreach($armTypeCrews as $crewObj): ?>
|
||||||
<tr
|
<tr
|
||||||
id="crewType<?=$crewObj->id?>"
|
id="crewType<?=$crewObj->id?>"
|
||||||
|
class="show_default_<?=$crewObj->showDefault?>"
|
||||||
style='height:64px;background-color:<?=$crewObj->bgcolor?>'
|
style='height:64px;background-color:<?=$crewObj->bgcolor?>'
|
||||||
data-rice="<?=$crewObj->baseRice?>"
|
data-rice="<?=$crewObj->baseRice?>"
|
||||||
data-cost="<?=$crewObj->baseCost?>"
|
data-cost="<?=$crewObj->baseCost?>"
|
||||||
@@ -177,5 +179,16 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.btn_fill').click();
|
$('.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>
|
</script>
|
||||||
Reference in New Issue
Block a user