File: common.lua

package info (click to toggle)
openmw 0.50.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,076 kB
  • sloc: cpp: 380,958; xml: 2,192; sh: 1,449; python: 911; makefile: 26; javascript: 5
file content (41 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local async = require('openmw.async')
local storage = require('openmw.storage')
local I = require('openmw.interfaces')

local combatGroup = 'SettingsOMWCombat'

return {
    registerSettingsPage = function()
        I.Settings.registerPage({
          key = 'OMWCombat',
          l10n = 'OMWCombat',
          name = 'Combat',
          description = 'combatSettingsPageDescription',
        })
    end,
    registerSettingsGroup = function()
        local function boolSetting(key, default)
            return {
                key = key,
                renderer = 'checkbox',
                name = key,
                description = key..'Description',
                default = default,
            }
        end

        I.Settings.registerGroup({
            key = combatGroup,
            page = 'OMWCombat',
            l10n = 'OMWCombat',
            name = 'combatSettings',
            permanentStorage = false,
            order = 0,
            settings = {
                boolSetting('unarmedCreatureAttacksDamageArmor', false),
                boolSetting('redistributeShieldHitsWhenNotWearingShield', false),
                boolSetting('spawnBloodEffectsOnPlayer', false),
            },
        })
    end,
}