Record original-alignment implementation and traceability checkpoint
Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
This commit is contained in:
@@ -3,6 +3,7 @@ extends RefCounted
|
||||
|
||||
## Small, code-native room furnishings. Coordinates use the same pixel size as
|
||||
## Kenney's 16 px sprites. This renderer never changes simulation state.
|
||||
const Layout := preload("res://scripts/ui/room_presentation.gd")
|
||||
const INK := Color("34413b")
|
||||
const WOOD := Color("8e6348")
|
||||
const WOOD_LIGHT := Color("c39665")
|
||||
@@ -15,7 +16,7 @@ static func tile(canvas: CanvasItem, texture: Texture2D, index: int, target: Rec
|
||||
canvas.draw_texture_rect_region(texture, target, Rect2((index % 12) * 16, (index / 12) * 16, 16, 16), tint)
|
||||
|
||||
|
||||
static func room(canvas: CanvasItem, rect: Rect2, id: StringName, pixel: float, dungeon: Texture2D, town: Texture2D, back: bool, decoration_seed := 0) -> void:
|
||||
static func room(canvas: CanvasItem, rect: Rect2, id: StringName, pixel: float, dungeon: Texture2D, town: Texture2D, back: bool, decoration_seed := 0, presentation: Dictionary = {}) -> void:
|
||||
var p := pixel
|
||||
if id in [&"guest_stairs", &"service_stairs"]:
|
||||
stairs(canvas, rect, p, id == &"service_stairs")
|
||||
@@ -69,17 +70,14 @@ static func room(canvas: CanvasItem, rect: Rect2, id: StringName, pixel: float,
|
||||
counter(canvas, Vector2(mid-9*p, floor_y-6*p), 18*p, p)
|
||||
canvas.draw_rect(Rect2(mid-6*p, floor_y-8*p, 4*p, 2*p), CREAM)
|
||||
canvas.draw_rect(Rect2(mid+4*p, floor_y-8*p, 2*p, 2*p), Color("d6ad52"))
|
||||
&"standard_room", &"adult_private_room":
|
||||
bed(canvas, Vector2(rect.position.x+2*p, floor_y-9*p), p, Color("709b94") if not dark else Color("a37b91"),13)
|
||||
if w >= 28*p:
|
||||
bed(canvas, Vector2(rect.end.x-15*p, floor_y-9*p), p, Color("709b94") if not dark else Color("a37b91"),13)
|
||||
&"standard_room", &"premium_room", &"staff_dormitory", &"adult_private_room", &"infirmary":
|
||||
for at: Vector2 in Layout.slots(rect, p, id):
|
||||
bed(canvas, at + Vector2(-7, -9)*p, p, Color("709b94") if not dark else Color("a37b91"), 13)
|
||||
&"cafeteria", &"tavern":
|
||||
for x in range(int(rect.position.x+5*p), int(rect.end.x-13*p), int(20*p)):
|
||||
table(canvas, Vector2(x, floor_y-7*p), p)
|
||||
if rect.size.y > 28*p:
|
||||
counter(canvas, Vector2(rect.position.x+7*p, top+13*p), w-14*p, p)
|
||||
for x in range(int(rect.position.x+10*p), int(rect.end.x-8*p), int(12*p)):
|
||||
canvas.draw_rect(Rect2(x, top+11*p, 3*p, 2*p), CREAM)
|
||||
for at: Vector2 in Layout.slots(rect, p, id):
|
||||
table(canvas, at + Vector2(-2, -7)*p, p)
|
||||
&"chapel":
|
||||
chapel_furnishings(canvas, rect, p)
|
||||
&"public_bath":
|
||||
canvas.draw_rect(Rect2(rect.position.x+4*p, floor_y-7*p, w-8*p, 7*p), CREAM)
|
||||
canvas.draw_rect(Rect2(rect.position.x+6*p, floor_y-6*p, w-12*p, 4*p), Color("72b6b8"))
|
||||
@@ -92,6 +90,15 @@ static func room(canvas: CanvasItem, rect: Rect2, id: StringName, pixel: float,
|
||||
&"warehouse":
|
||||
for x in range(int(rect.position.x+2*p), int(rect.end.x-12*p), int(13*p)):
|
||||
tile(canvas, dungeon, 63, Rect2(x, floor_y-12*p, 12*p, 12*p))
|
||||
&"cleaning_room":
|
||||
# Original code-drawn supply rack, mop and bucket; existing palette.
|
||||
counter(canvas, Vector2(rect.position.x+3*p, floor_y-10*p), 10*p, p)
|
||||
for shelf in 2:
|
||||
canvas.draw_rect(Rect2(rect.position.x+4*p,floor_y-(12+3*shelf)*p,8*p,2*p),CREAM)
|
||||
canvas.draw_rect(Rect2(mid+3*p,floor_y-16*p,p,14*p),WOOD_LIGHT)
|
||||
canvas.draw_rect(Rect2(mid+p,floor_y-3*p,6*p,2*p),CREAM)
|
||||
canvas.draw_rect(Rect2(rect.end.x-9*p,floor_y-6*p,5*p,5*p),TEAL)
|
||||
canvas.draw_rect(Rect2(rect.end.x-8*p,floor_y-7*p,3*p,p),INK)
|
||||
&"staff_waiting_room":
|
||||
table(canvas, Vector2(mid-6*p, floor_y-7*p), p)
|
||||
tile(canvas, dungeon, 89, Rect2(rect.position.x+2*p, floor_y-12*p, 12*p, 12*p))
|
||||
@@ -103,9 +110,65 @@ static func room(canvas: CanvasItem, rect: Rect2, id: StringName, pixel: float,
|
||||
_:
|
||||
table(canvas, Vector2(mid-6*p, floor_y-7*p), p)
|
||||
|
||||
if not presentation.is_empty():
|
||||
if rect.size.y >= 40*p and id != &"chapel":
|
||||
var workers: Array = presentation.get(&"staff", [])
|
||||
var columns := maxi(int(w / (16*p)), 1)
|
||||
if not workers.is_empty():
|
||||
canvas.draw_rect(Rect2(rect.position.x+p,top+24*p,w-2*p,p), WOOD_LIGHT)
|
||||
for slot: int in mini(workers.size(), columns):
|
||||
counter(canvas, Vector2(rect.position.x+(slot+0.5)*w/columns-6*p, top+20*p), 12*p, p)
|
||||
|
||||
var operation := int(presentation[&"operation"])
|
||||
if operation != FacilityInstance.OperationState.OPERATING:
|
||||
canvas.draw_rect(rect.grow(-p), Color(0.12, 0.16, 0.18, 0.42))
|
||||
# A closed shutter differs in shape as well as colour from an open room.
|
||||
for y: int in range(int(top+10*p), int(top+17*p), maxi(int(3*p), 1)):
|
||||
canvas.draw_rect(Rect2(rect.position.x+2*p, y, w-4*p, p), WOOD)
|
||||
if operation == FacilityInstance.OperationState.SUSPENDED:
|
||||
canvas.draw_line(rect.position+Vector2(3,10)*p, rect.end-Vector2(3,5)*p, Color("ca9c62"), 2*p)
|
||||
canvas.draw_line(Vector2(rect.end.x-3*p,top+10*p), Vector2(rect.position.x+3*p,rect.end.y-5*p), Color("ca9c62"), 2*p)
|
||||
elif int(presentation[&"count"]) > 0:
|
||||
canvas.draw_rect(Rect2(lamp_x-2*p, top+5*p, 4*p, 2*p), Color("ffe9a8"))
|
||||
|
||||
|
||||
|
||||
## The upper landing owns a short flight down to the floor below. Six square
|
||||
## treads and a stepped handrail keep the shape legible at the 16 px room scale.
|
||||
static func chapel_furnishings(canvas: CanvasItem, rect: Rect2, p: float) -> void:
|
||||
# Two rows share the live visitor anchors. Keep the central aisle clear;
|
||||
# the altar and world-tree glass occupy the otherwise unused upper wall.
|
||||
var mid := rect.get_center().x
|
||||
var top := rect.position.y
|
||||
canvas.draw_rect(Rect2(mid-6*p,top+3*p,12*p,19*p), INK)
|
||||
canvas.draw_rect(Rect2(mid-5*p,top+4*p,10*p,17*p), Color("6c8993"))
|
||||
canvas.draw_rect(Rect2(mid-4*p,top+6*p,8*p,13*p), Color("adc5b4"))
|
||||
canvas.draw_rect(Rect2(mid-p,top+9*p,2*p,10*p), WOOD)
|
||||
for row in 3:
|
||||
var width := float(row+1)*2*p
|
||||
canvas.draw_rect(Rect2(mid-width/2,top+(6+row*3)*p,width,3*p), Color("52836c"))
|
||||
canvas.draw_rect(Rect2(mid-p,top+5*p,2*p,p), Color("edc97c"))
|
||||
var altar_y := top+28*p
|
||||
counter(canvas,Vector2(mid-9*p,altar_y),18*p,p)
|
||||
canvas.draw_rect(Rect2(mid-9*p,altar_y,18*p,2*p), CREAM)
|
||||
canvas.draw_rect(Rect2(mid-2*p,altar_y+2*p,4*p,4*p), TEAL)
|
||||
for direction in [-1,1]:
|
||||
canvas.draw_rect(Rect2(mid+direction*6*p,altar_y-3*p,p,3*p), CREAM)
|
||||
canvas.draw_rect(Rect2(mid+direction*6*p,altar_y-4*p,p,p), Color("edc97c"))
|
||||
var rows: Dictionary = {}
|
||||
for at: Vector2 in Layout.slots(rect,p,&"chapel"):
|
||||
rows[at.y] = true
|
||||
for y: float in rows:
|
||||
for side in 2:
|
||||
var x := rect.position.x+3*p if side==0 else mid+3*p
|
||||
var width := rect.size.x/2-6*p
|
||||
canvas.draw_rect(Rect2(x,y-8*p,width,5*p), WOOD)
|
||||
canvas.draw_rect(Rect2(x,y-8*p,width,p), WOOD_LIGHT)
|
||||
canvas.draw_rect(Rect2(x-p,y-3*p,width+2*p,2*p), WOOD_LIGHT)
|
||||
canvas.draw_rect(Rect2(x,y-p,p,p), INK)
|
||||
canvas.draw_rect(Rect2(x+width-p,y-p,p,p), INK)
|
||||
|
||||
|
||||
static func stairs(canvas: CanvasItem, rect: Rect2, p: float, staff_only: bool, compact := false) -> void:
|
||||
if not compact:
|
||||
canvas.draw_rect(rect, INK)
|
||||
|
||||
Reference in New Issue
Block a user