Age briefing UI and terrain presentation
This commit is contained in:
@@ -103,6 +103,9 @@ const UI_SEAL_RED_DARK := Color(0.28, 0.020, 0.014, 1.0)
|
||||
const UI_CHARCOAL_WASH := Color(0.045, 0.026, 0.016, 1.0)
|
||||
const UI_SCROLL_CENTER := Color(0.74, 0.58, 0.32, 0.996)
|
||||
const UI_SCROLL_EDGE := Color(0.43, 0.25, 0.095, 0.996)
|
||||
const UI_OLD_SILK := Color(0.61, 0.43, 0.20, 0.997)
|
||||
const UI_BURNT_PAPER := Color(0.33, 0.19, 0.075, 0.996)
|
||||
const UI_BRUSH_RULE := Color(0.12, 0.060, 0.026, 0.98)
|
||||
const MAP_SCROLL_FRAME_PADDING := 12.0
|
||||
const SPEAKER_DISPLAY_NAMES := {
|
||||
"Cao Cao": "조조",
|
||||
@@ -452,17 +455,17 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
|
||||
var shadow_size := 6
|
||||
match variant:
|
||||
"paper":
|
||||
fill = Color(0.58, 0.39, 0.17, 0.997)
|
||||
border = UI_SCROLL_EDGE
|
||||
border_width = 9
|
||||
margin = 22
|
||||
shadow_size = 18
|
||||
fill = UI_BURNT_PAPER
|
||||
border = UI_BAMBOO_DARK
|
||||
border_width = 12
|
||||
margin = 18
|
||||
shadow_size = 24
|
||||
"edict":
|
||||
fill = Color(0.70, 0.55, 0.30, 0.997)
|
||||
border = UI_SCROLL_EDGE
|
||||
border_width = 6
|
||||
fill = Color(0.67, 0.49, 0.25, 0.998)
|
||||
border = UI_BRUSH_RULE
|
||||
border_width = 7
|
||||
margin = 16
|
||||
shadow_size = 7
|
||||
shadow_size = 9
|
||||
"edict_compact":
|
||||
fill = Color(0.66, 0.50, 0.27, 0.996)
|
||||
border = UI_SCROLL_EDGE
|
||||
@@ -491,17 +494,17 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
|
||||
border_width = 5
|
||||
margin = 3
|
||||
"dialogue":
|
||||
fill = Color(0.045, 0.018, 0.010, 0.998)
|
||||
border = UI_TARNISHED_BRONZE
|
||||
border_width = 9
|
||||
fill = Color(0.030, 0.012, 0.007, 0.998)
|
||||
border = UI_BAMBOO_DARK
|
||||
border_width = 11
|
||||
margin = 20
|
||||
shadow_size = 22
|
||||
shadow_size = 26
|
||||
"speech_scroll":
|
||||
fill = Color(0.70, 0.54, 0.29, 0.998)
|
||||
border = UI_SCROLL_EDGE
|
||||
border_width = 6
|
||||
fill = UI_OLD_SILK
|
||||
border = UI_BRUSH_RULE
|
||||
border_width = 7
|
||||
margin = 15
|
||||
shadow_size = 4
|
||||
shadow_size = 7
|
||||
"notice":
|
||||
fill = Color(0.070, 0.020, 0.014, 0.982)
|
||||
border = UI_SEAL_RED
|
||||
@@ -513,11 +516,11 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
|
||||
border_width = 5
|
||||
margin = 4
|
||||
"silk_map":
|
||||
fill = Color(0.54, 0.38, 0.18, 0.992)
|
||||
border = UI_SCROLL_EDGE
|
||||
border_width = 4
|
||||
fill = Color(0.45, 0.30, 0.13, 0.994)
|
||||
border = UI_BRUSH_RULE
|
||||
border_width = 5
|
||||
margin = 10
|
||||
shadow_size = 5
|
||||
shadow_size = 7
|
||||
"compact":
|
||||
fill = Color(0.058, 0.026, 0.014, 0.988)
|
||||
border = UI_TARNISHED_BRONZE
|
||||
@@ -537,11 +540,11 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
|
||||
margin = 5
|
||||
shadow_size = 2
|
||||
"result_tablet":
|
||||
fill = Color(0.54, 0.36, 0.15, 0.997)
|
||||
border = UI_SCROLL_EDGE
|
||||
border_width = 9
|
||||
fill = UI_BURNT_PAPER
|
||||
border = UI_BAMBOO_DARK
|
||||
border_width = 11
|
||||
margin = 20
|
||||
shadow_size = 16
|
||||
shadow_size = 22
|
||||
"command_seal":
|
||||
fill = Color(0.065, 0.020, 0.012, 0.992)
|
||||
border = UI_TARNISHED_BRONZE
|
||||
@@ -754,6 +757,36 @@ func _make_ink_wash_rule(width: float = 0.0, height: float = 7.0) -> HBoxContain
|
||||
return row
|
||||
|
||||
|
||||
func _make_edict_title_strip(labels: Array, width: float = 0.0, height: float = 24.0) -> HBoxContainer:
|
||||
var row := HBoxContainer.new()
|
||||
row.custom_minimum_size = Vector2(width, height)
|
||||
row.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
row.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
row.add_theme_constant_override("separation", 4)
|
||||
row.add_child(_make_lacquer_clasp(height))
|
||||
row.add_child(_make_binding_strip(5.0, UI_TARNISHED_BRONZE, 0.0))
|
||||
for label_text in labels:
|
||||
row.add_child(_make_seal_tile(str(label_text), height))
|
||||
row.add_child(_make_binding_strip(5.0, UI_TARNISHED_BRONZE, 0.0))
|
||||
row.add_child(_make_lacquer_clasp(height))
|
||||
return row
|
||||
|
||||
|
||||
func _make_seal_tile(text: String, size: float = 24.0) -> PanelContainer:
|
||||
var panel := PanelContainer.new()
|
||||
panel.custom_minimum_size = Vector2(size, size)
|
||||
panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
panel.add_theme_stylebox_override("panel", _make_panel_style(UI_SEAL_RED_DARK, UI_OLD_BRONZE, 2, 0, 3, 0))
|
||||
var label := Label.new()
|
||||
label.text = text
|
||||
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
label.custom_minimum_size = Vector2(size - 6.0, size - 6.0)
|
||||
_apply_label_style(label, UI_PARCHMENT_TEXT, 13)
|
||||
panel.add_child(label)
|
||||
return panel
|
||||
|
||||
|
||||
func _make_seal_ribbon(width: float = 0.0, height: float = 18.0) -> HBoxContainer:
|
||||
var row := HBoxContainer.new()
|
||||
row.custom_minimum_size = Vector2(width, height)
|
||||
@@ -1314,14 +1347,23 @@ func _create_hud() -> void:
|
||||
|
||||
briefing_panel = PanelContainer.new()
|
||||
briefing_panel.visible = false
|
||||
briefing_panel.position = Vector2(248, 52)
|
||||
briefing_panel.size = Vector2(784, 660)
|
||||
briefing_panel.position = Vector2(212, 16)
|
||||
briefing_panel.size = Vector2(856, 688)
|
||||
_apply_panel_style(briefing_panel, "paper")
|
||||
root.add_child(briefing_panel)
|
||||
|
||||
var briefing_shell := HBoxContainer.new()
|
||||
briefing_shell.custom_minimum_size = Vector2(800, 632)
|
||||
briefing_shell.add_theme_constant_override("separation", 10)
|
||||
briefing_panel.add_child(briefing_shell)
|
||||
briefing_shell.add_child(_make_bamboo_gutter(22, 632))
|
||||
|
||||
var briefing_column := VBoxContainer.new()
|
||||
briefing_column.add_theme_constant_override("separation", 7)
|
||||
briefing_panel.add_child(briefing_column)
|
||||
briefing_column.add_theme_constant_override("separation", 5)
|
||||
briefing_shell.add_child(briefing_column)
|
||||
briefing_shell.add_child(_make_bamboo_gutter(22, 632))
|
||||
briefing_column.add_child(_make_scroll_rod(680, 6))
|
||||
briefing_column.add_child(_make_edict_title_strip(["魏", "軍", "令"], 680, 24))
|
||||
briefing_column.add_child(_make_tablet_binding(680, 16))
|
||||
|
||||
var briefing_title_panel := PanelContainer.new()
|
||||
@@ -1347,8 +1389,8 @@ func _create_hud() -> void:
|
||||
_apply_label_style(briefing_location_label, UI_INK_WASH, 14)
|
||||
briefing_column.add_child(briefing_location_label)
|
||||
|
||||
briefing_column.add_child(_make_scroll_rod(680, 4))
|
||||
briefing_column.add_child(_make_section_caption("軍令 勝敗 죽간", 680))
|
||||
briefing_column.add_child(_make_scroll_rod(680, 5))
|
||||
briefing_column.add_child(_make_section_caption("軍令 · 勝敗之條", 680))
|
||||
|
||||
briefing_objective_panel = PanelContainer.new()
|
||||
briefing_objective_panel.custom_minimum_size = Vector2(680, 104)
|
||||
@@ -1371,8 +1413,8 @@ func _create_hud() -> void:
|
||||
briefing_objective_row.add_child(_make_edict_marker_stack(["軍", "功", "封"], 84))
|
||||
briefing_objective_row.add_child(_make_bamboo_gutter(18, 84))
|
||||
|
||||
briefing_column.add_child(_make_ink_wash_rule(680, 7))
|
||||
briefing_column.add_child(_make_section_caption("비단 전장도 · 군막 장계", 680))
|
||||
briefing_column.add_child(_make_ink_wash_rule(680, 8))
|
||||
briefing_column.add_child(_make_section_caption("戰圖 · 軍幕 장계", 680))
|
||||
|
||||
briefing_camp_overview_panel = PanelContainer.new()
|
||||
briefing_camp_overview_panel.custom_minimum_size = Vector2(680, 102)
|
||||
@@ -1422,7 +1464,7 @@ func _create_hud() -> void:
|
||||
briefing_camp_overview_row.add_child(briefing_camp_overview_label)
|
||||
briefing_camp_overview_shell.add_child(_make_bamboo_gutter(14, 72))
|
||||
|
||||
briefing_column.add_child(_make_scroll_rod(680, 3))
|
||||
briefing_column.add_child(_make_scroll_rod(680, 4))
|
||||
|
||||
var briefing_scroll := ScrollContainer.new()
|
||||
briefing_scroll.custom_minimum_size = Vector2(680, 66)
|
||||
@@ -1435,6 +1477,7 @@ func _create_hud() -> void:
|
||||
briefing_scroll.add_child(briefing_label)
|
||||
|
||||
briefing_column.add_child(_make_tablet_binding(680, 14))
|
||||
briefing_column.add_child(_make_edict_title_strip(["印", "兵", "發"], 680, 22))
|
||||
|
||||
var prep_button_row := HBoxContainer.new()
|
||||
prep_button_row.add_theme_constant_override("separation", 8)
|
||||
@@ -1680,13 +1723,14 @@ func _create_hud() -> void:
|
||||
dialogue_column = VBoxContainer.new()
|
||||
dialogue_column.custom_minimum_size = DIALOGUE_COLUMN_SIZE
|
||||
dialogue_column.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
dialogue_column.add_theme_constant_override("separation", 7)
|
||||
dialogue_column.add_theme_constant_override("separation", 4)
|
||||
dialogue_row.add_child(dialogue_column)
|
||||
|
||||
dialogue_right_tassel = _make_hanging_tassel(DIALOGUE_PORTRAIT_SIZE.y)
|
||||
dialogue_row.add_child(dialogue_right_tassel)
|
||||
|
||||
dialogue_column.add_child(_make_tablet_binding(DIALOGUE_TEXT_SIZE.x, 13))
|
||||
dialogue_column.add_child(_make_edict_title_strip(["軍", "談", "錄"], DIALOGUE_TEXT_SIZE.x, 22))
|
||||
|
||||
dialogue_seal_ribbon = _make_seal_ribbon(DIALOGUE_TEXT_SIZE.x, 18)
|
||||
dialogue_column.add_child(dialogue_seal_ribbon)
|
||||
@@ -2404,6 +2448,8 @@ func _terrain_fill_color(cell: Vector2i, terrain_key: String, has_background: bo
|
||||
alpha += 0.04
|
||||
elif terrain_key == "C" or terrain_key == "H":
|
||||
alpha += 0.02
|
||||
elif terrain_key == "D":
|
||||
alpha += 0.015
|
||||
color.a = alpha
|
||||
return color
|
||||
|
||||
@@ -2415,7 +2461,13 @@ func _map_grid_color(has_background: bool) -> Color:
|
||||
|
||||
|
||||
func _draw_terrain_detail(cell: Vector2i, rect: Rect2, terrain_key: String) -> void:
|
||||
if terrain_key == "F":
|
||||
if terrain_key == "G":
|
||||
for index in range(3):
|
||||
var point := _terrain_detail_point(cell, rect, index + 15)
|
||||
var tint := Color(0.74, 0.88, 0.42, 0.24 + _cell_noise(cell, index + 101) * 0.10)
|
||||
draw_line(point, point + Vector2(3, -7), tint, 1.2)
|
||||
draw_line(point + Vector2(5, 3), point + Vector2(9, -3), Color(0.46, 0.66, 0.28, 0.18), 1.0)
|
||||
elif terrain_key == "F":
|
||||
for index in range(4):
|
||||
var point := _terrain_detail_point(cell, rect, index)
|
||||
draw_circle(point, 4.5 + _cell_noise(cell, index + 11) * 2.0, Color(0.05, 0.20, 0.09, 0.42))
|
||||
@@ -2424,8 +2476,11 @@ func _draw_terrain_detail(cell: Vector2i, rect: Rect2, terrain_key: String) -> v
|
||||
for index in range(3):
|
||||
var point := _terrain_detail_point(cell, rect, index + 8)
|
||||
var peak := point + Vector2(0, -9)
|
||||
draw_line(point + Vector2(-10, 8), peak, Color(0.88, 0.84, 0.72, 0.38), 2.0)
|
||||
draw_line(peak, point + Vector2(10, 8), Color(0.22, 0.20, 0.16, 0.34), 2.0)
|
||||
draw_line(point + Vector2(-12, 9), peak, Color(0.92, 0.86, 0.68, 0.46), 2.2)
|
||||
draw_line(peak, point + Vector2(12, 9), Color(0.20, 0.18, 0.14, 0.42), 2.2)
|
||||
draw_line(point + Vector2(-5, 5), point + Vector2(5, 6), Color(0.10, 0.09, 0.07, 0.20), 1.1)
|
||||
elif terrain_key == "D":
|
||||
_draw_wasteland_detail(cell, rect)
|
||||
elif terrain_key == "R":
|
||||
_draw_road_detail(cell, rect)
|
||||
elif terrain_key == "W":
|
||||
@@ -2434,11 +2489,6 @@ func _draw_terrain_detail(cell: Vector2i, rect: Rect2, terrain_key: String) -> v
|
||||
draw_line(rect.position + Vector2(10, y - rect.position.y), rect.position + Vector2(rect.size.x - 10, y - rect.position.y + 4), Color(0.70, 0.88, 1.0, 0.32), 1.6)
|
||||
_draw_water_shoreline(cell, rect)
|
||||
elif terrain_key == "C":
|
||||
draw_rect(rect.grow(-7.0), Color(0.16, 0.15, 0.14, 0.28), false, 2.0)
|
||||
draw_line(rect.position + Vector2(10, 21), rect.position + Vector2(rect.size.x - 10, 21), Color(0.84, 0.80, 0.72, 0.30), 1.4)
|
||||
draw_line(rect.position + Vector2(10, 39), rect.position + Vector2(rect.size.x - 10, 39), Color(0.84, 0.80, 0.72, 0.22), 1.2)
|
||||
draw_line(rect.position + Vector2(23, 11), rect.position + Vector2(23, rect.size.y - 11), Color(0.05, 0.05, 0.05, 0.20), 1.2)
|
||||
draw_line(rect.position + Vector2(43, 11), rect.position + Vector2(43, rect.size.y - 11), Color(0.05, 0.05, 0.05, 0.20), 1.2)
|
||||
_draw_castle_detail(rect)
|
||||
else:
|
||||
for index in range(2):
|
||||
@@ -2482,10 +2532,29 @@ func _draw_water_shoreline(cell: Vector2i, rect: Rect2) -> void:
|
||||
draw_line(rect.position + Vector2(rect.size.x - 6, 7), rect.position + Vector2(rect.size.x - 4, rect.size.y - 7), shore, 2.0)
|
||||
|
||||
|
||||
func _draw_wasteland_detail(cell: Vector2i, rect: Rect2) -> void:
|
||||
var crack := Color(0.16, 0.10, 0.055, 0.32)
|
||||
var dust := Color(0.86, 0.68, 0.42, 0.20)
|
||||
for index in range(3):
|
||||
var point := _terrain_detail_point(cell, rect, index + 31)
|
||||
var end := point + Vector2(10.0 + _cell_noise(cell, index + 41) * 8.0, -2.0 + _cell_noise(cell, index + 43) * 5.0)
|
||||
draw_line(point, end, crack, 1.2)
|
||||
draw_line(point + Vector2(2, 5), point + Vector2(9, 7), dust, 1.0)
|
||||
for index in range(2):
|
||||
var pebble := _terrain_detail_point(cell, rect, index + 61)
|
||||
draw_circle(pebble, 1.6 + _cell_noise(cell, index + 63) * 1.2, Color(0.24, 0.18, 0.12, 0.24))
|
||||
|
||||
|
||||
func _draw_castle_detail(rect: Rect2) -> void:
|
||||
draw_rect(rect.grow(-6.0), Color(0.12, 0.115, 0.105, 0.32), false, 2.2)
|
||||
draw_rect(rect.grow(-12.0), Color(0.86, 0.80, 0.68, 0.12))
|
||||
for y in [15.0, 30.0, 45.0]:
|
||||
draw_line(rect.position + Vector2(9, y), rect.position + Vector2(rect.size.x - 9, y + 1.5), Color(0.86, 0.82, 0.74, 0.34), 1.2)
|
||||
for x in [18.0, 34.0, 50.0]:
|
||||
draw_line(rect.position + Vector2(x, 10), rect.position + Vector2(x + 1.5, rect.size.y - 10), Color(0.04, 0.04, 0.04, 0.26), 1.1)
|
||||
for index in range(3):
|
||||
var notch := Rect2(rect.position + Vector2(11.0 + float(index) * 16.0, 7.0), Vector2(8.0, 5.0))
|
||||
draw_rect(notch, Color(0.84, 0.80, 0.72, 0.22))
|
||||
draw_rect(notch, Color(0.84, 0.80, 0.72, 0.28))
|
||||
|
||||
|
||||
func _draw_terrain_edge_blend(cell: Vector2i, rect: Rect2, terrain_key: String) -> void:
|
||||
@@ -2538,6 +2607,8 @@ func _terrain_edge_priority(terrain_key: String) -> int:
|
||||
return 40
|
||||
if terrain_key == "H":
|
||||
return 30
|
||||
if terrain_key == "D":
|
||||
return 25
|
||||
if terrain_key == "R":
|
||||
return 20
|
||||
return 10
|
||||
@@ -2548,6 +2619,8 @@ func _terrain_edge_color(terrain_key: String, neighbor_key: String) -> Color:
|
||||
return Color(0.03, 0.16, 0.06, 0.34)
|
||||
if terrain_key == "H":
|
||||
return Color(0.88, 0.78, 0.48, 0.26)
|
||||
if terrain_key == "D":
|
||||
return Color(0.82, 0.58, 0.32, 0.28)
|
||||
if terrain_key == "W":
|
||||
return Color(0.72, 0.90, 1.0, 0.28)
|
||||
if terrain_key == "C":
|
||||
|
||||
Reference in New Issue
Block a user