Style ancient briefing UI and add Ye surrender camp
This commit is contained in:
@@ -69,14 +69,17 @@ const POST_MOVE_PICKER_PANEL_SIZE := Vector2(320, 210)
|
||||
const TARGETING_HINT_PANEL_SIZE := Vector2(240, 94)
|
||||
const LOCAL_COMMAND_PANEL_GAP := 8.0
|
||||
const LOCAL_COMMAND_PANEL_BOARD_PADDING := 4.0
|
||||
const UI_RICE_PAPER := Color(0.77, 0.67, 0.48, 0.96)
|
||||
const UI_RICE_PAPER_DARK := Color(0.48, 0.34, 0.18, 0.96)
|
||||
const UI_AGED_INK := Color(0.10, 0.065, 0.04, 1.0)
|
||||
const UI_DARK_LACQUER := Color(0.18, 0.055, 0.035, 0.96)
|
||||
const UI_CINNABAR := Color(0.48, 0.055, 0.035, 1.0)
|
||||
const UI_OLD_BRONZE := Color(0.72, 0.52, 0.22, 1.0)
|
||||
const UI_MUTED_JADE := Color(0.20, 0.36, 0.28, 1.0)
|
||||
const UI_PARCHMENT_TEXT := Color(0.94, 0.84, 0.62, 1.0)
|
||||
const UI_RICE_PAPER := Color(0.66, 0.55, 0.36, 0.97)
|
||||
const UI_RICE_PAPER_LIGHT := Color(0.76, 0.64, 0.43, 0.98)
|
||||
const UI_RICE_PAPER_DARK := Color(0.34, 0.22, 0.11, 0.98)
|
||||
const UI_AGED_INK := Color(0.09, 0.055, 0.032, 1.0)
|
||||
const UI_DARK_LACQUER := Color(0.12, 0.045, 0.025, 0.98)
|
||||
const UI_LACQUER_EDGE := Color(0.055, 0.025, 0.016, 1.0)
|
||||
const UI_CINNABAR := Color(0.52, 0.045, 0.025, 1.0)
|
||||
const UI_CINNABAR_DARK := Color(0.32, 0.025, 0.016, 1.0)
|
||||
const UI_OLD_BRONZE := Color(0.78, 0.58, 0.27, 1.0)
|
||||
const UI_MUTED_JADE := Color(0.16, 0.30, 0.23, 1.0)
|
||||
const UI_PARCHMENT_TEXT := Color(0.95, 0.82, 0.55, 1.0)
|
||||
const UI_DISABLED_TEXT := Color(0.48, 0.40, 0.29, 1.0)
|
||||
|
||||
var state: BattleState = BattleStateScript.new()
|
||||
@@ -118,6 +121,7 @@ var inventory_label: Label
|
||||
var briefing_panel: PanelContainer
|
||||
var briefing_title_label: Label
|
||||
var briefing_location_label: Label
|
||||
var briefing_objective_panel: PanelContainer
|
||||
var briefing_objective_label: Label
|
||||
var briefing_camp_overview_row: HBoxContainer
|
||||
var briefing_camp_overview_texture: TextureRect
|
||||
@@ -164,7 +168,9 @@ var dialogue_portrait_panel: PanelContainer
|
||||
var dialogue_portrait_texture: TextureRect
|
||||
var dialogue_portrait_label: Label
|
||||
var dialogue_column: VBoxContainer
|
||||
var dialogue_speaker_panel: PanelContainer
|
||||
var dialogue_speaker_label: Label
|
||||
var dialogue_text_panel: PanelContainer
|
||||
var dialogue_text_label: Label
|
||||
var dialogue_progress_label: Label
|
||||
var dialogue_previous_button: Button
|
||||
@@ -304,34 +310,64 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
|
||||
return
|
||||
var fill := UI_DARK_LACQUER
|
||||
var border := UI_OLD_BRONZE
|
||||
var border_width := 2
|
||||
var radius := 1
|
||||
var border_width := 3
|
||||
var radius := 0
|
||||
var margin := 10
|
||||
var shadow_size := 6
|
||||
match variant:
|
||||
"paper":
|
||||
fill = UI_RICE_PAPER
|
||||
border = UI_RICE_PAPER_DARK
|
||||
margin = 12
|
||||
border_width = 3
|
||||
margin = 14
|
||||
shadow_size = 8
|
||||
"edict":
|
||||
fill = UI_RICE_PAPER_LIGHT
|
||||
border = UI_AGED_INK
|
||||
border_width = 3
|
||||
margin = 10
|
||||
shadow_size = 4
|
||||
"seal":
|
||||
fill = UI_CINNABAR
|
||||
border = UI_OLD_BRONZE
|
||||
border_width = 2
|
||||
margin = 8
|
||||
"speaker_seal":
|
||||
fill = UI_CINNABAR_DARK
|
||||
border = UI_OLD_BRONZE
|
||||
border_width = 2
|
||||
margin = 8
|
||||
"portrait":
|
||||
fill = UI_AGED_INK
|
||||
fill = UI_LACQUER_EDGE
|
||||
border = UI_OLD_BRONZE
|
||||
border_width = 3
|
||||
margin = 3
|
||||
"dialogue":
|
||||
fill = UI_DARK_LACQUER
|
||||
border = UI_OLD_BRONZE
|
||||
border_width = 3
|
||||
margin = 12
|
||||
shadow_size = 10
|
||||
"speech_scroll":
|
||||
fill = UI_RICE_PAPER_LIGHT
|
||||
border = UI_RICE_PAPER_DARK
|
||||
border_width = 2
|
||||
margin = 12
|
||||
shadow_size = 2
|
||||
"notice":
|
||||
fill = Color(0.20, 0.09, 0.035, 0.96)
|
||||
fill = Color(0.18, 0.065, 0.032, 0.97)
|
||||
border = UI_CINNABAR
|
||||
border_width = 2
|
||||
margin = 8
|
||||
"map":
|
||||
fill = UI_AGED_INK
|
||||
fill = Color(0.20, 0.12, 0.065, 1.0)
|
||||
border = UI_OLD_BRONZE
|
||||
border_width = 3
|
||||
margin = 3
|
||||
"compact":
|
||||
fill = Color(0.16, 0.075, 0.04, 0.96)
|
||||
fill = Color(0.13, 0.065, 0.035, 0.97)
|
||||
border = UI_OLD_BRONZE
|
||||
border_width = 2
|
||||
margin = 7
|
||||
shadow_size = 4
|
||||
_:
|
||||
@@ -340,7 +376,7 @@ func _apply_panel_style(panel: PanelContainer, variant: String) -> void:
|
||||
|
||||
|
||||
func _make_button_style(fill: Color, border: Color, border_width: int) -> StyleBoxFlat:
|
||||
return _make_panel_style(fill, border, border_width, 1, 8, 0)
|
||||
return _make_panel_style(fill, border, border_width, 0, 8, 0)
|
||||
|
||||
|
||||
func _apply_button_style(button: Button, important: bool = false) -> void:
|
||||
@@ -378,6 +414,15 @@ func _make_separator(width: float = 0.0, height: float = 2.0) -> ColorRect:
|
||||
return separator
|
||||
|
||||
|
||||
func _make_ornament_bar(width: float = 4.0, height: float = 0.0) -> ColorRect:
|
||||
var bar := ColorRect.new()
|
||||
bar.color = UI_CINNABAR
|
||||
bar.custom_minimum_size = Vector2(width, height)
|
||||
bar.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
bar.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
return bar
|
||||
|
||||
|
||||
func _create_hud() -> void:
|
||||
var layer := CanvasLayer.new()
|
||||
add_child(layer)
|
||||
@@ -776,16 +821,23 @@ func _create_hud() -> void:
|
||||
|
||||
briefing_column.add_child(_make_separator(680, 2))
|
||||
|
||||
var briefing_objective_panel := PanelContainer.new()
|
||||
briefing_objective_panel = PanelContainer.new()
|
||||
briefing_objective_panel.custom_minimum_size = Vector2(680, 92)
|
||||
_apply_panel_style(briefing_objective_panel, "compact")
|
||||
_apply_panel_style(briefing_objective_panel, "edict")
|
||||
briefing_column.add_child(briefing_objective_panel)
|
||||
|
||||
var briefing_objective_row := HBoxContainer.new()
|
||||
briefing_objective_row.add_theme_constant_override("separation", 8)
|
||||
briefing_objective_panel.add_child(briefing_objective_row)
|
||||
|
||||
briefing_objective_row.add_child(_make_ornament_bar(5, 72))
|
||||
|
||||
briefing_objective_label = Label.new()
|
||||
briefing_objective_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
briefing_objective_label.custom_minimum_size = Vector2(656, 72)
|
||||
_apply_label_style(briefing_objective_label, UI_PARCHMENT_TEXT, 15)
|
||||
briefing_objective_panel.add_child(briefing_objective_label)
|
||||
briefing_objective_label.custom_minimum_size = Vector2(632, 72)
|
||||
briefing_objective_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
_apply_label_style(briefing_objective_label, UI_AGED_INK, 15)
|
||||
briefing_objective_row.add_child(briefing_objective_label)
|
||||
|
||||
briefing_camp_overview_row = HBoxContainer.new()
|
||||
briefing_camp_overview_row.custom_minimum_size = Vector2(680, 84)
|
||||
@@ -1042,11 +1094,11 @@ func _create_hud() -> void:
|
||||
dialogue_panel.position = DIALOGUE_PANEL_POSITION
|
||||
dialogue_panel.size = DIALOGUE_PANEL_SIZE
|
||||
dialogue_panel.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
_apply_panel_style(dialogue_panel, "compact")
|
||||
_apply_panel_style(dialogue_panel, "dialogue")
|
||||
root.add_child(dialogue_panel)
|
||||
|
||||
dialogue_row = HBoxContainer.new()
|
||||
dialogue_row.add_theme_constant_override("separation", 18)
|
||||
dialogue_row.add_theme_constant_override("separation", 14)
|
||||
dialogue_panel.add_child(dialogue_row)
|
||||
|
||||
dialogue_portrait_panel = PanelContainer.new()
|
||||
@@ -1078,9 +1130,9 @@ func _create_hud() -> void:
|
||||
dialogue_column.add_theme_constant_override("separation", 8)
|
||||
dialogue_row.add_child(dialogue_column)
|
||||
|
||||
var dialogue_speaker_panel := PanelContainer.new()
|
||||
dialogue_speaker_panel = PanelContainer.new()
|
||||
dialogue_speaker_panel.custom_minimum_size = Vector2(DIALOGUE_TEXT_SIZE.x, 32)
|
||||
_apply_panel_style(dialogue_speaker_panel, "seal")
|
||||
_apply_panel_style(dialogue_speaker_panel, "speaker_seal")
|
||||
dialogue_column.add_child(dialogue_speaker_panel)
|
||||
|
||||
dialogue_speaker_label = Label.new()
|
||||
@@ -1089,17 +1141,24 @@ func _create_hud() -> void:
|
||||
_apply_label_style(dialogue_speaker_label, UI_PARCHMENT_TEXT, 18)
|
||||
dialogue_speaker_panel.add_child(dialogue_speaker_label)
|
||||
|
||||
var dialogue_text_panel := PanelContainer.new()
|
||||
dialogue_text_panel = PanelContainer.new()
|
||||
dialogue_text_panel.custom_minimum_size = Vector2(DIALOGUE_TEXT_SIZE.x, 104)
|
||||
_apply_panel_style(dialogue_text_panel, "paper")
|
||||
_apply_panel_style(dialogue_text_panel, "speech_scroll")
|
||||
dialogue_column.add_child(dialogue_text_panel)
|
||||
|
||||
var dialogue_text_row := HBoxContainer.new()
|
||||
dialogue_text_row.add_theme_constant_override("separation", 8)
|
||||
dialogue_text_panel.add_child(dialogue_text_row)
|
||||
|
||||
dialogue_text_row.add_child(_make_ornament_bar(4, DIALOGUE_TEXT_SIZE.y - 20))
|
||||
|
||||
dialogue_text_label = Label.new()
|
||||
dialogue_text_label.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
|
||||
dialogue_text_label.custom_minimum_size = Vector2(DIALOGUE_TEXT_SIZE.x - 24, DIALOGUE_TEXT_SIZE.y - 20)
|
||||
dialogue_text_label.custom_minimum_size = Vector2(DIALOGUE_TEXT_SIZE.x - 42, DIALOGUE_TEXT_SIZE.y - 20)
|
||||
dialogue_text_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
dialogue_text_label.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
_apply_label_style(dialogue_text_label, UI_AGED_INK, 17)
|
||||
dialogue_text_panel.add_child(dialogue_text_label)
|
||||
dialogue_text_row.add_child(dialogue_text_label)
|
||||
|
||||
var dialogue_control_row := HBoxContainer.new()
|
||||
dialogue_control_row.add_theme_constant_override("separation", 8)
|
||||
@@ -1113,14 +1172,14 @@ func _create_hud() -> void:
|
||||
dialogue_control_row.add_child(dialogue_progress_label)
|
||||
|
||||
dialogue_previous_button = Button.new()
|
||||
dialogue_previous_button.text = "Prev"
|
||||
dialogue_previous_button.text = "Prior"
|
||||
dialogue_previous_button.disabled = true
|
||||
dialogue_previous_button.custom_minimum_size = Vector2(88, 32)
|
||||
dialogue_previous_button.pressed.connect(_retreat_dialogue)
|
||||
dialogue_control_row.add_child(dialogue_previous_button)
|
||||
|
||||
dialogue_continue_button = Button.new()
|
||||
dialogue_continue_button.text = "Next"
|
||||
dialogue_continue_button.text = "Continue"
|
||||
dialogue_continue_button.custom_minimum_size = Vector2(120, 32)
|
||||
dialogue_continue_button.pressed.connect(_advance_dialogue)
|
||||
dialogue_control_row.add_child(dialogue_continue_button)
|
||||
@@ -3829,10 +3888,10 @@ func _render_dialogue_line() -> void:
|
||||
|
||||
func _update_dialogue_controls() -> void:
|
||||
if dialogue_progress_label != null:
|
||||
dialogue_progress_label.text = "%d / %d" % [active_dialogue_index + 1, active_dialogue_lines.size()]
|
||||
dialogue_progress_label.text = "Scroll %d / %d" % [active_dialogue_index + 1, active_dialogue_lines.size()]
|
||||
if dialogue_previous_button != null:
|
||||
dialogue_previous_button.disabled = active_dialogue_index <= 0
|
||||
dialogue_continue_button.text = "Close" if active_dialogue_index >= active_dialogue_lines.size() - 1 else "Next"
|
||||
dialogue_continue_button.text = "Close" if active_dialogue_index >= active_dialogue_lines.size() - 1 else "Continue"
|
||||
|
||||
|
||||
func _apply_dialogue_side(side: String) -> void:
|
||||
@@ -4266,7 +4325,7 @@ func _update_briefing_camp_overview(briefing: Dictionary, prep_locked: bool) ->
|
||||
briefing_camp_overview_texture.texture = texture
|
||||
briefing_camp_overview_texture.visible = has_texture
|
||||
if briefing_camp_overview_fallback_label != null:
|
||||
briefing_camp_overview_fallback_label.text = "Camp"
|
||||
briefing_camp_overview_fallback_label.text = "War Map"
|
||||
briefing_camp_overview_fallback_label.visible = not has_texture
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user