Skip to content

Commit 8bee945

Browse files
committed
multi-line conoly region
1 parent 31b23f8 commit 8bee945

File tree

3 files changed

+45
-12
lines changed

3 files changed

+45
-12
lines changed

asset/gameplay/ui.dl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ track :
1111
focus_color : 0x2020FF
1212
desktop :
1313
focus_duration : 30
14+
colony_line : 5
15+
colony_line_spacing : 30
1416
card :
1517
mask_normal : 0x2000ff00
1618
mask_focus : 0x8000ff00

asset/test/noworld.dl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,31 @@ setup :
1515
type : blank
1616
---
1717
type : blank
18+
start :
19+
---
20+
to : colony
21+
type : world
22+
---
23+
to : colony
24+
type : world
25+
---
26+
to : colony
27+
type : world
28+
---
29+
to : colony
30+
type : world
31+
---
32+
to : colony
33+
type : world
34+
---
35+
to : colony
36+
type : world
37+
---
38+
to : colony
39+
type : world
40+
---
41+
to : colony
42+
type : world
43+
---
44+
to : colony
45+
type : world

visual/desktop.lua

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ local VTIPS = {}
2525
local FONT_ID
2626
local SPRITES
2727

28+
local CAMERA
29+
local DURATION <const> = ui.desktop.focus_duration * 2
30+
local COLONY_LINE <const> = ui.desktop.colony_line
31+
local COLONY_LINE_SPACING <const> = ui.desktop.colony_line_spacing
32+
local INV_DURATION <const> = 1 / DURATION
33+
local PI2 <const> = math.pi * 0.5
34+
local sin = math.sin
35+
2836
local M = {}
2937

3038
local desktop = {
@@ -76,14 +84,15 @@ do
7684
local scale = calc_scale(self, n)
7785
local offx = n <= 1 and 0 or (card_w * scale + 3)
7886
local x = 0
79-
for idx, obj in ipairs(r) do
87+
for i, obj in ipairs(r) do
88+
local idx = i % COLONY_LINE
89+
local offy = (i-1) // COLONY_LINE * COLONY_LINE_SPACING
90+
if idx == 1 then
91+
x = 0
92+
end
8093
obj.x = x
94+
obj.y = offy
8195
obj.scale = scale
82-
if idx > 3 then
83-
obj.focus_target.x = obj.x - card_w * (1-scale)
84-
else
85-
obj.focus_target.x = nil
86-
end
8796
obj.focus_target.scale = 1
8897
x = x + offx
8998
end
@@ -320,12 +329,6 @@ function M.describe(text)
320329
end
321330
end
322331

323-
local CAMERA
324-
local DURATION <const> = ui.desktop.focus_duration * 2
325-
local INV_DURATION <const> = 1 / DURATION
326-
local PI2 <const> = math.pi * 0.5
327-
local sin = math.sin
328-
329332
local function open_camera()
330333
local timeline = CAMERA.timeline + 1
331334
if timeline >= 0 then

0 commit comments

Comments
 (0)