fix: warning count to zero
This commit is contained in:
parent
fb9c6d034c
commit
0072490f8b
|
|
@ -118,22 +118,22 @@ static func get_obscure_name(card_name: StringName):
|
||||||
else:
|
else:
|
||||||
return card_name
|
return card_name
|
||||||
|
|
||||||
func arrange(cards: Array[Card], rect: Rect2, obstacles: Array[Area2D]) -> Array[Card]:
|
func arrange(cards: Array[Card], rect: Rect2, _obstacles: Array[Area2D]) -> Array[Card]:
|
||||||
var total_cards = cards.size()
|
#var total_cards := cards.size()
|
||||||
|
|
||||||
var x:int = 0
|
var x:int = 0
|
||||||
var y:int = 0
|
var y:int = 0
|
||||||
var i:int = 0
|
var i:int = 0
|
||||||
var max:int = cards.size()
|
var maximum:int = cards.size()
|
||||||
var grid: int = ceil(sqrt(max))
|
var grid: int = ceil(sqrt(maximum))
|
||||||
var diameter:float = cards[0].diameter
|
var diameter:float = cards[0].diameter
|
||||||
|
|
||||||
var r_cards: Array[Card] = cards.duplicate()
|
var r_cards: Array[Card] = cards.duplicate()
|
||||||
r_cards.shuffle()
|
r_cards.shuffle()
|
||||||
|
|
||||||
while i < max:
|
while i < maximum:
|
||||||
while x < grid and i < max:
|
while x < grid and i < maximum:
|
||||||
while y < ceil(sqrt(max)) and i < max:
|
while y < ceil(sqrt(maximum)) and i < maximum:
|
||||||
r_cards[i].position = rect.size / Vector2(y, x) * (1.0 / (rect.size.x * diameter) ) + rect.position + Vector2(randf_range(diameter/2+5, diameter-5), randf_range(diameter/2+5, diameter-5))
|
r_cards[i].position = rect.size / Vector2(y, x) * (1.0 / (rect.size.x * diameter) ) + rect.position + Vector2(randf_range(diameter/2+5, diameter-5), randf_range(diameter/2+5, diameter-5))
|
||||||
i += 1
|
i += 1
|
||||||
y += 1
|
y += 1
|
||||||
|
|
@ -204,8 +204,8 @@ static func get_cards_by_name_array(names: Array[StringName]) -> Dictionary:
|
||||||
static func create_from_id(id:StringName) -> Area2D:
|
static func create_from_id(id:StringName) -> Area2D:
|
||||||
var parsed: PackedStringArray = id.rsplit(".")
|
var parsed: PackedStringArray = id.rsplit(".")
|
||||||
|
|
||||||
var helper = card_id_reference
|
#var helper := card_id_reference
|
||||||
var keys = card_id_reference.keys()
|
#var keys := card_id_reference.keys()
|
||||||
|
|
||||||
if card_id_reference.values().has(id):
|
if card_id_reference.values().has(id):
|
||||||
return Card.new(parsed[1], id)
|
return Card.new(parsed[1], id)
|
||||||
|
|
@ -215,24 +215,24 @@ static func create_from_id(id:StringName) -> Area2D:
|
||||||
push_error("Attempted to create Card or Sticky from non-existent ID!")
|
push_error("Attempted to create Card or Sticky from non-existent ID!")
|
||||||
return null
|
return null
|
||||||
|
|
||||||
static func create_dev_board(parent: Control, rect: Rect2) -> void:
|
static func create_dev_board(parent: Control, _rect: Rect2) -> void:
|
||||||
var scroll_container = ScrollContainer.new()
|
var scroll_container := ScrollContainer.new()
|
||||||
var panel = Panel.new()
|
var panel := Panel.new()
|
||||||
|
|
||||||
parent.add_child(scroll_container)
|
parent.add_child(scroll_container)
|
||||||
scroll_container.add_child(panel)
|
scroll_container.add_child(panel)
|
||||||
|
|
||||||
for x in range(source_dicts.size()):
|
for x in range(source_dicts.size()):
|
||||||
var sub_parent = Panel.new()
|
var sub_parent := Panel.new()
|
||||||
sub_parent.position = Vector2( 128 + 256*x , 0)
|
sub_parent.position = Vector2( 128 + 256*x , 0)
|
||||||
panel.add_child(sub_parent, false, Node.INTERNAL_MODE_BACK)
|
panel.add_child(sub_parent, false, Node.INTERNAL_MODE_BACK)
|
||||||
var y = 1
|
var y := 1
|
||||||
for card_name in source_dicts[x].keys():
|
for card_name in source_dicts[x].keys():
|
||||||
var card:Card = create_from_id(card_id_reference[card_name])
|
var card:Card = create_from_id(card_id_reference[card_name])
|
||||||
sub_parent.add_child(card, false, Node.INTERNAL_MODE_BACK)
|
sub_parent.add_child(card, false, Node.INTERNAL_MODE_BACK)
|
||||||
card.position = Vector2(0, card.diameter * y - card.diameter/2)
|
card.position = Vector2(0, card.diameter * y - card.diameter/2)
|
||||||
|
|
||||||
var z = 0
|
var z := 0
|
||||||
for sticky_name in get_child_names_of(card_name):
|
for sticky_name in get_child_names_of(card_name):
|
||||||
var sticky: StickyNote = create_from_id(sticky_id_reference[sticky_name])
|
var sticky: StickyNote = create_from_id(sticky_id_reference[sticky_name])
|
||||||
card.add_child(sticky, false, Node.INTERNAL_MODE_BACK)
|
card.add_child(sticky, false, Node.INTERNAL_MODE_BACK)
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ func attach_sticky_note(sticky_note: StickyNote) -> bool:
|
||||||
sticky_note.on_board = false
|
sticky_note.on_board = false
|
||||||
sticky_note.is_dragable = false
|
sticky_note.is_dragable = false
|
||||||
current_sticky_note = sticky_note
|
current_sticky_note = sticky_note
|
||||||
var former_parent = sticky_note.attached_to
|
#var former_parent = sticky_note.attached_to
|
||||||
sticky_note.attached_to = self
|
sticky_note.attached_to = self
|
||||||
|
|
||||||
if name == "c_hit" and sticky_note.name == "c_effort" and Steamworks.has_initialized:
|
if name == "c_hit" and sticky_note.name == "c_effort" and Steamworks.has_initialized:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ func _ready():
|
||||||
custom_minimum_size = Vector2(custom_minimum_size.x, 0)
|
custom_minimum_size = Vector2(custom_minimum_size.x, 0)
|
||||||
|
|
||||||
var is_attatching: bool = false
|
var is_attatching: bool = false
|
||||||
func attatch_sticky_note(attatchment: StickyNote, custom_owner: Node, tween:bool = true, reparent:bool = true):
|
func attatch_sticky_note(attatchment: StickyNote, custom_owner: Node, tween:bool = true, re_parent:bool = true):
|
||||||
is_attatching = true
|
is_attatching = true
|
||||||
attatchment.on_board = false
|
attatchment.on_board = false
|
||||||
attached_sticky_note = attatchment
|
attached_sticky_note = attatchment
|
||||||
|
|
@ -27,7 +27,7 @@ func attatch_sticky_note(attatchment: StickyNote, custom_owner: Node, tween:bool
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
var height_tween: Tween = create_tween()
|
var height_tween: Tween = create_tween()
|
||||||
height_tween.tween_property(self, "custom_minimum_size", minimum_size, 0.1)
|
height_tween.tween_property(self, "custom_minimum_size", minimum_size, 0.1)
|
||||||
var target_post = get_global_transform().origin+ancor_position
|
var target_post := get_global_transform().origin+ancor_position
|
||||||
for panel: StickyNotePanel in get_parent().get_children():
|
for panel: StickyNotePanel in get_parent().get_children():
|
||||||
if panel.attached_sticky_note == attatchment and panel.get_index() < get_index():
|
if panel.attached_sticky_note == attatchment and panel.get_index() < get_index():
|
||||||
target_post = get_global_transform().origin+ancor_position - Vector2(0, minimum_size.y)
|
target_post = get_global_transform().origin+ancor_position - Vector2(0, minimum_size.y)
|
||||||
|
|
@ -38,7 +38,7 @@ func attatch_sticky_note(attatchment: StickyNote, custom_owner: Node, tween:bool
|
||||||
attatchment.position = ancor_position
|
attatchment.position = ancor_position
|
||||||
else:
|
else:
|
||||||
custom_minimum_size = minimum_size
|
custom_minimum_size = minimum_size
|
||||||
if reparent:
|
if re_parent:
|
||||||
attatchment.reparent(self)
|
attatchment.reparent(self)
|
||||||
else:
|
else:
|
||||||
add_child(attatchment)
|
add_child(attatchment)
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ func _on_input_event(_viewport, event, _shape_idx):
|
||||||
|
|
||||||
func _move_sticky_note():
|
func _move_sticky_note():
|
||||||
if is_dragged:
|
if is_dragged:
|
||||||
var old_position = position
|
#var old_position = position
|
||||||
position = initial_drag_position + get_viewport().get_mouse_position() - mouse_diff
|
position = initial_drag_position + get_viewport().get_mouse_position() - mouse_diff
|
||||||
|
|
||||||
if hovering_cards != []:
|
if hovering_cards != []:
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ signal environment_settings_changed
|
||||||
signal theme_changed
|
signal theme_changed
|
||||||
var current_main_theme:Theme = preload("res://logic-scenes/themes/handwriting.theme")
|
var current_main_theme:Theme = preload("res://logic-scenes/themes/handwriting.theme")
|
||||||
|
|
||||||
|
func set_theme(new_theme:Theme):
|
||||||
|
current_main_theme = new_theme
|
||||||
|
theme_changed.emit(new_theme)
|
||||||
|
|
||||||
@export_file var user_settings_path:String = "user://user_settings.json"
|
@export_file var user_settings_path:String = "user://user_settings.json"
|
||||||
@export_file var user_saves_path:String = "user://savegames"
|
@export_file var user_saves_path:String = "user://savegames"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ func update_ui_from_state():
|
||||||
y_switch_gamepad.button_pressed = State.inverty_y_axis
|
y_switch_gamepad.button_pressed = State.inverty_y_axis
|
||||||
input_sensitivity_slider.value = State.input_sensitivity
|
input_sensitivity_slider.value = State.input_sensitivity
|
||||||
stream_overlay_picker.select(State.stream_overlay_position)
|
stream_overlay_picker.select(State.stream_overlay_position)
|
||||||
|
changed.emit()
|
||||||
|
|
||||||
func _on_exit_button_pressed() -> void:
|
func _on_exit_button_pressed() -> void:
|
||||||
leave_stage.emit()
|
leave_stage.emit()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue