feat(VoxelGrid): add BTL-OFF rung to V-GRID setting
V-GRID now cycles OFF / ON / BTL-OFF. BTL-OFF keeps the wireframe off during battles while leaving it available in the overworld. ON preserves the original behaviour (wireframe forced on in battles regardless of the row).
This commit is contained in:
+10
-3
@@ -59,7 +59,7 @@ end
|
||||
|
||||
-- where it persists and the rows that cycle it (see ModSetting)
|
||||
VoxelGrid.setting = ModSetting.new(VoxelGrid.KEY, VoxelGrid.LABEL,
|
||||
{ false, true }, { "OFF", "ON" })
|
||||
{ false, true, "btloff" }, { "OFF", "ON", "BTL-OFF" })
|
||||
|
||||
-- The row is the whole answer, everywhere: free-roam and the battle arena
|
||||
-- alike. The battle used to force the seams on regardless -- a fight is a
|
||||
@@ -68,7 +68,14 @@ VoxelGrid.setting = ModSetting.new(VoxelGrid.KEY, VoxelGrid.LABEL,
|
||||
-- whole mod, and a mode that came back for every fight read as the row not
|
||||
-- working rather than as a deliberate framing.
|
||||
function VoxelGrid.enabled()
|
||||
return VoxelGrid.setting:get() and true or false
|
||||
if VoxelGrid.override ~= nil then return VoxelGrid.override end
|
||||
local v = VoxelGrid.setting:get()
|
||||
if v == "btloff" then return false end
|
||||
return v and true or false
|
||||
end
|
||||
|
||||
function VoxelGrid.battleForced()
|
||||
return VoxelGrid.setting:get() ~= "btloff"
|
||||
end
|
||||
|
||||
function VoxelGrid.set(enabled, game)
|
||||
@@ -80,7 +87,7 @@ function VoxelGrid.toggle(game)
|
||||
end
|
||||
|
||||
function VoxelGrid.sync(value)
|
||||
VoxelGrid.setting:sync(value and true or false)
|
||||
VoxelGrid.setting:sync(value)
|
||||
end
|
||||
|
||||
function VoxelGrid.row()
|
||||
|
||||
Reference in New Issue
Block a user