feat(WIP): processing 임관
- 구 css 코드 남은것 해결
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo\Command\General;
|
namespace sammo\Command\General;
|
||||||
|
|
||||||
use \sammo\{
|
use \sammo\{
|
||||||
DB, Util, JosaUtil,
|
DB,
|
||||||
|
Util,
|
||||||
|
JosaUtil,
|
||||||
General,
|
General,
|
||||||
ActionLogger,
|
ActionLogger,
|
||||||
GameConst, GameUnitConst,
|
GameConst,
|
||||||
|
GameUnitConst,
|
||||||
LastTurn,
|
LastTurn,
|
||||||
Command,
|
Command,
|
||||||
Json,
|
Json,
|
||||||
@@ -22,24 +26,26 @@ use sammo\CityConst;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class che_임관 extends Command\GeneralCommand{
|
class che_임관 extends Command\GeneralCommand
|
||||||
|
{
|
||||||
static protected $actionName = '임관';
|
static protected $actionName = '임관';
|
||||||
static public $reqArg = true;
|
static public $reqArg = true;
|
||||||
|
|
||||||
protected function argTest():bool{
|
protected function argTest(): bool
|
||||||
if($this->arg === null){
|
{
|
||||||
|
if ($this->arg === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$destNationID = $this->arg['destNationID']??null;
|
$destNationID = $this->arg['destNationID'] ?? null;
|
||||||
|
|
||||||
if($destNationID === null){
|
if ($destNationID === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_int($destNationID)){
|
if (!is_int($destNationID)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if($destNationID < 1){
|
if ($destNationID < 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +56,8 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function init(){
|
protected function init()
|
||||||
|
{
|
||||||
|
|
||||||
$general = $this->generalObj;
|
$general = $this->generalObj;
|
||||||
$env = $this->env;
|
$env = $this->env;
|
||||||
@@ -60,23 +67,24 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$relYear = $env['year'] - $env['startyear'];
|
$relYear = $env['year'] - $env['startyear'];
|
||||||
|
|
||||||
$this->permissionConstraints=[
|
$this->permissionConstraints = [
|
||||||
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다')
|
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다')
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->minConditionConstraints=[
|
$this->minConditionConstraints = [
|
||||||
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
||||||
ConstraintHelper::BeNeutral(),
|
ConstraintHelper::BeNeutral(),
|
||||||
ConstraintHelper::AllowJoinAction()
|
ConstraintHelper::AllowJoinAction()
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCommandDetailTitle():string{
|
public function getCommandDetailTitle(): string
|
||||||
|
{
|
||||||
return '지정한 국가로 임관';
|
return '지정한 국가로 임관';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canDisplay():bool{
|
public function canDisplay(): bool
|
||||||
|
{
|
||||||
return $this->env['join_mode'] !== 'onlyRandom';
|
return $this->env['join_mode'] !== 'onlyRandom';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +95,7 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$env = $this->env;
|
$env = $this->env;
|
||||||
$relYear = $env['year'] - $env['startyear'];
|
$relYear = $env['year'] - $env['startyear'];
|
||||||
$this->fullConditionConstraints=[
|
$this->fullConditionConstraints = [
|
||||||
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
ConstraintHelper::ReqEnvValue('join_mode', '!=', 'onlyRandom', '랜덤 임관만 가능합니다'),
|
||||||
ConstraintHelper::BeNeutral(),
|
ConstraintHelper::BeNeutral(),
|
||||||
ConstraintHelper::ExistsDestNation(),
|
ConstraintHelper::ExistsDestNation(),
|
||||||
@@ -96,27 +104,32 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCost():array{
|
public function getCost(): array
|
||||||
|
{
|
||||||
return [0, 0];
|
return [0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreReqTurn():int{
|
public function getPreReqTurn(): int
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPostReqTurn():int{
|
public function getPostReqTurn(): int
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBrief():string{
|
public function getBrief(): string
|
||||||
|
{
|
||||||
$commandName = $this->getName();
|
$commandName = $this->getName();
|
||||||
$destNationName = getNationStaticInfo($this->arg['destNationID'])['name'];
|
$destNationName = getNationStaticInfo($this->arg['destNationID'])['name'];
|
||||||
$josaRo = JosaUtil::pick($destNationName, '로');
|
$josaRo = JosaUtil::pick($destNationName, '로');
|
||||||
return "【{$destNationName}】{$josaRo} {$commandName}";
|
return "【{$destNationName}】{$josaRo} {$commandName}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run():bool{
|
public function run(): bool
|
||||||
if(!$this->hasFullConditionMet()){
|
{
|
||||||
|
if (!$this->hasFullConditionMet()) {
|
||||||
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
|
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,10 +152,9 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
$logger->pushGeneralHistoryLog("<D><b>{$destNationName}</b></>에 임관");
|
$logger->pushGeneralHistoryLog("<D><b>{$destNationName}</b></>에 임관");
|
||||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>에 <S>임관</>했습니다.");
|
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <D><b>{$destNationName}</b></>에 <S>임관</>했습니다.");
|
||||||
|
|
||||||
if($gennum < GameConst::$initialNationGenLimit) {
|
if ($gennum < GameConst::$initialNationGenLimit) {
|
||||||
$exp = 700;
|
$exp = 700;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$exp = 100;
|
$exp = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,22 +163,21 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
$general->setVar('officer_city', 0);
|
$general->setVar('officer_city', 0);
|
||||||
$general->setVar('belong', 1);
|
$general->setVar('belong', 1);
|
||||||
|
|
||||||
if($this->destGeneralObj !== null){
|
if ($this->destGeneralObj !== null) {
|
||||||
$general->setVar('city', $this->destGeneralObj->getCityID());
|
$general->setVar('city', $this->destGeneralObj->getCityID());
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$targetCityID = $db->queryFirstField('SELECT city FROM general WHERE nation = %i AND officer_level=12', $destNationID);
|
$targetCityID = $db->queryFirstField('SELECT city FROM general WHERE nation = %i AND officer_level=12', $destNationID);
|
||||||
$general->setVar('city', $targetCityID);
|
$general->setVar('city', $targetCityID);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gennum'=>$db->sqleval('gennum + 1')
|
'gennum' => $db->sqleval('gennum + 1')
|
||||||
], 'nation=%i', $destNationID);
|
], 'nation=%i', $destNationID);
|
||||||
\sammo\refreshNationStaticInfo();
|
\sammo\refreshNationStaticInfo();
|
||||||
|
|
||||||
$relYear = $env['year'] - $env['startyear'];
|
$relYear = $env['year'] - $env['startyear'];
|
||||||
if($general->getNPCType() == 1 || $relYear >= 3){
|
if ($general->getNPCType() == 1 || $relYear >= 3) {
|
||||||
$joinedNations = $general->getAuxVar('joinedNations')??[];
|
$joinedNations = $general->getAuxVar('joinedNations') ?? [];
|
||||||
$joinedNations[] = $destNationID;
|
$joinedNations[] = $destNationID;
|
||||||
$general->setAuxVar('joinedNations', $joinedNations);
|
$general->setAuxVar('joinedNations', $joinedNations);
|
||||||
}
|
}
|
||||||
@@ -181,64 +192,43 @@ class che_임관 extends Command\GeneralCommand{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getForm(): string
|
public function exportJSVars(): array
|
||||||
{
|
{
|
||||||
|
$generalObj = $this->generalObj;
|
||||||
|
$nationID = $generalObj->getNationID();
|
||||||
|
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$generalObj = $this->generalObj;
|
$rawNationList = Util::convertArrayToDict($db->query('SELECT nation,`name`,color,gennum,`power` FROM nation'), 'nation');
|
||||||
|
|
||||||
$env = $this->env;
|
|
||||||
|
|
||||||
$joinedNations = $generalObj->getAuxVar('joinedNations')??[];
|
|
||||||
|
|
||||||
$nationList = $db->query('SELECT nation,`name`,color,scout,gennum FROM nation');
|
|
||||||
shuffle($nationList);
|
|
||||||
$nationList = Util::convertArrayToDict($nationList, 'nation');
|
|
||||||
//NOTE: join 안할것임
|
|
||||||
$scoutMsgs = KVStorage::getValuesFromInterNamespace($db, 'nation_env', 'scout_msg');
|
$scoutMsgs = KVStorage::getValuesFromInterNamespace($db, 'nation_env', 'scout_msg');
|
||||||
foreach($scoutMsgs as $nationID=>$scoutMsg){
|
foreach ($scoutMsgs as $nationID => $scoutMsg) {
|
||||||
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
|
$rawNationList[$nationID]['scoutmsg'] = $scoutMsg;
|
||||||
}
|
}
|
||||||
|
foreach ($rawNationList as $destNation) {
|
||||||
|
$testCommand = new static($generalObj, $this->env, ['destNationID' => $destNation['nation']]);
|
||||||
|
|
||||||
$hiddenItems = [];
|
$nationTarget = [
|
||||||
|
'id' => $destNation['nation'],
|
||||||
foreach($nationList as &$nation){
|
'name' => $destNation['name'],
|
||||||
if($env['year'] < $env['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
|
'color' => $destNation['color'],
|
||||||
$nation['availableJoin'] = false;
|
'power' => $destNation['power'],
|
||||||
|
'scoutMsg' => $destNation['scoutmsg'] ?? ' ',
|
||||||
|
];
|
||||||
|
if (!$testCommand->hasFullConditionMet()) {
|
||||||
|
$nationTarget['notAvailable'] = true;
|
||||||
}
|
}
|
||||||
else if($nation['scout'] == 1) {
|
if ($destNation['id'] == $nationID) {
|
||||||
$nation['availableJoin'] = false;
|
$nationTarget['notAvailable'] = true;
|
||||||
}
|
|
||||||
else{
|
|
||||||
$nation['availableJoin'] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_array($nation['nation'], $joinedNations)){
|
$nationList[] = $nationTarget;
|
||||||
$nation['availableJoin'] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Util::starts_with($nation['name'], 'ⓤ')){
|
|
||||||
$hiddenItems[$nation['nation']] = $nation['nation'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
unset($nation);
|
return [
|
||||||
ob_start();
|
'mapTheme' => \sammo\getMapTheme(),
|
||||||
?>
|
'procRes' => [
|
||||||
국가에 임관합니다.<br>
|
'nations' => $nationList,
|
||||||
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
'startYear' => $this->env['startyear'],
|
||||||
바로 군주의 위치로 이동합니다.<br>
|
],
|
||||||
임관할 국가를 목록에서 선택하세요.<br>
|
];
|
||||||
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
|
|
||||||
<?php foreach($nationList as $nation): ?>
|
|
||||||
<?php if(key_exists($nation['nation'], $hiddenItems)){ continue; } ?>
|
|
||||||
<option
|
|
||||||
value='<?=$nation['nation']?>'
|
|
||||||
style='<?=$nation['availableJoin']?'':'background-color:red;'?>'
|
|
||||||
>【<?=$nation['name']?> 】</option>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<input type=button id="commonSubmit" value="<?=$this->getName()?>">
|
|
||||||
<?=getInvitationList($nationList)?>
|
|
||||||
<?php
|
|
||||||
return ob_get_clean();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,11 +203,6 @@ class che_급습 extends Command\NationCommand
|
|||||||
$nationList = [];
|
$nationList = [];
|
||||||
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
|
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
|
||||||
foreach (getAllNationStaticInfo() as $destNation) {
|
foreach (getAllNationStaticInfo() as $destNation) {
|
||||||
/*if ($destNation['nation'] == $nationID) {
|
|
||||||
continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$testTurn->setArg(['destNationID' => $destNation['nation']]);
|
|
||||||
$testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]);
|
$testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]);
|
||||||
|
|
||||||
$nationTarget = [
|
$nationTarget = [
|
||||||
@@ -219,7 +214,7 @@ class che_급습 extends Command\NationCommand
|
|||||||
if (!$testCommand->hasFullConditionMet()) {
|
if (!$testCommand->hasFullConditionMet()) {
|
||||||
$nationTarget['notAvailable'] = true;
|
$nationTarget['notAvailable'] = true;
|
||||||
}
|
}
|
||||||
if ($destNation['nation'] == $nationID) {
|
if ($destNation['id'] == $nationID) {
|
||||||
$nationTarget['notAvailable'] = true;
|
$nationTarget['notAvailable'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -200,10 +200,6 @@ class che_선전포고 extends Command\NationCommand
|
|||||||
$nationList = [];
|
$nationList = [];
|
||||||
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
|
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
|
||||||
foreach (getAllNationStaticInfo() as $destNation) {
|
foreach (getAllNationStaticInfo() as $destNation) {
|
||||||
/*if ($destNation['nation'] == $nationID) {
|
|
||||||
continue;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$testTurn->setArg(['destNationID' => $destNation['nation']]);
|
$testTurn->setArg(['destNationID' => $destNation['nation']]);
|
||||||
$testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]);
|
$testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]);
|
||||||
|
|
||||||
@@ -216,7 +212,7 @@ class che_선전포고 extends Command\NationCommand
|
|||||||
if (!$testCommand->hasFullConditionMet()) {
|
if (!$testCommand->hasFullConditionMet()) {
|
||||||
$nationTarget['notAvailable'] = true;
|
$nationTarget['notAvailable'] = true;
|
||||||
}
|
}
|
||||||
if ($destNation['nation'] == $nationID) {
|
if ($destNation['id'] == $nationID) {
|
||||||
$nationTarget['notAvailable'] = true;
|
$nationTarget['notAvailable'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,44 +233,4 @@ class che_선전포고 extends Command\NationCommand
|
|||||||
'defaultSelectNationByMap'
|
'defaultSelectNationByMap'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getForm(): string
|
|
||||||
{
|
|
||||||
$generalObj = $this->generalObj;
|
|
||||||
$nationID = $generalObj->getNationID();
|
|
||||||
$startYear = $this->env['startyear'];
|
|
||||||
$availableYear = $startYear + 1;
|
|
||||||
$nationList = [];
|
|
||||||
foreach (getAllNationStaticInfo() as $destNation) {
|
|
||||||
if ($destNation['nation'] == $nationID) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$testCommand = new static($generalObj, $this->env, $this->getLastTurn(), ['destNationID' => $destNation['nation']]);
|
|
||||||
if ($testCommand->hasFullConditionMet()) {
|
|
||||||
$destNation['availableWar'] = true;
|
|
||||||
} else {
|
|
||||||
$destNation['availableWar'] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$nationList[] = $destNation;
|
|
||||||
}
|
|
||||||
|
|
||||||
ob_start();
|
|
||||||
?>
|
|
||||||
<?= \sammo\getMapHtml() ?><br>
|
|
||||||
타국에게 선전 포고합니다.<br>
|
|
||||||
선전 포고할 국가를 목록에서 선택하세요.<br>
|
|
||||||
고립되지 않은 아국 도시에서 인접한 국가에 선포 가능합니다.<br>
|
|
||||||
초반제한 해제 2년전부터 선포가 가능합니다. (<?= $availableYear ?>년 1월부터 가능)<br>
|
|
||||||
현재 선포가 불가능한 국가는 배경색이 <font color=red>붉은색</font>으로 표시됩니다.<br>
|
|
||||||
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
|
|
||||||
<?php foreach ($nationList as $nation) : ?>
|
|
||||||
<option value='<?= $nation['nation'] ?>' style='color:<?= $nation['color'] ?>;<?= $nation['availableWar'] ? '' : 'background-color:red;' ?>'>【<?= $nation['name'] ?> 】</option>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
|
||||||
<input type=button id="commonSubmit" value="<?= $this->getName() ?>">
|
|
||||||
<?php
|
|
||||||
return ob_get_clean();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,15 @@
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{ props.option.title }}
|
{{ props.option.title }}
|
||||||
<span v-if="props.option.info">({{ props.option.info }})</span></span
|
<span v-if="props.option.info">({{ props.option.info }})</span> {{ props.option.notAvailable ? "(불가)" : undefined }}</span
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:singleLabel="props">
|
<template v-slot:singleLabel="props">
|
||||||
{{ props.option.simpleName }}
|
<span
|
||||||
|
:style="{
|
||||||
|
color: props.option.notAvailable ? 'red' : undefined,
|
||||||
|
}"
|
||||||
|
>{{ props.option.simpleName }} {{ props.option.notAvailable ? "(불가)" : undefined }}</span>
|
||||||
</template>
|
</template>
|
||||||
</v-multiselect>
|
</v-multiselect>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<TopBackBar :title="commandName" type="chief" />
|
||||||
|
<div class="bg0">
|
||||||
|
<div>
|
||||||
|
국가에 임관합니다.<br />
|
||||||
|
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br />
|
||||||
|
바로 군주의 위치로 이동합니다.<br />
|
||||||
|
임관할 국가를 목록에서 선택하세요.<br />
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6 col-md-3">
|
||||||
|
국가 :
|
||||||
|
<NationSelect :nations="nations" v-model="selectedNationID" />
|
||||||
|
</div>
|
||||||
|
<div class="col-4 col-md-2 d-grid">
|
||||||
|
<b-button @click="submit">{{ commandName }}</b-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="nation-list">
|
||||||
|
<div class="nation-header nation-row bg1 center">
|
||||||
|
<div>국가명</div>
|
||||||
|
<div>임관권유문</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="[, nation] in nations"
|
||||||
|
:key="nation.id"
|
||||||
|
class="nation-row s-border-b"
|
||||||
|
@click="selectedNationID = nation.id"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
backgroundColor: nation.color,
|
||||||
|
color: isBrightColor(nation.color) ? 'black' : 'white',
|
||||||
|
fontSize: '1.3em',
|
||||||
|
}"
|
||||||
|
class="d-grid"
|
||||||
|
>
|
||||||
|
<div class="align-self-center center">{{ nation.name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="nation-scout-plate align-self-center">
|
||||||
|
<div class="nation-scout-msg" v-html="nation.scoutMsg" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<BottomBar :title="commandName" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import NationSelect from "@/processing/NationSelect.vue";
|
||||||
|
import { defineComponent, ref } from "vue";
|
||||||
|
import { unwrap } from "@/util/unwrap";
|
||||||
|
import { Args } from "@/processing/args";
|
||||||
|
import TopBackBar from "@/components/TopBackBar.vue";
|
||||||
|
import BottomBar from "@/components/BottomBar.vue";
|
||||||
|
import { procNationItem, procNationList } from "../processingRes";
|
||||||
|
import { isBrightColor } from "@/util/isBrightColor";
|
||||||
|
declare const mapTheme: string;
|
||||||
|
declare const commandName: string;
|
||||||
|
|
||||||
|
declare const procRes: {
|
||||||
|
nations: procNationList;
|
||||||
|
startYear: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
NationSelect,
|
||||||
|
TopBackBar,
|
||||||
|
BottomBar,
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const nations = new Map<number, procNationItem>();
|
||||||
|
for (const nationItem of procRes.nations) {
|
||||||
|
nations.set(nationItem.id, nationItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectedNationID = ref(procRes.nations[0].id);
|
||||||
|
const selectedCityObj = ref(); //mapping용
|
||||||
|
|
||||||
|
function selectedNation(nationID: number) {
|
||||||
|
selectedNationID.value = nationID;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function submit(e: Event) {
|
||||||
|
const event = new CustomEvent<Args>("customSubmit", {
|
||||||
|
detail: {
|
||||||
|
destNationID: selectedNationID.value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
unwrap(e.target).dispatchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
startYear: procRes.startYear,
|
||||||
|
mapTheme: ref(mapTheme),
|
||||||
|
nations: ref(nations),
|
||||||
|
selectedCityObj,
|
||||||
|
selectedNationID,
|
||||||
|
commandName,
|
||||||
|
isBrightColor,
|
||||||
|
selectedNation,
|
||||||
|
submit,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "@scss/common/break_500px.scss";
|
||||||
|
|
||||||
|
@include media-1000px {
|
||||||
|
.nation-list .nation-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 130px 870px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include media-500px {
|
||||||
|
.nation-list .nation-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
grid-template-rows: 1fr minmax(1fr, calc(200px * 500 / 870));
|
||||||
|
}
|
||||||
|
|
||||||
|
.nation-scout-plate {
|
||||||
|
max-height: calc(200px * 500 / 870);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nation-scout-msg {
|
||||||
|
width: 870px;
|
||||||
|
transform-origin: 0px 0px;
|
||||||
|
transform: scale(calc(500 / 870));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import { default as che_건국} from "./che_건국.vue";
|
import { default as che_건국 } from "./che_건국.vue";
|
||||||
import { default as che_군량매매} from "./che_군량매매.vue";
|
import { default as che_군량매매 } from "./che_군량매매.vue";
|
||||||
import { default as che_등용} from "./che_등용.vue";
|
import { default as che_등용 } from "./che_등용.vue";
|
||||||
import { default as CityProcess} from "./che_이동.vue";
|
import { default as CityProcess } from "./che_이동.vue";
|
||||||
import { default as che_징병} from "./che_징병.vue";
|
import { default as che_임관 } from "./che_임관.vue";
|
||||||
|
import { default as che_징병 } from "./che_징병.vue";
|
||||||
|
|
||||||
//TODO: 자주 쓰는 녀석들은 Slot으로 변경
|
//TODO: 자주 쓰는 녀석들은 Slot으로 변경
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ export const commandMap: Record<string, typeof CityProcess> = {
|
|||||||
che_건국,
|
che_건국,
|
||||||
che_등용,
|
che_등용,
|
||||||
che_이동: CityProcess,
|
che_이동: CityProcess,
|
||||||
|
che_임관,
|
||||||
che_출병: CityProcess,
|
che_출병: CityProcess,
|
||||||
che_징병,
|
che_징병,
|
||||||
che_모병: che_징병,
|
che_모병: che_징병,
|
||||||
|
|||||||
@@ -28,7 +28,14 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:singleLabel="props">
|
<template v-slot:singleLabel="props">
|
||||||
{{ props.option.simpleName }}
|
<span
|
||||||
|
:style="{
|
||||||
|
color: props.option.notAvailable ? 'red' : undefined,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ props.option.simpleName }}
|
||||||
|
{{ props.option.notAvailable ? "(불가)" : undefined }}</span
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</v-multiselect>
|
</v-multiselect>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export type procNationItem = {
|
|||||||
name: string,
|
name: string,
|
||||||
color: string,
|
color: string,
|
||||||
power: number,
|
power: number,
|
||||||
|
scoutMsg?: string,
|
||||||
info?: string,
|
info?: string,
|
||||||
notAvailable?: boolean,
|
notAvailable?: boolean,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -86,11 +86,6 @@ if (!$commandObj->hasPermissionToReserve()) {
|
|||||||
])?>
|
])?>
|
||||||
<?= WebUtil::printStaticValues($commandObj->exportJSVars(), false) ?>
|
<?= WebUtil::printStaticValues($commandObj->exportJSVars(), false) ?>
|
||||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||||
<?php
|
|
||||||
foreach ($cssList as $css) {
|
|
||||||
print(WebUtil::printCSS($css));
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?= WebUtil::printDist('vue', ['v_processing'], true) ?>
|
<?= WebUtil::printDist('vue', ['v_processing'], true) ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user