feat: 세력장수에서 '휴식'의 '자율행동' 여부 판별
This commit is contained in:
@@ -130,7 +130,7 @@ class GeneralList extends \sammo\BaseAPI
|
||||
$db = DB::db();
|
||||
|
||||
$gameStor = \sammo\KVStorage::getStorage($db, 'game_env');
|
||||
$env = $gameStor->getValues(['year', 'month', 'turntime', 'turnterm']);
|
||||
$env = $gameStor->getValues(['year', 'month', 'turntime', 'turnterm', 'autorun_user', 'killturn']);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT con, turntime, belong, nation, officer_level, permission, penalty FROM general WHERE owner=%i', $session->getUserID());
|
||||
$con = checkLimit($me['con']);
|
||||
|
||||
@@ -42,6 +42,7 @@ const envVal = ref<GeneralListResponse["env"]>({
|
||||
month: 1,
|
||||
turnterm: 1,
|
||||
turntime: "2022-02-22 22:22:22.22222",
|
||||
killturn: 80,
|
||||
});
|
||||
|
||||
const toolbarID = "toolbar-id";
|
||||
|
||||
@@ -139,11 +139,11 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'generalClick', generalID: number): void
|
||||
(e: "generalClick", generalID: number): void;
|
||||
}>();
|
||||
|
||||
const suppressColumnMoveAnimation = ref(true);
|
||||
@@ -154,7 +154,7 @@ const validColumns = ref(new Set<string>());
|
||||
watch(
|
||||
() => props.list,
|
||||
(newValue) => {
|
||||
const newValidColumns = new Set<string>(['icon']);
|
||||
const newValidColumns = new Set<string>(["icon"]);
|
||||
if (newValue.length > 0) {
|
||||
for (const key of Object.keys(newValue[0])) {
|
||||
newValidColumns.add(key);
|
||||
@@ -327,9 +327,9 @@ function onGridReady(params: GridReadyEvent) {
|
||||
|
||||
function onCellClicked(event: CellClickedEvent) {
|
||||
const colID = event.column.getColId();
|
||||
if(colID === 'icon' || colID === 'name'){
|
||||
if (colID === "icon" || colID === "name") {
|
||||
const generalItem = event.data as GeneralListItem;
|
||||
emit('generalClick', generalItem.no);
|
||||
emit("generalClick", generalItem.no);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
return `<img src="${getIconPath(gen.imgsvr, gen.picture)}" width="64">`;
|
||||
},
|
||||
pinned: "left",
|
||||
cellClass: [props.availableGeneralClick?'clickable-cell':'', ...defaultCellClass],
|
||||
cellClass: [props.availableGeneralClick ? "clickable-cell" : "", ...defaultCellClass],
|
||||
lockPosition: true,
|
||||
},
|
||||
name: {
|
||||
@@ -523,7 +523,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
return style as CellStyle;
|
||||
},
|
||||
filterValueGetter: ({ data }) => convertSearch초성(data.name),
|
||||
cellClass: [props.availableGeneralClick?'clickable-cell':'', ...defaultCellClass],
|
||||
cellClass: [props.availableGeneralClick ? "clickable-cell" : "", ...defaultCellClass],
|
||||
filter: true,
|
||||
hide: false,
|
||||
lockVisible: true,
|
||||
@@ -702,7 +702,7 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
field: "troop",
|
||||
valueGetter: ({ data }: GenValueGetterParams) => {
|
||||
if (!data.st2) {
|
||||
return '?';
|
||||
return "?";
|
||||
}
|
||||
const troopInfo = extractTroopInfo(data);
|
||||
if (troopInfo === undefined) {
|
||||
@@ -934,7 +934,21 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
if (!commandList) {
|
||||
return "???";
|
||||
}
|
||||
return commandList.map(({ action }) => naiveCheClassNameFilter(action)).join("<br>");
|
||||
return commandList
|
||||
.map(({ action }) => {
|
||||
if (action !== "휴식" || data.npc >= 2) {
|
||||
return naiveCheClassNameFilter(action);
|
||||
}
|
||||
const limitMinutes = props.env.autorun_user?.limit_minutes ?? 0;
|
||||
if (!limitMinutes) {
|
||||
return naiveCheClassNameFilter(action);
|
||||
}
|
||||
if (data.killturn + limitMinutes > props.env.killturn) {
|
||||
return "자율행동";
|
||||
}
|
||||
return naiveCheClassNameFilter(action);
|
||||
})
|
||||
.join("<br>");
|
||||
},
|
||||
cellStyle: {
|
||||
lineHeight: "1em",
|
||||
@@ -954,7 +968,21 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>
|
||||
if (!commandList) {
|
||||
return "???";
|
||||
}
|
||||
return commandList.map(({ brief }) => brief).join("<br>");
|
||||
return commandList
|
||||
.map(({ action, brief }) => {
|
||||
if (action !== "휴식" || data.npc >= 2) {
|
||||
return brief;
|
||||
}
|
||||
const limitMinutes = props.env.autorun_user?.limit_minutes ?? 0;
|
||||
if (!limitMinutes) {
|
||||
return brief;
|
||||
}
|
||||
if (data.killturn + limitMinutes > props.env.killturn) {
|
||||
return "자율 행동";
|
||||
}
|
||||
return brief;
|
||||
})
|
||||
.join("<br>");
|
||||
},
|
||||
cellStyle: {
|
||||
lineHeight: "1em",
|
||||
|
||||
@@ -82,6 +82,11 @@ type ResponseEnv = {
|
||||
month: number,
|
||||
turntime: string,
|
||||
turnterm: number,
|
||||
killturn: number,
|
||||
autorun_user?: {
|
||||
limit_minutes: number,
|
||||
options: Record<string, number>,
|
||||
}
|
||||
}
|
||||
|
||||
export type RawGeneralListP0 = ValidResponse & {
|
||||
|
||||
Reference in New Issue
Block a user