Skip to content

Commit

Permalink
Fix monster AI aside not displaying data inside decision groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damnae committed Feb 1, 2024
1 parent d88485a commit b79a054
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 15 deletions.
26 changes: 26 additions & 0 deletions src/gamecore/tasks/AIDecisionConfig.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import AnyTask from '../AnyTask.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DecisionName:string
RootTask:GamecoreTask
}
</script>

<template>
<BlockLayout :source="node">

Decision <em>{{ node.DecisionName }}</em>
<template #content>
<AnyTask :node="node.RootTask" />
</template>

</BlockLayout>
</template>

<style scoped>
</style>
26 changes: 26 additions & 0 deletions src/gamecore/tasks/AIStepperDecisionGroupConfig.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import AnyTask from '../AnyTask.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DecisionGroupName:string
DecisionList:GamecoreTask[]
}
</script>

<template>
<BlockLayout :source="node">

<span class="flow">Group <em>{{ node.DecisionGroupName }}</em></span>
<template #content>
<AnyTask v-for="decision in node.DecisionList" :node="decision" />
</template>

</BlockLayout>
</template>

<style scoped>
</style>
11 changes: 1 addition & 10 deletions src/sources/characterai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,11 @@ export interface AIVariable
Name:string
}

export interface AIDecision
{
$type:string
DecisionName:string
ScoreEvaluatorType:string
ConsiderAxisList:GamecoreTask[]
RootTask?:GamecoreTask
}

export interface CharacterAI
{
AIName: string
VariableList: AIVariable[]
DecisionList: AIDecision[]
DecisionList: GamecoreTask[]
}

export async function getCharacterAIByMonster(commitId:string, monster:Monster) : Promise<CharacterAI>
Expand Down
6 changes: 1 addition & 5 deletions src/views/aside/MonsterAI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@

<h2>Decisions</h2>
<div v-for="decision in characterAI.DecisionList">
<h3>{{ decision.DecisionName }}</h3>
<div v-for="axis in decision.ConsiderAxisList">
<AnyTask :node="axis" />
</div>
<AnyTask v-if="decision.RootTask != undefined" :node="decision.RootTask" />
<AnyTask :node="decision" />
</div>

<template v-if="skillSequence.length > 0">
Expand Down

0 comments on commit b79a054

Please sign in to comment.