From e766662dce94c9c6f64cef4fbd0c125741c73d5e Mon Sep 17 00:00:00 2001 From: Clevertop <41929769+Clevertop@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:58:29 +1100 Subject: [PATCH] Initial commit --- .gitattributes | 2 + .gitignore | 3 + Super_Credit.png | Bin 0 -> 546 bytes Super_Credit.png.import | 34 +++++++++ Super_Credit.svg | 80 ++++++++++++++++++++++ Super_Credit.svg.import | 37 ++++++++++ export_presets.cfg | 64 +++++++++++++++++ icon.svg | 1 + icon.svg.import | 37 ++++++++++ logic.gd | 96 ++++++++++++++++++++++++++ main.tscn | 148 ++++++++++++++++++++++++++++++++++++++++ project.godot | 25 +++++++ 12 files changed, 527 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Super_Credit.png create mode 100644 Super_Credit.png.import create mode 100644 Super_Credit.svg create mode 100644 Super_Credit.svg.import create mode 100644 export_presets.cfg create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 logic.gd create mode 100644 main.tscn create mode 100644 project.godot diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/Super_Credit.png b/Super_Credit.png new file mode 100644 index 0000000000000000000000000000000000000000..b7ad936b010a6b46ae030fe83e3d2252e7a03023 GIT binary patch literal 546 zcmeAS@N?(olHy`uVBq!ia0vp^$v|Al!3-q7{eEi>q*?-eLR^8g-^ri;r+)aI`W|rl z2aw?pA%P4q0xDo&WMt;#X5r$Mat>CG%vFsmQH?KEODxyQZq~|a(JAcKub5(3H`}Oj zzG?e1v+h;q-K)*})>%#2W<6uK&CES^^A0;KKH;$Rl;g59&TB5aZoKKa=b6{u=e|ci z0Im4{|9_NQ=Q5xz+$BMN!3?3ZR<3&e?$g&Fe{Snl?*mz$EalY zaqsP|lX*;r0Gf&nmU(SbO+Wi1)%DLA zgU3&Me=fh!mUiY>Q1CQGVUxp-8+gPWjpnc%FAx?v>}R71C;OyHXU8Qtmg+q%}Xoo{`Xe)=wzTasFj{VxdMEm-UkM9!ud^U4`wDFyDYW!N9wiTS3N$kZo0 X?+de<+$mmp6cm@9u6{1-oD!M + + + diff --git a/Super_Credit.svg.import b/Super_Credit.svg.import new file mode 100644 index 0000000..2e90024 --- /dev/null +++ b/Super_Credit.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bskgme2radxb1" +path="res://.godot/imported/Super_Credit.svg-2e8260a2ec2a158ff5f8a990ad84e7a8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Super_Credit.svg" +dest_files=["res://.godot/imported/Super_Credit.svg-2e8260a2ec2a158ff5f8a990ad84e7a8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..7a144ce --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,64 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../meow/supercredits.exe" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..970306a --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dfxl27c3opct6" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/logic.gd b/logic.gd new file mode 100644 index 0000000..9c4dca3 --- /dev/null +++ b/logic.gd @@ -0,0 +1,96 @@ +extends Control + +var pickups : Array[int] +var timer : float = 0 +var running : bool = false +var super_credits : int = 0 +@export_group("Node References") + +@export var timer_label : Label +@export var play_button : Button +@export var pause_button : Button +@export var reset_button : Button +@export var add10_button : Button +@export var add100_button : Button +@export var undo_button : Button +@export var credits_label : Label +@export var pickups_label : Label +@export var warbond_label : Label +@export var current_sc_label : Label +@export var sc_entry : LineEdit + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if running: + timer += delta + + play_button.disabled = running + pause_button.disabled = !running + add10_button.disabled = !running + add100_button.disabled = !running + reset_button.disabled = not pickups.size() > 0 + undo_button.disabled = not pickups.size() > 0 + + current_sc_label.text = str(super_credits) + timer_label.text = get_time() + pickups_label.text = str(pickups.size()) + " Pickups - " + str(round(pickups.size()*(3600/timer))) + " /h (" + str(round((pickups.size()*10)*(3600/timer))) + " SC/hr)" + credits_label.text = str(get_total_credits()) + " Super Credits - " + str(round(get_total_credits()*(3600/timer))) + " /h" + warbond_label.text = "Next warbond in: " + str(get_next_warbond()) + "m" + +#returns the amount of minutes until 1000 sc reached +func get_next_warbond() -> int: + var next_warbond_needed : float = 1000 - super_credits + if next_warbond_needed <= 0: + return 0 + var sc_per_hour_min : float = round((pickups.size()*10)*(3600/timer)) + return (next_warbond_needed/sc_per_hour_min)*60 + +func get_total_credits() -> int: + var total : int + for pickup in pickups: + total += pickup + return total + +func get_time() -> String: + var hours : int = floori(timer/3600) + var minutes : int = floori(timer/60) - hours*60 + var seconds : int = roundi(timer) - minutes*60 - hours*3600 + return str(hours).pad_zeros(2) + ":" + str(minutes).pad_zeros(2) + ":" + str(seconds).pad_zeros(2) + + +func _on_play_button_pressed(): + running = true + + +func _on_pause_button_pressed(): + running = false + + +func _on_reset_button_pressed(): + pickups.clear() + running = false + timer = 0 + + +func _on_add_10_pressed(): + pickups.append(10) + super_credits += 10 + + +func _on_add_100_pressed(): + pickups.append(100) + super_credits += 100 + + +func _on_undo_pressed(): + super_credits -= pickups.pop_back() + + +func _on_set_sc_button_pressed(): + super_credits = sc_entry.text.to_int() + sc_entry.clear() diff --git a/main.tscn b/main.tscn new file mode 100644 index 0000000..4fc7ed9 --- /dev/null +++ b/main.tscn @@ -0,0 +1,148 @@ +[gd_scene load_steps=4 format=3 uid="uid://cpa3y5pkkf0dw"] + +[ext_resource type="Script" path="res://logic.gd" id="1_oa7ox"] +[ext_resource type="Texture2D" uid="uid://bskgme2radxb1" path="res://Super_Credit.svg" id="2_k60xb"] + +[sub_resource type="LabelSettings" id="LabelSettings_8sxj1"] +font_size = 20 +font_color = Color(0, 1, 1, 1) + +[node name="Main" type="Control" node_paths=PackedStringArray("timer_label", "play_button", "pause_button", "reset_button", "add10_button", "add100_button", "undo_button", "credits_label", "pickups_label", "warbond_label", "current_sc_label", "sc_entry")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_oa7ox") +timer_label = NodePath("VBoxContainer/Timer") +play_button = NodePath("VBoxContainer/HBoxContainer/PlayButton") +pause_button = NodePath("VBoxContainer/HBoxContainer/PauseButton") +reset_button = NodePath("VBoxContainer/HBoxContainer/ResetButton") +add10_button = NodePath("VBoxContainer/HBoxContainer2/Add10") +add100_button = NodePath("VBoxContainer/HBoxContainer2/Add100") +undo_button = NodePath("VBoxContainer/HBoxContainer2/Undo") +credits_label = NodePath("VBoxContainer/SuperCreditsDisplay") +pickups_label = NodePath("VBoxContainer/PickupsDisplay") +warbond_label = NodePath("VBoxContainer/NextWarbond") +current_sc_label = NodePath("VBoxContainer/HBoxContainer3/Credits") +sc_entry = NodePath("VBoxContainer/HBoxContainer3/SCEntry") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +text = "Tabby's Super Credit Calculator" +horizontal_alignment = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 + +[node name="PlayButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Play" + +[node name="PauseButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Pause" + +[node name="ResetButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Reset" + +[node name="Timer" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "01:23:45" +horizontal_alignment = 1 + +[node name="HSeparator" type="HSeparator" parent="VBoxContainer"] +layout_mode = 2 + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 + +[node name="Add10" type="Button" parent="VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "+10" +icon = ExtResource("2_k60xb") +expand_icon = true + +[node name="Add100" type="Button" parent="VBoxContainer/HBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "+100" +icon = ExtResource("2_k60xb") +expand_icon = true + +[node name="Undo" type="Button" parent="VBoxContainer/HBoxContainer2"] +modulate = Color(1, 0, 0, 1) +layout_mode = 2 +size_flags_horizontal = 3 +text = "Undo" +icon = ExtResource("2_k60xb") +expand_icon = true + +[node name="SuperCreditsDisplay" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "300 Super Credits - 134 /h" +horizontal_alignment = 1 + +[node name="PickupsDisplay" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "12 Pickups - 3.2 /h" +horizontal_alignment = 1 + +[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"] +layout_mode = 2 + +[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer/HBoxContainer3"] +layout_mode = 2 +texture = ExtResource("2_k60xb") +expand_mode = 2 + +[node name="Credits" type="Label" parent="VBoxContainer/HBoxContainer3"] +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "1200" +label_settings = SubResource("LabelSettings_8sxj1") +horizontal_alignment = 1 + +[node name="VSeparator" type="VSeparator" parent="VBoxContainer/HBoxContainer3"] +layout_mode = 2 + +[node name="SCEntry" type="LineEdit" parent="VBoxContainer/HBoxContainer3"] +layout_mode = 2 +placeholder_text = "New SC" + +[node name="SetSCButton" type="Button" parent="VBoxContainer/HBoxContainer3"] +layout_mode = 2 +text = "Set" + +[node name="NextWarbond" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "Next Warbond in: 12m" +horizontal_alignment = 1 +clip_text = true + +[connection signal="pressed" from="VBoxContainer/HBoxContainer/PlayButton" to="." method="_on_play_button_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/PauseButton" to="." method="_on_pause_button_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/ResetButton" to="." method="_on_reset_button_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Add10" to="." method="_on_add_10_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Add100" to="." method="_on_add_100_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Undo" to="." method="_on_undo_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer3/SetSCButton" to="." method="_on_set_sc_button_pressed"] diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..82950d7 --- /dev/null +++ b/project.godot @@ -0,0 +1,25 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="SuperCreditFarm" +config/features=PackedStringArray("4.3", "GL Compatibility") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=300 +window/size/viewport_height=300 + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"