diff --git a/addons/majority_judgment/fonts/KenneyLicense.md b/addons/majority_judgment/fonts/KenneyLicense.md new file mode 100644 index 0000000..7d8ca4e --- /dev/null +++ b/addons/majority_judgment/fonts/KenneyLicense.md @@ -0,0 +1,21 @@ +# Kenney Mini Square + +Created & distributed by [Kenney]))(www.kenney.nl) + +------------------------------ + +License: (Creative Commons Zero, CC0) +http://creativecommons.org/publicdomain/zero/1.0/ + +This content is free to use in personal, educational and commercial projects. + +Support us by crediting (Kenney or www.kenney.nl), this is not mandatory. + +------------------------------ + +Donate: http://support.kenney.nl +Request: http://request.kenney.nl +Patreon: http://patreon.com/kenney/ + +Follow on Twitter for updates: +@KenneyNL diff --git a/addons/majority_judgment/fonts/KenneyMini.tres b/addons/majority_judgment/fonts/KenneyMini.tres new file mode 100644 index 0000000..df7a32c --- /dev/null +++ b/addons/majority_judgment/fonts/KenneyMini.tres @@ -0,0 +1,6 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://addons/majority_judgment/fonts/KenneyMini.ttf" type="DynamicFontData" id=1] + +[resource] +font_data = ExtResource( 1 ) diff --git a/addons/majority_judgment/fonts/KenneyMini.ttf b/addons/majority_judgment/fonts/KenneyMini.ttf new file mode 100644 index 0000000..5cbfd37 Binary files /dev/null and b/addons/majority_judgment/fonts/KenneyMini.ttf differ diff --git a/addons/majority_judgment/fonts/KenneyMiniSquare.tres b/addons/majority_judgment/fonts/KenneyMiniSquare.tres new file mode 100644 index 0000000..be3cdc7 --- /dev/null +++ b/addons/majority_judgment/fonts/KenneyMiniSquare.tres @@ -0,0 +1,9 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://addons/majority_judgment/fonts/KenneyMiniSquare.ttf" type="DynamicFontData" id=1] + +[resource] +size = 32 +outline_size = 6 +outline_color = Color( 0.282353, 0.282353, 0.282353, 1 ) +font_data = ExtResource( 1 ) diff --git a/addons/majority_judgment/fonts/KenneyMiniSquare.ttf b/addons/majority_judgment/fonts/KenneyMiniSquare.ttf new file mode 100644 index 0000000..5f2c5bb Binary files /dev/null and b/addons/majority_judgment/fonts/KenneyMiniSquare.ttf differ diff --git a/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd b/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd index cbd7a9a..96c91ee 100644 --- a/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd +++ b/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd @@ -21,10 +21,10 @@ var providers:Array # of MajorityJudgmentAbstractJudgmentsProvider func _input(_event): if Input.is_action_just_pressed("ui_cancel"): - exit_poll() + exit_scene() -func exit_poll(): +func exit_scene(): # Check if we want to save or discard? # … # Close things up @@ -39,7 +39,7 @@ func get_poll() -> MajorityJudgmentPoll: func set_poll(__poll:MajorityJudgmentPoll): poll = __poll craft_nodes() - update_nodes() + update_scene() self.providers = App.get_providers() for provider in self.providers: @@ -89,7 +89,25 @@ func craft_nodes(): candidate_label.autowrap = true candidate_label.valign = Label.VALIGN_CENTER candidate_label.align = Label.ALIGN_RIGHT + var candidate_font = preload("res://addons/majority_judgment/fonts/KenneyMini.tres") + candidate_font.set_size(int(height*0.62)) + candidate_label.set("custom_fonts/font", candidate_font) + + var candidate_letter := Label.new() + candidate_letter.name = "CandidateLetterLabel" + candidate_letter.text = char(candidate_index+65) +# candidate_letter.size_flags_horizontal = Control.SIZE_EXPAND_FILL +# candidate_letter.size_flags_vertical = Control.SIZE_EXPAND_FILL + candidate_letter.rect_min_size = Vector2(height, height) +# candidate_letter.rect_size = Vector2(candidates_labels_width, height) + candidate_letter.valign = Label.VALIGN_CENTER + candidate_letter.align = Label.ALIGN_CENTER + var letter_font = preload("res://addons/majority_judgment/fonts/KenneyMiniSquare.tres") + letter_font.set_size(height*0.75) + candidate_letter.set("custom_fonts/font", letter_font) + wrapper.add_child(candidate_label) + wrapper.add_child(candidate_letter) wrapper.add_child(profile) container.add_child(wrapper) @@ -105,8 +123,7 @@ func craft_nodes(): candidate_index += 1 -# perhaps update_scene()? -func update_nodes(): +func update_scene(): $Tween.remove_all() var tally : MajorityJudgmentPollTally = get_poll().tally() var candidate_index = 0 # as they were initially written, before the sort @@ -207,5 +224,5 @@ func __on_judgment_emitted(author_identifier, grade_index, candidate_index): j.set_candidate(poll.candidates[candidate_index]) poll.add_judgment(j) - update_nodes() + update_scene()