Tighten local command targeting UX
This commit is contained in:
@@ -786,6 +786,12 @@ func _apply_button_style(button: Button, important: bool = false) -> void:
|
||||
_apply_control_font(button, important)
|
||||
|
||||
|
||||
func _suppress_local_command_tooltip(button: Button) -> void:
|
||||
if button == null:
|
||||
return
|
||||
button.tooltip_text = ""
|
||||
|
||||
|
||||
func _configure_hud_command_button(button: Button) -> void:
|
||||
if button == null:
|
||||
return
|
||||
@@ -1541,31 +1547,31 @@ func _create_hud() -> void:
|
||||
|
||||
post_move_attack_button = Button.new()
|
||||
post_move_attack_button.text = "타격령"
|
||||
post_move_attack_button.tooltip_text = "이 자리에서 칠 적군을 지목합니다."
|
||||
_suppress_local_command_tooltip(post_move_attack_button)
|
||||
post_move_attack_button.pressed.connect(_on_post_move_attack_pressed)
|
||||
post_move_grid.add_child(post_move_attack_button)
|
||||
|
||||
post_move_tactic_button = Button.new()
|
||||
post_move_tactic_button.text = "책략첩"
|
||||
post_move_tactic_button.tooltip_text = "군령에 올릴 책략 죽간을 고릅니다."
|
||||
_suppress_local_command_tooltip(post_move_tactic_button)
|
||||
post_move_tactic_button.pressed.connect(_on_post_move_tactic_pressed)
|
||||
post_move_grid.add_child(post_move_tactic_button)
|
||||
|
||||
post_move_item_button = Button.new()
|
||||
post_move_item_button.text = "보급첩"
|
||||
post_move_item_button.tooltip_text = "군령에 올릴 보급 물자를 고릅니다."
|
||||
_suppress_local_command_tooltip(post_move_item_button)
|
||||
post_move_item_button.pressed.connect(_on_post_move_item_pressed)
|
||||
post_move_grid.add_child(post_move_item_button)
|
||||
|
||||
post_move_wait_button = Button.new()
|
||||
post_move_wait_button.text = "대기령"
|
||||
post_move_wait_button.tooltip_text = "행군을 확정하고 군령을 봉인합니다."
|
||||
_suppress_local_command_tooltip(post_move_wait_button)
|
||||
post_move_wait_button.pressed.connect(_on_post_move_wait_pressed)
|
||||
post_move_grid.add_child(post_move_wait_button)
|
||||
|
||||
post_move_cancel_button = Button.new()
|
||||
post_move_cancel_button.text = "발걸음 거두기"
|
||||
post_move_cancel_button.tooltip_text = "처음 있던 칸으로 돌아갑니다."
|
||||
_suppress_local_command_tooltip(post_move_cancel_button)
|
||||
post_move_cancel_button.pressed.connect(_on_post_move_cancel_pressed)
|
||||
post_move_column.add_child(post_move_cancel_button)
|
||||
|
||||
@@ -1611,19 +1617,19 @@ func _create_hud() -> void:
|
||||
|
||||
post_move_picker_back_button = Button.new()
|
||||
post_move_picker_back_button.text = "죽간 거두기"
|
||||
post_move_picker_back_button.tooltip_text = "군령 선택으로 되돌립니다."
|
||||
_suppress_local_command_tooltip(post_move_picker_back_button)
|
||||
post_move_picker_back_button.pressed.connect(_on_post_move_picker_back_pressed)
|
||||
picker_button_row.add_child(post_move_picker_back_button)
|
||||
|
||||
post_move_picker_cancel_move_button = Button.new()
|
||||
post_move_picker_cancel_move_button.text = "발걸음 거두기"
|
||||
post_move_picker_cancel_move_button.tooltip_text = "발걸음을 거두면 원래 자리로 되돌립니다."
|
||||
_suppress_local_command_tooltip(post_move_picker_cancel_move_button)
|
||||
post_move_picker_cancel_move_button.pressed.connect(_on_post_move_picker_cancel_move_pressed)
|
||||
picker_button_row.add_child(post_move_picker_cancel_move_button)
|
||||
|
||||
targeting_hint_panel = PanelContainer.new()
|
||||
targeting_hint_panel.visible = false
|
||||
targeting_hint_panel.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
targeting_hint_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
targeting_hint_panel.custom_minimum_size = TARGETING_HINT_PANEL_SIZE
|
||||
targeting_hint_panel.size = TARGETING_HINT_PANEL_SIZE
|
||||
_apply_panel_style(targeting_hint_panel, "target_hint")
|
||||
@@ -1653,13 +1659,13 @@ func _create_hud() -> void:
|
||||
|
||||
targeting_hint_back_button = Button.new()
|
||||
targeting_hint_back_button.text = "죽간 거두기"
|
||||
targeting_hint_back_button.tooltip_text = "군령 선택으로 되돌립니다."
|
||||
_suppress_local_command_tooltip(targeting_hint_back_button)
|
||||
targeting_hint_back_button.pressed.connect(_on_targeting_back_pressed)
|
||||
targeting_button_row.add_child(targeting_hint_back_button)
|
||||
|
||||
targeting_hint_cancel_move_button = Button.new()
|
||||
targeting_hint_cancel_move_button.text = "발걸음 거두기"
|
||||
targeting_hint_cancel_move_button.tooltip_text = "부대를 원래 자리로 되돌립니다."
|
||||
_suppress_local_command_tooltip(targeting_hint_cancel_move_button)
|
||||
targeting_hint_cancel_move_button.pressed.connect(_on_targeting_cancel_move_pressed)
|
||||
targeting_button_row.add_child(targeting_hint_cancel_move_button)
|
||||
|
||||
@@ -9485,22 +9491,27 @@ func _update_post_move_menu() -> void:
|
||||
)
|
||||
if post_move_attack_button != null:
|
||||
var attack_blocked := not _has_basic_attack_target(pending_move_unit_id)
|
||||
post_move_attack_button.text = "타격 없음" if attack_blocked else "타격령"
|
||||
post_move_attack_button.disabled = attack_blocked
|
||||
post_move_attack_button.tooltip_text = "사거리 안에 적 부대가 없습니다." if attack_blocked else "이 자리에서 칠 적군을 지목합니다."
|
||||
_suppress_local_command_tooltip(post_move_attack_button)
|
||||
if post_move_tactic_button != null:
|
||||
var skill_blocked := not _unit_has_usable_skill_target(pending_move_unit_id)
|
||||
post_move_tactic_button.text = "책략 없음" if skill_blocked else "책략첩"
|
||||
post_move_tactic_button.disabled = skill_blocked
|
||||
post_move_tactic_button.tooltip_text = "이 자리에서 닿는 책략 대상이 없습니다." if skill_blocked else "군령에 올릴 책략 죽간을 고릅니다."
|
||||
_suppress_local_command_tooltip(post_move_tactic_button)
|
||||
if post_move_item_button != null:
|
||||
var item_blocked := not _unit_has_usable_item_target(pending_move_unit_id)
|
||||
post_move_item_button.text = "보급 없음" if item_blocked else "보급첩"
|
||||
post_move_item_button.disabled = item_blocked
|
||||
post_move_item_button.tooltip_text = "이 자리에서 닿는 보급 대상이 없습니다." if item_blocked else "군령에 올릴 보급 물자를 고릅니다."
|
||||
_suppress_local_command_tooltip(post_move_item_button)
|
||||
if post_move_wait_button != null:
|
||||
post_move_wait_button.text = "대기령"
|
||||
post_move_wait_button.disabled = false
|
||||
post_move_wait_button.tooltip_text = "행군을 확정하고 군령을 봉인합니다."
|
||||
_suppress_local_command_tooltip(post_move_wait_button)
|
||||
if post_move_cancel_button != null:
|
||||
post_move_cancel_button.text = "발걸음 거두기"
|
||||
post_move_cancel_button.disabled = false
|
||||
post_move_cancel_button.tooltip_text = "발걸음을 거두면 원래 자리로 되돌립니다."
|
||||
_suppress_local_command_tooltip(post_move_cancel_button)
|
||||
|
||||
|
||||
func _local_command_panel_position_for_cell(cell: Vector2i, panel_size: Vector2) -> Vector2:
|
||||
@@ -9674,7 +9685,7 @@ func _rebuild_post_move_tactic_picker(selected: Dictionary) -> void:
|
||||
skill_button.text = _format_post_move_tactic_button_text(skill_id, skill, selected)
|
||||
var disabled_reason := _post_move_tactic_disabled_reason(selected, skill_id, skill)
|
||||
skill_button.disabled = not disabled_reason.is_empty()
|
||||
skill_button.tooltip_text = disabled_reason if not disabled_reason.is_empty() else "이 책략 죽간을 군령에 올립니다."
|
||||
_suppress_local_command_tooltip(skill_button)
|
||||
_apply_button_style(skill_button)
|
||||
skill_button.pressed.connect(_on_post_move_tactic_option_pressed.bind(skill_id))
|
||||
post_move_picker_list.add_child(skill_button)
|
||||
@@ -9698,7 +9709,7 @@ func _rebuild_post_move_item_picker(selected: Dictionary) -> void:
|
||||
_apply_item_button_icon(item_button, item)
|
||||
var disabled_reason := _post_move_item_disabled_reason(selected, item_id, count)
|
||||
item_button.disabled = not disabled_reason.is_empty()
|
||||
item_button.tooltip_text = disabled_reason if not disabled_reason.is_empty() else "이 보급을 군령에 올립니다."
|
||||
_suppress_local_command_tooltip(item_button)
|
||||
_apply_button_style(item_button)
|
||||
item_button.pressed.connect(_on_post_move_item_option_pressed.bind(item_id))
|
||||
post_move_picker_list.add_child(item_button)
|
||||
|
||||
Reference in New Issue
Block a user