파일 이식(0.31.1)

This commit is contained in:
2022-07-08 00:11:41 +09:00
parent db08cec2cb
commit 96d76a06ef
217 changed files with 29966 additions and 2 deletions
@@ -0,0 +1,72 @@
<template>
<TopBackBar
:title="commandName"
type="chief"
/>
<div class="bg0">
<div>
국기를 변경합니다. 1 가능합니다.<br>
</div>
<div class="row">
<div class="col-6 col-md-3">
색상 :
<ColorSelect
v-model="selectedColorID"
:colors="colors"
/>
</div>
<div class="col-4 col-md-2 d-grid">
<b-button @click="submit">
{{ commandName }}
</b-button>
</div>
</div>
</div>
<BottomBar
:title="commandName"
type="chief"
/>
</template>
<script lang="ts">
import ColorSelect from "@/processing/SelectColor.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import type { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
declare const commandName: string;
declare const procRes: {
colors: string[],
};
export default defineComponent({
components: {
ColorSelect,
TopBackBar,
BottomBar,
},
setup() {
const selectedColorID = ref(0);
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
colorType: selectedColorID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
return {
selectedColorID,
colors: procRes.colors,
commandName,
submit,
};
},
});
</script>
@@ -0,0 +1,64 @@
<template>
<TopBackBar
:title="commandName"
type="chief"
/>
<div class="bg0">
<div>
나라의 이름을 바꿉니다. 황제가 1 가능합니다.<br>
</div>
<div class="row">
<div class="col-6 col-md-3">
국명 :
<b-form-input
v-model="destNationName"
maxlength="18"
/>
</div>
<div class="col-4 col-md-2 d-grid">
<b-button @click="submit">
{{ commandName }}
</b-button>
</div>
</div>
</div>
<BottomBar
:title="commandName"
type="chief"
/>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import type { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
declare const commandName: string;
export default defineComponent({
components: {
TopBackBar,
BottomBar,
},
setup() {
const destNationName = ref("");
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
nationName: destNationName.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
return {
destNationName,
commandName,
submit,
};
},
});
</script>
@@ -0,0 +1,186 @@
<template>
<TopBackBar v-model:searchable="searchable" :title="commandName" type="chief" />
<div v-if="asyncReady" class="bg0">
<MapViewer
v-if="map"
v-model="selectedCityObj"
:server-nick="serverNick"
:serverID="serverID"
:map-name="unwrap(gameConstStore?.gameConst.mapName)"
:mapData="map"
:isDetailMap="false"
:cityPosition="cityPosition"
:formatCityInfo="formatCityInfoText"
:image-path="imagePath"
/>
<div>
타국에게 원조합니다.<br />
작위별로 금액 제한이 있습니다.<br /><br />
<ul>
<template v-for="({ text, amount }, level) in levelInfo" :key="level">
<li>
<span
:style="{
width: '4em',
display: 'inline-block',
...(level != currentNationLevel
? {}
: {
textDecoration: 'underline',
fontWeight: 'bold',
}),
}"
>{{ text }}</span
>: {{ amount.toLocaleString() }}
</li>
</template>
</ul>
<br />
원조할 국가를 목록에서 선택하세요.<br /><br />
</div>
<div class="row">
<div class="col-6 col-md-3">
국가 :
<SelectNation v-model="selectedNationID" :nations="nationList" :searchable="searchable" />
</div>
<div class="col-6 col-md-0" />
<div class="col-8 col-md-4">
:
<SelectAmount
v-model="goldAmount"
:amountGuide="amountGuide"
:step="10"
:maxAmount="maxAmount"
:minAmount="minAmount"
/>
</div>
<div class="col-8 col-md-4">
:
<SelectAmount
v-model="riceAmount"
:amountGuide="amountGuide"
:step="10"
:maxAmount="maxAmount"
:minAmount="minAmount"
/>
</div>
<div class="col-4 col-md-2 d-grid">
<b-button variant="primary" @click="submit">
{{ commandName }}
</b-button>
</div>
</div>
</div>
<BottomBar :title="commandName" type="chief" />
</template>
<script lang="ts">
declare const staticValues: {
serverNick: string;
serverID: string;
mapName: string;
commandName: string;
};
declare const procRes: {
nationList: procNationList;
currentNationLevel: number;
levelInfo: Record<
number,
{
text: string;
amount: number;
}
>;
minAmount: number;
maxAmount: number;
amountGuide: number[];
};
declare const getCityPosition: () => CityPositionMap;
declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed;
</script>
<script lang="ts" setup>
import MapViewer, { type CityPositionMap, type MapCityParsed, type MapCityParsedRaw } from "@/components/MapViewer.vue";
import SelectNation from "@/processing/SelectNation.vue";
import SelectAmount from "@/processing/SelectAmount.vue";
import { ref, watch, onMounted, provide } from "vue";
import { unwrap } from "@/util/unwrap";
import type { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
import { getProcSearchable, type procNationItem, type procNationList } from "../processingRes";
import type { MapResult } from "@/defs";
import { SammoAPI } from "@/SammoAPI";
import { getGameConstStore, type GameConstStore } from "@/GameConstStore";
const serverNick = staticValues.serverNick;
const serverID = staticValues.serverID;
const cityPosition = getCityPosition();
const formatCityInfoText = formatCityInfo;
const imagePath = window.pathConfig.gameImage;
const asyncReady = ref<boolean>(false);
const gameConstStore = ref<GameConstStore>();
provide("gameConstStore", gameConstStore);
const storeP = getGameConstStore().then((store) => {
gameConstStore.value = store;
});
void Promise.all([storeP]).then(() => {
asyncReady.value = true;
});
const nationList = new Map<number, procNationItem>();
for (const nationItem of procRes.nationList) {
nationList.set(nationItem.id, nationItem);
}
const goldAmount = ref(procRes.minAmount);
const riceAmount = ref(procRes.minAmount);
const currentNationLevel = procRes.currentNationLevel;
const levelInfo = procRes.levelInfo;
const minAmount = ref(procRes.minAmount);
const maxAmount = ref(procRes.maxAmount);
const amountGuide = procRes.amountGuide;
const selectedNationID = ref(procRes.nationList[0]?.id);
const map = ref<MapResult>();
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
amountList: [goldAmount.value, riceAmount.value],
destNationID: selectedNationID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
const searchable = getProcSearchable();
const selectedCityObj = ref<MapCityParsed>();
const commandName = ref(staticValues.commandName);
watch(selectedCityObj, (city?: MapCityParsed) => {
if (city === undefined) {
return;
}
if (city.nationID === undefined) {
return;
}
selectedNationID.value = city.nationID;
});
onMounted(async () => {
try {
map.value = await SammoAPI.Global.GetMap({ neutralView: 0, showMe: 1 });
} catch (e) {
console.error(e);
}
});
</script>
+184
View File
@@ -0,0 +1,184 @@
<template>
<TopBackBar v-model:searchable="searchable" :title="commandName" type="chief" />
<div v-if="asyncReady" class="bg0">
<MapViewer
v-if="map"
v-model="selectedCityObj"
:server-nick="serverNick"
:serverID="serverID"
:map-name="unwrap(gameConstStore?.gameConst.mapName)"
:mapData="map"
:isDetailMap="false"
:cityPosition="cityPosition"
:formatCityInfo="formatCityInfoText"
:image-path="imagePath"
/>
<div>
선택된 도시로 아국 장수를 발령합니다.<br />
아국 도시로만 발령이 가능합니다.<br />
목록을 선택하거나 도시를 클릭하세요.<br />
</div>
<div class="row">
<div class="col-12 col-md-6">
장수 :
<SelectGeneral
v-model="selectedGeneralID"
:cities="citiesMap"
:generals="generalList"
:troops="troops"
:textHelper="textHelpGeneral"
:searchable="searchable"
/>
</div>
<div class="col-6 col-md-4">
도시 :
<SelectCity v-model="selectedCityID" :cities="citiesMap" :searchable="searchable" />
</div>
<div class="col-4 col-md-2 d-grid">
<b-button variant="primary" @click="submit">
{{ commandName }}
</b-button>
</div>
</div>
</div>
<BottomBar :title="commandName" type="chief" />
</template>
<script lang="ts">
declare const staticValues: {
serverNick: string;
serverID: string;
currentCity: number;
commandName: string;
};
declare const procRes: {
troops: procTroopList;
generals: procGeneralRawItemList;
generalsKey: procGeneralKey[];
};
declare const getCityPosition: () => CityPositionMap;
declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed;
</script>
<script lang="ts" setup>
import MapViewer, { type CityPositionMap, type MapCityParsed, type MapCityParsedRaw } from "@/components/MapViewer.vue";
import SelectCity from "@/processing/SelectCity.vue";
import SelectGeneral from "@/processing/SelectGeneral.vue";
import { ref, watch, onMounted, provide } from "vue";
import { unwrap } from "@/util/unwrap";
import type { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
import {
convertGeneralList,
getProcSearchable,
type procGeneralItem,
type procGeneralKey,
type procGeneralRawItemList,
type procTroopList,
} from "../processingRes";
import { getNpcColor } from "@/common_legacy";
import type { MapResult } from '@/defs';
import { SammoAPI } from '@/SammoAPI';
import { getGameConstStore, type GameConstStore } from '@/GameConstStore';
const serverNick = staticValues.serverNick;
const serverID = staticValues.serverID;
const cityPosition = getCityPosition();
const formatCityInfoText = formatCityInfo;
const imagePath = window.pathConfig.gameImage;
const asyncReady = ref<boolean>(false);
const gameConstStore = ref<GameConstStore>();
provide("gameConstStore", gameConstStore);
const storeP = getGameConstStore().then((store) => {
gameConstStore.value = store;
});
void Promise.all([storeP]).then(() => {
asyncReady.value = true;
});
const selectedCityID = ref(staticValues.currentCity);
const map = ref<MapResult>();
const citiesMap = ref(
new Map<
number,
{
name: string;
info?: string;
}
>()
);
watch(gameConstStore, (store)=>{
if(!store){
return;
}
const tmpCitiesMap = new Map<
number,
{
name: string;
info?: string;
}
>();
for(const city of Object.values(store.cityConst)){
tmpCitiesMap.set(city.id, {
name: city.name,
});
}
citiesMap.value = tmpCitiesMap;
})
//TODO: onMount로 이전하고 장수 목록은 실시간으로 받아와야함
const generalList = convertGeneralList(procRes.generalsKey, procRes.generals);
const troops = procRes.troops;
const selectedGeneralID = ref(generalList[0].no);
function textHelpGeneral(gen: procGeneralItem): string {
const troops = !gen.troopID ? "" : `,${procRes.troops[gen.troopID].name}`;
const nameColor = getNpcColor(gen.npc);
const name = nameColor ? `<span style="color:${nameColor}">${gen.name}</span>` : gen.name;
return `${name} [${citiesMap.value.get(unwrap(gen.cityID))?.name}${troops}] (${gen.leadership}/${gen.strength}/${
gen.intel
}) <병${unwrap(gen.crew).toLocaleString()}/훈${gen.train}/사${gen.atmos}>`;
}
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
destCityID: selectedCityID.value,
destGeneralID: selectedGeneralID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
const searchable = getProcSearchable();
const selectedCityObj = ref<MapCityParsed>();
const commandName = ref(staticValues.commandName);
watch(selectedCityObj, (city?: MapCityParsed) => {
if (city === undefined) {
return;
}
selectedCityID.value = city.id;
});
onMounted(async () => {
try{
map.value = await SammoAPI.Global.GetMap({neutralView:0, showMe: 1});
}
catch(e){
console.error(e);
}
});
</script>
@@ -0,0 +1,161 @@
<template>
<TopBackBar v-model:searchable="searchable" :title="commandName" type="chief" />
<div v-if="asyncReady" class="bg0">
<MapViewer
v-if="map"
v-model="selectedCityObj"
:server-nick="serverNick"
:serverID="serverID"
:map-name="unwrap(gameConstStore?.gameConst.mapName)"
:mapData="map"
:isDetailMap="false"
:cityPosition="cityPosition"
:formatCityInfo="formatCityInfoText"
:image-path="imagePath"
/>
<div>
타국에게 불가침을 제의합니다.<br />
제의할 국가를 목록에서 선택하세요.<br />
불가침 기한 다음 달부터 선포 가능합니다.<br />
현재 제의가 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div class="row">
<div class="col-4 col-md-3">
국가 :
<SelectNation v-model="selectedNationID" :nations="nationList" :searchable="searchable" />
</div>
<div class="col-5 col-md-3">
기간 :
<div class="input-group">
<b-form-select v-model="selectedYear" class="text-end selectedYear">
<b-form-select-option v-for="yearP in maxYear - minYear + 1" :key="yearP" :value="yearP + minYear - 1">
{{ yearP + minYear - 1 }}
</b-form-select-option>
</b-form-select>
<span class="input-group-text px-2"></span>
<b-form-select v-model="selectedMonth" class="text-center">
<b-form-select-option v-for="month in 12" :key="month" :value="month">
{{ month }}
</b-form-select-option>
</b-form-select>
<span class="input-group-text px-2"></span>
</div>
</div>
<div class="col-3 col-md-2 d-grid">
<b-button @click="submit">
{{ commandName }}
</b-button>
</div>
</div>
</div>
<BottomBar :title="commandName" type="chief" />
</template>
<script lang="ts">
declare const staticValues: {
serverNick: string;
serverID: string;
mapName: string;
commandName: string;
};
declare const procRes: {
nationList: procNationList;
startYear: number;
minYear: number;
maxYear: number;
month: number;
};
declare const getCityPosition: () => CityPositionMap;
declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed;
</script>
<script lang="ts" setup>
import MapViewer, { type CityPositionMap, type MapCityParsed, type MapCityParsedRaw } from "@/components/MapViewer.vue";
import SelectNation from "@/processing/SelectNation.vue";
import { ref, watch, onMounted, provide } from "vue";
import { unwrap } from "@/util/unwrap";
import type { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
import { getProcSearchable, type procNationItem, type procNationList } from "../processingRes";
import type { MapResult } from "@/defs";
import { SammoAPI } from "@/SammoAPI";
import { getGameConstStore, type GameConstStore } from "@/GameConstStore";
const serverNick = staticValues.serverNick;
const serverID = staticValues.serverID;
const cityPosition = getCityPosition();
const formatCityInfoText = formatCityInfo;
const imagePath = window.pathConfig.gameImage;
const asyncReady = ref<boolean>(false);
const gameConstStore = ref<GameConstStore>();
provide("gameConstStore", gameConstStore);
const storeP = getGameConstStore().then((store) => {
gameConstStore.value = store;
});
void Promise.all([storeP]).then(() => {
asyncReady.value = true;
});
const nationList = new Map<number, procNationItem>();
for (const nationItem of procRes.nationList) {
nationList.set(nationItem.id, nationItem);
}
const selectedNationID = ref(procRes.nationList[0].id);
const map = ref<MapResult>();
const minYear = procRes.minYear;
const maxYear = procRes.maxYear;
const selectedYear = ref(procRes.minYear);
const selectedMonth = ref(procRes.month);
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
destNationID: selectedNationID.value,
year: selectedYear.value,
month: selectedMonth.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
const searchable = getProcSearchable();
const selectedCityObj = ref<MapCityParsed>();
const commandName = ref(staticValues.commandName);
watch(selectedCityObj, (city?: MapCityParsed) => {
if (city === undefined) {
return;
}
if (city.nationID === undefined) {
return;
}
selectedNationID.value = city.nationID;
});
onMounted(async () => {
try {
map.value = await SammoAPI.Global.GetMap({ neutralView: 0, showMe: 1 });
} catch (e) {
console.error(e);
}
});
</script>
<style lang="scss" scoped>
.selectedYear {
width: 32%;
}
</style>
@@ -0,0 +1,165 @@
<template>
<TopBackBar v-model:searchable="searchable" :title="commandName" type="chief" />
<div v-if="asyncReady" class="bg0">
<MapViewer
v-if="map"
v-model="selectedCityObj"
:server-nick="serverNick"
:serverID="serverID"
:map-name="unwrap(gameConstStore?.gameConst.mapName)"
:mapData="map"
:isDetailMap="false"
:cityPosition="cityPosition"
:formatCityInfo="formatCityInfoText"
:image-path="imagePath"
/>
<div>
선택된 국가에 피장파장을 발동합니다.<br />
지정한 전략을 상대국이
{{ delayCnt }} 동안 사용할 없게됩니다.<br />
대신 아국은 지정한 전략을 {{ postReqTurn }} 동안 사용할 없습니다.<br />
선포, 전쟁중인 상대국에만 가능합니다.<br />
상대 국가를 목록에서 선택하세요.<br />
현재 피장파장이 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div class="row gx-3">
<div class="col-5 col-md-3">
국가 :
<SelectNation v-model="selectedNationID" :nations="nationList" :searchable="searchable" />
</div>
<div class="col-4 col-md-2">
<label>전략 :</label>
<select
v-model="selectedCommandID"
class="form-control"
:style="{
color: availableCommandTypeList[selectedCommandID].remainTurn > 0 ? 'red' : undefined,
}"
>
<option
v-for="(command, commandRawName) in availableCommandTypeList"
:key="commandRawName"
:value="commandRawName"
:style="{
color: command.remainTurn > 0 ? 'red' : 'black',
}"
>
{{ command.name }} {{ command.remainTurn > 0 ? `(불가, ${command.remainTurn}턴)` : "" }}
</option>
</select>
</div>
<div class="col-3 col-md-2 d-grid">
<b-button @click="submit">
{{ commandName }}
</b-button>
</div>
</div>
</div>
<BottomBar :title="commandName" type="chief" />
</template>
<script lang="ts">
declare const staticValues: {
serverNick: string;
serverID: string;
mapName: string;
commandName: string;
};
declare const procRes: {
nationList: procNationList;
startYear: number;
delayCnt: number;
postReqTurn: number;
availableCommandTypeList: Record<
string,
{
name: string;
remainTurn: number;
}
>;
};
declare const getCityPosition: () => CityPositionMap;
declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed;
</script>
<script lang="ts" setup>
import MapViewer, { type CityPositionMap, type MapCityParsed, type MapCityParsedRaw } from "@/components/MapViewer.vue";
import SelectNation from "@/processing/SelectNation.vue";
import { ref, watch, onMounted, provide } from "vue";
import { unwrap } from "@/util/unwrap";
import type { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
import { getProcSearchable, type procNationItem, type procNationList } from "../processingRes";
import type { MapResult } from "@/defs";
import { SammoAPI } from "@/SammoAPI";
import { getGameConstStore, type GameConstStore } from "@/GameConstStore";
const serverNick = staticValues.serverNick;
const serverID = staticValues.serverID;
const cityPosition = getCityPosition();
const formatCityInfoText = formatCityInfo;
const imagePath = window.pathConfig.gameImage;
const asyncReady = ref<boolean>(false);
const gameConstStore = ref<GameConstStore>();
provide("gameConstStore", gameConstStore);
const storeP = getGameConstStore().then((store) => {
gameConstStore.value = store;
});
void Promise.all([storeP]).then(() => {
asyncReady.value = true;
});
const nationList = new Map<number, procNationItem>();
for (const nationItem of procRes.nationList) {
nationList.set(nationItem.id, nationItem);
}
const selectedNationID = ref(procRes.nationList[0].id);
const map = ref<MapResult>();
const delayCnt = procRes.delayCnt;
const postReqTurn = procRes.postReqTurn;
const availableCommandTypeList = procRes.availableCommandTypeList;
const selectedCommandID = ref(Object.keys(availableCommandTypeList)[0]);
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
destNationID: selectedNationID.value,
commandType: selectedCommandID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
const searchable = getProcSearchable();
const selectedCityObj = ref<MapCityParsed>();
const commandName = ref(staticValues.commandName);
watch(selectedCityObj, (city?: MapCityParsed) => {
if (city === undefined) {
return;
}
if (city.nationID === undefined) {
return;
}
selectedNationID.value = city.nationID;
});
onMounted(async () => {
try {
map.value = await SammoAPI.Global.GetMap({ neutralView: 0, showMe: 1 });
} catch (e) {
console.error(e);
}
});
</script>
+36
View File
@@ -0,0 +1,36 @@
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 ProcessNation } from "../ProcessNation.vue";
import { default as ProcessGeneralAmount } from "../ProcessGeneralAmount.vue";
import { default as ProcessGeneralCity } from "./che_발령.vue";
import { default as ProcessCity } from "../ProcessCity.vue";
export const commandMap: Record<string, typeof ProcessNation | typeof ProcessCity> = {
che_국기변경,
che_국호변경,
che_급습: ProcessNation,
che_몰수: ProcessGeneralAmount,
che_물자원조,
che_발령: ProcessGeneralCity,
che_백성동원: ProcessCity,
che_불가침제의,
che_불가침파기제의: ProcessNation,
che_선전포고: ProcessNation,
che_수몰: ProcessCity,
che_이호경식: ProcessNation,
che_종전제의: ProcessNation,
che_천도: ProcessCity,
che_초토화: ProcessCity,
che_포상: ProcessGeneralAmount,
che_피장파장,
che_허보: ProcessCity,
}
/*
- 항목들
고유 양식 - 불가침제의
*/