Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/AntiAlias.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ local AntiAlias = {}
-- the key under options.modOptions.DRAMATIC_SHAPE, shared by the row in
-- OPTIONS and the mod manager's own settings page for this mod
AntiAlias.KEY = "aa"
AntiAlias.LABEL = "AA"
AntiAlias.LABEL = "SMOOTHING"

-- The ladder is SAMPLES PER DISPLAY PIXEL, which is how an AA setting reads
-- everywhere else, and the canvas scale each rung costs is its square root:
Expand Down
2 changes: 1 addition & 1 deletion lib/OverworldBattle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ local DEBUG = select(2, pcall(function() return os.getenv("DS_BATTLE_DEBUG") end
if DEBUG == nil or DEBUG == false then DEBUG = nil end

OverworldBattle.KEY = "battles"
OverworldBattle.LABEL = "3D-BTL"
OverworldBattle.LABEL = "3D BATTLES"

-- On by default: a mod whose headline is "the world in 3D" should not need
-- the player to go and find the switch before the world shows up in a
Expand Down
2 changes: 1 addition & 1 deletion lib/TiltShift.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ local V = ...
local TiltShift = {}

TiltShift.level = 0
TiltShift.LABELS = { "OFF", "1", "2", "3" }
TiltShift.LABELS = { "OFF", "LIGHT", "MEDIUM", "STRONG" }

-- The strength ladder. `spacing` is the gap between the gaussian's taps
-- at full blur, as a fraction of the canvas height (so the miniature
Expand Down
2 changes: 1 addition & 1 deletion lib/VoxelGrid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local VoxelGrid = {}
-- the key under options.modOptions.DRAMATIC_SHAPE, shared by the row in
-- OPTIONS and the mod manager's own settings page for this mod
VoxelGrid.KEY = "grid"
VoxelGrid.LABEL = "V-GRID"
VoxelGrid.LABEL = "BLOCK EDGES"

-- How far toward black a seam pulls the surface it cuts across. The
-- wireframe reads as a shading of the model rather than an overlay drawn
Expand Down
4 changes: 2 additions & 2 deletions lib/WorldCurve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ local ModSetting = V.require("ModSetting")
local WorldCurve = {}

WorldCurve.KEY = "curve"
WorldCurve.LABEL = "V-CURVE"
WorldCurve.LABEL = "ROUND WORLD"

-- The ladder, calibrated against the FAR EDGE of the visible ground -- a
-- little over two view-heights out at the low camera rungs. Since the drop
Expand All @@ -60,7 +60,7 @@ WorldCurve.AMOUNTS = { 0, 0.05, 0.10, 0.18 }

WorldCurve.setting = ModSetting.new(WorldCurve.KEY, WorldCurve.LABEL,
{ 0, 1, 2, 3 },
{ "OFF", "1", "2", "3" })
{ "OFF", "LIGHT", "MEDIUM", "STRONG" })

function WorldCurve.level()
return WorldCurve.setting:get() or 0
Expand Down
4 changes: 2 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function voidFill.check()
end

mod.content.render_pipelines:register("voxel", {
label = "VOXEL",
label = "3D WORLD",
levels = Voxel.ANGLE_LABELS,
-- 3 is the engine's TILT key, which this mode supersedes -- see the
-- hotkey block near the bottom of this file for how it is claimed
Expand Down Expand Up @@ -292,7 +292,7 @@ mod.content.render_pipelines:register("voxel", {
})

mod.content.render_pipelines:register("tiltshift", {
label = "T-SHIFT",
label = "MINIATURE",
levels = TiltShift.LABELS,
-- 6 is free: no engine branch claims it, so this one alone reaches the
-- registry by the documented route
Expand Down
24 changes: 12 additions & 12 deletions tests/dramatic_shape_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ T.check(type(defs) == "table", "the merge created the render_pipelines namespace
T.check(type(defs.voxel) == "table", "the voxel pipeline is registered")
T.check(type(defs.tiltshift) == "table", "the tiltshift pipeline is registered")

T.eq(defs.voxel.label, "VOXEL", "voxel carries its options-row label")
T.eq(defs.tiltshift.label, "T-SHIFT", "tiltshift carries its options-row label")
T.eq(defs.voxel.label, "3D WORLD", "voxel carries its options-row label")
T.eq(defs.tiltshift.label, "MINIATURE", "tiltshift carries its options-row label")
T.eq(defs.voxel.hotkey, "3", "voxel claims hotkey 3")
T.eq(defs.tiltshift.hotkey, "6", "tiltshift claims hotkey 6")
T.check(type(defs.voxel.drawWorld) == "function",
Expand Down Expand Up @@ -103,9 +103,9 @@ local rows = Pipelines.rows({ save = { options = opts } })
T.eq(#rows, 2, "each pipeline contributes exactly one options row")
local byLabel = {}
for _, row in ipairs(rows) do byLabel[row.label] = row end
T.check(byLabel.VOXEL ~= nil, "the VOXEL row is offered")
T.check(byLabel["T-SHIFT"] ~= nil, "the T-SHIFT row is offered")
T.eq(byLabel.VOXEL.value(), "FULL", "the row renders the current rung's label")
T.check(byLabel["3D WORLD"] ~= nil, "the 3D WORLD row is offered")
T.check(byLabel["MINIATURE"] ~= nil, "the T-SHIFT row is offered")
T.eq(byLabel["3D WORLD"].value(), "FULL", "the row renders the current rung's label")

-- ------- this mod's own settings
--
Expand Down Expand Up @@ -401,11 +401,11 @@ T.eq(water.value(), "SKY",
T.eq(daytime.label, "DAYTIME", "the day/night row carries its label")
T.eq(daytime.value(), "SYNC",
"and defaults to SYNC -- no value set follows the clock on the wall")
T.eq(grid.label, "V-GRID", "the grid row carries its label")
T.eq(grid.label, "BLOCK EDGES", "the grid row carries its label")
T.eq(grid.value(), "OFF", "the grid starts off")
T.eq(curve.label, "V-CURVE", "the curve row carries its label")
T.eq(curve.label, "ROUND WORLD", "the curve row carries its label")
T.eq(curve.value(), "OFF", "the curve starts off")
T.eq(battles.label, "3D-BTL", "the overworld-battle row carries its label")
T.eq(battles.label, "3D BATTLES", "the overworld-battle row carries its label")
T.eq(battles.value(), "ON",
"overworld battles are on by default -- the mode's headline is the world "
.. "in 3D, and a battle is where the player spends half the game")
Expand All @@ -429,18 +429,18 @@ T.eq(grid.value(), "OFF", "stepping again toggles it back")

-- the curve is a four-rung ladder rather than a toggle, and wraps
curve.step(settingGame, 1)
T.eq(curve.value(), "1", "stepping the curve climbs its ladder")
T.eq(curve.value(), "LIGHT", "stepping the curve climbs its ladder")
T.eq(settingGame.save.options.modOptions.DRAMATIC_SHAPE.curve, 1,
"the curve level persists alongside the grid, not over it")
T.eq(settingGame.save.options.modOptions.DRAMATIC_SHAPE.grid, false,
"and the grid it shares a bucket with is untouched")
curve.step(settingGame, 1)
curve.step(settingGame, 1)
T.eq(curve.value(), "3", "the ladder reaches its top rung")
T.eq(curve.value(), "STRONG", "the ladder reaches its top rung")
curve.step(settingGame, 1)
T.eq(curve.value(), "OFF", "and wraps back to OFF")
curve.step(settingGame, -1)
T.eq(curve.value(), "3", "stepping down from OFF wraps to the top")
T.eq(curve.value(), "STRONG", "stepping down from OFF wraps to the top")
curve.step(settingGame, 1)

-- the strength scales with the view height, so a rung looks the same at
Expand Down Expand Up @@ -481,7 +481,7 @@ local AntiAlias = run.loader.exports.DRAMATIC_SHAPE.lib.require("AntiAlias")
local VoxelGrid = run.loader.exports.DRAMATIC_SHAPE.lib.require("VoxelGrid")
local aaGame = { save = { options = {} }, mods = { modOptions = {} } }
local aa = hookedRows[8]
T.eq(aa.label, "AA", "the anti-aliasing row carries its label")
T.eq(aa.label, "SMOOTHING", "the anti-aliasing row carries its label")
T.eq(aa.value(), "OFF",
"and starts off -- supersampling is a cost knob, and a mod must not spend "
.. "four times the fill rate of the machine it lands on unasked")
Expand Down