Skip to content

Commit

Permalink
SI regions in dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Nov 7, 2024
1 parent ecda010 commit 12a050c
Showing 1 changed file with 39 additions and 8 deletions.
47 changes: 39 additions & 8 deletions src/module/vue/sf-locationsheet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@
>
<span class="select-label">{{ $t('IRONSWORN.Region') }}</span>
<select v-model="region" @change="regionChanged">
<option value="terminus">
{{ $t('IRONSWORN.REGION.Terminus') }}
</option>
<option value="outlands">
{{ $t('IRONSWORN.REGION.Outlands') }}
</option>
<option value="expanse">
{{ $t('IRONSWORN.REGION.Expanse') }}
<option v-for="r in regions" value="r.value">
{{ $t(r.label) }}
</option>
</select>
</label>
Expand Down Expand Up @@ -157,6 +151,7 @@ import { IdParser } from '../datasworn2'
import MceEditor from './components/mce-editor.vue'
import SheetBasic from './sheet-basic.vue'
import IronBtn from './components/buttons/iron-btn.vue'
import { IronswornSettings } from '../helpers/settings'
const props = defineProps<{
data: { actor: ActorSource<'location'> }
Expand All @@ -174,6 +169,42 @@ const state = reactive({
firstLookHighlight: false
})
const regions: { label: string; value: string }[] = []
for (const ruleset of IronswornSettings.enabledRulesets) {
if (ruleset === 'starforged') {
regions.push(
{
label: game.i18n.localize('IRONSWORN.REGION.Terminus'),
value: 'terminus'
},
{
label: game.i18n.localize('IRONSWORN.REGION.Outlands'),
value: 'outlands'
},
{
label: game.i18n.localize('IRONSWORN.REGION.Expanse'),
value: 'expanse'
}
)
}
if (ruleset === 'sundered_isles') {
regions.push(
{
label: game.i18n.localize('IRONSWORN.REGION.Myriads'),
value: 'myriads'
},
{
label: game.i18n.localize('IRONSWORN.REGION.Margins'),
value: 'margins'
},
{
label: game.i18n.localize('IRONSWORN.REGION.Reaches'),
value: 'reaches'
}
)
}
}
function randomImage(subtype, klass): string | void {
if (subtype === 'planet') {
const name = klass.capitalize()
Expand Down

0 comments on commit 12a050c

Please sign in to comment.