Skip to content

Commit

Permalink
Fix dynamic key display.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damnae committed Oct 25, 2024
1 parent 8675a75 commit 3639fe2
Show file tree
Hide file tree
Showing 31 changed files with 118 additions and 167 deletions.
26 changes: 26 additions & 0 deletions src/gamecore/DynamicKey.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import useHashStore from '@/common/hashstore';
const props = defineProps<{dynamicKey:string|{Value:string}, contextScope?:string}>()
if (typeof(props.dynamicKey) == 'string')
useHashStore().register(props.dynamicKey, true)
else if (typeof(props.dynamicKey) == 'object')
useHashStore().register(props.dynamicKey.Value, true)
</script>

<template>
<em v-if="contextScope">{{ contextScope }}.</em>
<template v-if="typeof(dynamicKey) == 'string'">
<em>{{ dynamicKey }}</em>
</template>
<template v-else-if="typeof(dynamicKey) == 'object'">
<em>{{ dynamicKey.Value }}</em>
</template>
<template v-else>
<em>?{{ dynamicKey }}?</em>
</template>
</template>

<style scoped>
</style>
2 changes: 1 addition & 1 deletion src/gamecore/ModifierLink.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { inject } from 'vue';
defineProps<{modifierName?:string|{Value:string}}>()
defineProps<{modifierName:string|{Value:string}}>()
const createModifierRoute = inject<(key:string) => object>('createModifierRoute') as (key:string) => object
</script>
Expand Down
7 changes: 2 additions & 5 deletions src/gamecore/tasks/ByCompareDynamicValue.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, DynamicExpression, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -14,9 +14,6 @@
CompareType:string
CompareValue:DynamicExpression
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

<template>
Expand All @@ -25,7 +22,7 @@
<template v-if="node.TargetType">
<em><EvaluateTargetType :target="node.TargetType" /></em>'s
</template>
<em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.DynamicKey }}</em> is
<DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" /> is
<em>{{ node.CompareType }}</em> to
<em><EvaluateExpression :expression="node.CompareValue" /></em>

Expand Down
5 changes: 3 additions & 2 deletions src/gamecore/tasks/DefineDynamicValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { GamecoreTask, GamecoreTargetType, DynamicExpression, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -17,7 +18,7 @@ import EvaluateTargetType from '../EvaluateTargetType.vue';
<template>
<BlockLayout :source="node">

Define <em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.DynamicKey }}</em>
Define <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />
<template v-if="node.TargetType">
on <em><EvaluateTargetType :target="node.TargetType" /></em>
</template>
Expand Down
11 changes: 3 additions & 8 deletions src/gamecore/tasks/RandomSelectDynamicValue.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<script setup lang="ts">
import { GamecoreTask,
DynamicExpression,
} from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import { GamecoreTask, DynamicExpression, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -13,15 +11,12 @@
ContextScope:string
ValueList?:DynamicExpression[]
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.DynamicKey }}</em>
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />
to a random value in
<template v-for="value in node.ValueList">
<em><EvaluateExpression :expression="value" /></em>,
Expand Down
7 changes: 2 additions & 5 deletions src/gamecore/tasks/SetDynamicValue.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { GamecoreTask, DynamicExpression, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -11,15 +11,12 @@
ContextScope:string
Value?:DynamicExpression
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.DynamicKey }}</em>
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />
to <em><EvaluateExpression :expression="node.Value" /></em>

</BlockLayout>
Expand Down
7 changes: 2 additions & 5 deletions src/gamecore/tasks/SetDynamicValueByAddValue.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, DynamicExpression, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import EvaluateExpression from '../EvaluateExpression.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -15,9 +15,6 @@
Min:DynamicExpression
Max:DynamicExpression
}
if (node.Key)
useHashStore().register(node.Key, true)
</script>

<template>
Expand All @@ -29,7 +26,7 @@
<template v-if="node.TargetType">
<em><EvaluateTargetType :target="node.TargetType" /></em>'s
</template>
<em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.Key }}</em>,
<DynamicKey :dynamicKey="node.Key" :contextScope="node.ContextScope" />,
clamp between <em><EvaluateExpression :expression="node.Min" /></em>
and <em><EvaluateExpression :expression="node.Max" /></em>

Expand Down
7 changes: 2 additions & 5 deletions src/gamecore/tasks/SetDynamicValueByAttackDamageData.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -11,15 +11,12 @@
DynamicKey:string
ContextScope:string
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.DynamicKey }}</em>
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />

to
<template v-if="node.ReadTargetType">
Expand Down
8 changes: 3 additions & 5 deletions src/gamecore/tasks/SetDynamicValueByBehaviorFlagCount.vue
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
ReadTargetType?:GamecoreTargetType
DynamicKey:string
ContextScope:string
BehaviorFlag:string
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em>{{ node.DynamicKey }}</em>
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />

to
<template v-if="node.ReadTargetType">
Expand Down
8 changes: 3 additions & 5 deletions src/gamecore/tasks/SetDynamicValueByBreakBaseDamage.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
ReadTargetType?:GamecoreTargetType
DynamicKey:string
ContextScope:string
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em>{{ node.DynamicKey }}</em>
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />

to
<template v-if="node.ReadTargetType">
Expand Down
11 changes: 4 additions & 7 deletions src/gamecore/tasks/SetDynamicValueByChangeValue.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<script setup lang="ts">
import { GamecoreTask,
} from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DynamicKey:string
ContextScope:string
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em>{{ node.DynamicKey }}</em> to the change value
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" /> to the change value

</BlockLayout>
</template>
Expand Down
8 changes: 3 additions & 5 deletions src/gamecore/tasks/SetDynamicValueByCharacterCount.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import AnyTask from '../AnyTask.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
ReadTargetType?:GamecoreTargetType
DynamicKey:string
ContextScope:string
Predicate?:GamecoreTask
AliveOnly?:boolean
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em>{{ node.DynamicKey }}</em>
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" />
to the {{ node.AliveOnly ? 'alive' : '' }} character count
<template v-if="node.ReadTargetType">
in <em><EvaluateTargetType :target="node.ReadTargetType" /></em>
Expand Down
11 changes: 3 additions & 8 deletions src/gamecore/tasks/SetDynamicValueByCopying.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { GamecoreTask, GamecoreTargetType, } from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import BlockLayout from '@/components/BlockLayout.vue';
import EvaluateTargetType from '../EvaluateTargetType.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
Expand All @@ -15,11 +15,6 @@
ContextScope:string
TargetContextScope:string
}
if (node.FromDynamicKey)
useHashStore().register(node.FromDynamicKey, true)
if (node.ToDynamicKey)
useHashStore().register(node.ToDynamicKey, true)
</script>

<template>
Expand All @@ -29,12 +24,12 @@
<template v-if="node.FromTargetType">
<em><EvaluateTargetType :target="node.FromTargetType" /></em>'s
</template>
<em v-if="node.TargetContextScope">{{ node.TargetContextScope }}.</em><em>{{ node.FromDynamicKey }}</em>
<DynamicKey :dynamicKey="node.FromDynamicKey" :contextScope="node.TargetContextScope" />
to
<template v-if="node.ToTargetType">
<em><EvaluateTargetType :target="node.ToTargetType" /></em>'s
</template>
<em v-if="node.ContextScope">{{ node.ContextScope }}.</em><em>{{ node.ToDynamicKey }}</em>
<DynamicKey :dynamicKey="node.ToDynamicKey" :contextScope="node.ContextScope" />

</BlockLayout>
</template>
Expand Down
11 changes: 4 additions & 7 deletions src/gamecore/tasks/SetDynamicValueByCurrentBP.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<script setup lang="ts">
import { GamecoreTask,
} from '@/sources/gamecore';
import useHashStore from '@/common/hashstore';
import { GamecoreTask, } from '@/sources/gamecore';
import BlockLayout from '@/components/BlockLayout.vue';
import DynamicKey from '@/gamecore/DynamicKey.vue';
const props = defineProps<{node:GamecoreTask}>()
const node = props.node as unknown as
{
DynamicKey:string
ContextScope:string
}
if (node.DynamicKey)
useHashStore().register(node.DynamicKey, true)
</script>

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

Set <em>{{ node.DynamicKey }}</em> to the current skill point count
Set <DynamicKey :dynamicKey="node.DynamicKey" :contextScope="node.ContextScope" /> to the current skill point count

</BlockLayout>
</template>
Expand Down
Loading

0 comments on commit 3639fe2

Please sign in to comment.