feat(WIP): processing 건국, 다른 메뉴 UI 통일
- lazy loading은 의미가 없으므로 롤백
This commit is contained in:
@@ -197,87 +197,25 @@ class che_건국 extends Command\GeneralCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getJSPlugins(): array
|
||||
public function exportJSVars(): array
|
||||
{
|
||||
return [
|
||||
'colorSelect'
|
||||
$nationTypes = [];
|
||||
foreach (GameConst::$availableNationType as $nationType) {
|
||||
$nationClass = buildNationTypeClass($nationType);
|
||||
$nationTypes[$nationType] = [
|
||||
'type' => $nationType,
|
||||
'name' => $nationClass->getName(),
|
||||
'pros' => $nationClass::$pros,
|
||||
'cons' => $nationClass::$cons
|
||||
];
|
||||
}
|
||||
return [
|
||||
'procRes' => [
|
||||
'available건국' => count(getAllNationStaticInfo()) < $this->env['maxnation'],
|
||||
'nationTypes' => $nationTypes,
|
||||
'colors' => GetNationColors(),
|
||||
|
||||
public function getForm(): string
|
||||
{
|
||||
|
||||
if (count(getAllNationStaticInfo()) >= $this->env['maxnation']) {
|
||||
return '더 이상 건국은 불가능합니다.';
|
||||
}
|
||||
|
||||
|
||||
//NOTE: 새로운 방법이 생기기 전까진 아무색이나 선택 가능하도록 하자.
|
||||
/*
|
||||
foreach(GetNationColors() as $color){
|
||||
$colorUsed[$color] = 0;
|
||||
}
|
||||
|
||||
foreach(getAllNationStaticInfo() as $nation){
|
||||
if($nation['level'] <= 0){
|
||||
continue;
|
||||
}
|
||||
$colorUsed[$nation['color']]++;
|
||||
}
|
||||
|
||||
$colorUsedCnt = 0;
|
||||
foreach($colorUsed as $color=>$used){
|
||||
if($used){
|
||||
continue;
|
||||
}
|
||||
$colorUsedCnt += 1;
|
||||
}
|
||||
|
||||
//색깔이 다 쓰였으면 그냥 모두 허용
|
||||
if($colorUsedCnt === count($colorUsed)){
|
||||
foreach(array_keys($colorUsed) as $color){
|
||||
$colorUsed[$color] = 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
현재 도시에서 나라를 세웁니다. 중, 소도시에서만 가능합니다.<br>
|
||||
|
||||
<?php foreach (GameConst::$availableNationType as $nationType) :
|
||||
$nationClass = buildNationTypeClass($nationType);
|
||||
|
||||
[$name, $pros, $cons] = [$nationClass->getName(), $nationClass::$pros, $nationClass::$cons];
|
||||
?>
|
||||
|
||||
- <?= $name ?> : <span style='color:cyan;'><?= $pros ?></span> <span style='color:magenta;'><?= $cons ?></span><br>
|
||||
<?php endforeach; ?>
|
||||
<br>
|
||||
국명 : <input type='text' class='formInput' name="nationName" id="nationName" size='18' maxlength='18' style='color:white;background-color:black;'>
|
||||
색상 : <select class='formInput' name='colorType' id='colorType' size='1'>
|
||||
|
||||
<?php foreach (GetNationColors() as $idx => $color) :
|
||||
/*
|
||||
if($colorUsed[$color] > 0){
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<option value="<?= $idx ?>" data-color="<?= $color ?>" data-font-color="<?=newColor($color)?>" style='background-color:<?= $color ?>;color:<?= newColor($color) ?>;'>국가명(<?=$color?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
성향 : <select class='formInput' name='nationType' id='nationType' size='1'>
|
||||
|
||||
<?php foreach (GameConst::$availableNationType as $nationType) :
|
||||
$nationTypeName = buildNationTypeClass($nationType)->getName();
|
||||
?>
|
||||
<option value='<?= $nationType ?>' style=background-color:black;color:white;><?= $nationTypeName ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=button id="commonSubmit" value="<?= $this->getName() ?>">
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<div class="col-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<b-button
|
||||
v-if="maxAmount > 30000"
|
||||
@@ -50,7 +49,6 @@
|
||||
>+1만</b-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType } from "vue";
|
||||
@@ -83,7 +81,7 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
amount: this.modelValue,
|
||||
}
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -88,7 +88,6 @@ export default defineComponent({
|
||||
value,
|
||||
title,
|
||||
};
|
||||
console.log(obj);
|
||||
forFind.push(obj);
|
||||
targets.set(value, obj);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<TopBackBar :title="commandName" type="chief" />
|
||||
<div class="bg0" v-if="!available건국">더 이상 건국은 불가능합니다.</div>
|
||||
<div class="bg0" v-else>
|
||||
<div>현재 도시에서 나라를 세웁니다. 중, 소도시에서만 가능합니다.</div>
|
||||
<ul>
|
||||
<li v-for="nationType in nationTypes" :key="nationType.type" class="row">
|
||||
<div class="col-2 col-md-1">- {{ nationType.name }}</div>
|
||||
<div class="col-4 col-md-2">
|
||||
: <span style="color: cyan">{{ nationType.pros }}</span
|
||||
>,
|
||||
</div>
|
||||
<div class="col-4 col-md-2">
|
||||
<span style="color: magenta">{{ nationType.cons }}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-4">
|
||||
국명 : <b-form-input v-model="destNationName" />
|
||||
</div>
|
||||
<div class="col-6 col-md-2">
|
||||
색상 : <ColorSelect :colors="colors" v-model="selectedColorID" />
|
||||
</div>
|
||||
<div class="col-6 col-md-2">
|
||||
<label>성향 :</label>
|
||||
<b-form-select
|
||||
:options="nationTypesOption"
|
||||
v-model="selectedNationType"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-2 d-grid">
|
||||
<b-button @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<BottomBar :title="commandName" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import ColorSelect from "@/processing/ColorSelect.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 { procNationTypeList } from "../processingRes";
|
||||
|
||||
declare const commandName: string;
|
||||
|
||||
declare const procRes: {
|
||||
available건국: boolean;
|
||||
colors: string[];
|
||||
nationTypes: procNationTypeList;
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
ColorSelect,
|
||||
TopBackBar,
|
||||
BottomBar,
|
||||
},
|
||||
setup() {
|
||||
const destNationName = ref("");
|
||||
const selectedColorID = ref(0);
|
||||
|
||||
console.log(procRes.nationTypes);
|
||||
const selectedNationType = ref(Object.values(procRes.nationTypes)[0].type);
|
||||
|
||||
async function submit(e: Event) {
|
||||
const event = new CustomEvent<Args>("customSubmit", {
|
||||
detail: {
|
||||
colorType: selectedColorID.value,
|
||||
nationName: destNationName.value,
|
||||
nationType: selectedNationType.value,
|
||||
},
|
||||
});
|
||||
unwrap(e.target).dispatchEvent(event);
|
||||
}
|
||||
|
||||
const nationTypesOption: { html: string; value: string }[] = [];
|
||||
for (const nationType of Object.values(procRes.nationTypes)) {
|
||||
nationTypesOption.push({
|
||||
html: nationType.name,
|
||||
value: nationType.type,
|
||||
});
|
||||
}
|
||||
console.log(nationTypesOption);
|
||||
|
||||
return {
|
||||
available건국: procRes.available건국,
|
||||
selectedColorID,
|
||||
selectedNationType,
|
||||
colors: procRes.colors,
|
||||
nationTypes: procRes.nationTypes,
|
||||
nationTypesOption,
|
||||
destNationName,
|
||||
commandName,
|
||||
submit,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -26,10 +26,11 @@
|
||||
목록을 선택하거나 도시를 클릭하세요.<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="col-4 col-md-2">
|
||||
도시:
|
||||
<CitySelect :cities="citiesMap" v-model="selectedCityID" />
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-4 col-md-2 d-grid">
|
||||
<b-button @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { default as che_건국} from "./che_건국.vue";
|
||||
import { default as CityProcess} from "./che_이동.vue";
|
||||
|
||||
export const commandMap: Record<string, ()=>typeof CityProcess> = {
|
||||
che_강행: ()=>CityProcess,
|
||||
che_이동: ()=>CityProcess,
|
||||
che_출병: ()=>CityProcess,
|
||||
export const commandMap: Record<string, typeof CityProcess> = {
|
||||
che_강행: CityProcess,
|
||||
che_건국,
|
||||
che_이동: CityProcess,
|
||||
che_출병: CityProcess,
|
||||
}
|
||||
@@ -3,13 +3,13 @@
|
||||
<div class="bg0">
|
||||
<div>
|
||||
국기를 변경합니다. 단 1회 가능합니다.<br>
|
||||
색상 : <br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-6 col-md-3">
|
||||
색상 :
|
||||
<ColorSelect :colors="colors" v-model="selectedColorID" />
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-4 col-md-2 d-grid">
|
||||
<b-button @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<div class="bg0">
|
||||
<div>
|
||||
나라의 이름을 바꿉니다. 황제가 된 후 1회 가능합니다.<br />
|
||||
국명 : <br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-6 col-md-3">
|
||||
국명 :
|
||||
<b-form-input v-model="destNationName"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-4 col-md-2 d-grid">
|
||||
<b-button @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
표시됩니다.<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-6 col-md-3">
|
||||
국가 :
|
||||
<NationSelect :nations="nations" v-model="selectedNationID" />
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="col-4 col-md-2 d-grid">
|
||||
<b-button @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-5">
|
||||
장수 :
|
||||
<GeneralSelect
|
||||
:cities="citiesMap"
|
||||
:generals="generalList"
|
||||
@@ -18,13 +19,23 @@
|
||||
:textHelper="textHelpGeneral"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-2 col-md-1">
|
||||
자원 :
|
||||
<b-button-group>
|
||||
<b-button :pressed="isGold" @click="isGold=true">금</b-button>
|
||||
<b-button :pressed="!isGold" @click="isGold=false">쌀</b-button>
|
||||
</b-button-group>
|
||||
</div>
|
||||
<div class="col-10 col-md-4">
|
||||
금액 :
|
||||
<AmountSelect
|
||||
:amountGuide="amountGuide"
|
||||
v-model="amount"
|
||||
:maxAmount="maxAmount"
|
||||
:minAmount="minAmount"
|
||||
/>
|
||||
<div class="col-12 col-md-2 d-grid">
|
||||
</div>
|
||||
<div class="col-4 col-md-2 d-grid">
|
||||
<b-button variant="primary" @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6">
|
||||
장수 :
|
||||
<GeneralSelect
|
||||
:cities="citiesMap"
|
||||
:generals="generalList"
|
||||
@@ -25,11 +26,12 @@
|
||||
v-model="selectedGeneralID"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<div class="col-6 col-md-4">
|
||||
도시 :
|
||||
<CitySelect :cities="citiesMap" v-model="selectedCityID" />
|
||||
</div>
|
||||
<div class="col-12 col-md-2 d-grid">
|
||||
<b-button @click="submit">{{ commandName }}</b-button>
|
||||
<div class="col-4 col-md-2 d-grid">
|
||||
<b-button variant="primary" @click="submit">{{ commandName }}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,11 +4,11 @@ import { default as NationProcess } from "./che_급습.vue";
|
||||
import { default as GeneralAmountProcess } from "./che_몰수.vue";
|
||||
import { default as GeneralCityProcess } from "./che_발령.vue";
|
||||
|
||||
export const commandMap: Record<string, ()=>typeof NationProcess> = {
|
||||
che_국기변경: ()=>che_국기변경,
|
||||
che_국호변경: ()=>che_국호변경,
|
||||
che_급습: ()=>NationProcess,
|
||||
che_몰수: ()=>GeneralAmountProcess,
|
||||
che_포상: ()=>GeneralAmountProcess,
|
||||
che_발령: ()=>GeneralCityProcess,
|
||||
export const commandMap: Record<string, typeof NationProcess> = {
|
||||
che_국기변경,
|
||||
che_국호변경,
|
||||
che_급습: NationProcess,
|
||||
che_몰수: GeneralAmountProcess,
|
||||
che_포상: GeneralAmountProcess,
|
||||
che_발령: GeneralCityProcess,
|
||||
}
|
||||
@@ -64,3 +64,12 @@ export type procNationItem = {
|
||||
};
|
||||
|
||||
export type procNationList = procNationItem[];
|
||||
|
||||
export type procNationTypeItem = {
|
||||
type: string,
|
||||
name: string,
|
||||
pros: string,
|
||||
cons: string,
|
||||
}
|
||||
|
||||
export type procNationTypeList = Record<string, procNationTypeItem>;
|
||||
@@ -76,7 +76,7 @@ const app: App<Element> | undefined = (function () {
|
||||
console.error(`${moduleName}이 ${groupName}에 없음`);
|
||||
return undefined;
|
||||
}
|
||||
return createApp(GeneralActions[moduleName]());
|
||||
return createApp(GeneralActions[moduleName]);
|
||||
}
|
||||
if (groupName == 'Nation') {
|
||||
const moduleName = entryInfo[1];
|
||||
@@ -84,7 +84,7 @@ const app: App<Element> | undefined = (function () {
|
||||
console.error(`${moduleName}이 ${groupName}에 없음`);
|
||||
return undefined;
|
||||
}
|
||||
return createApp(NationActions[moduleName]());
|
||||
return createApp(NationActions[moduleName]);
|
||||
}
|
||||
|
||||
console.error('알수')
|
||||
|
||||
Reference in New Issue
Block a user