mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 07:28:14 +00:00
added the game
This commit is contained in:
44
addons/commitreminder/Reminder.gd
Normal file
44
addons/commitreminder/Reminder.gd
Normal file
@@ -0,0 +1,44 @@
|
||||
@tool
|
||||
extends PanelContainer
|
||||
|
||||
var timer_active := false
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if timer_active:
|
||||
var time_left = $Timer.time_left
|
||||
$VBoxContainer/TimerCountdown.text = gen_time_string(format_time(time_left)) + " Left..."
|
||||
|
||||
func format_time(time_time := 0.0) -> Dictionary:
|
||||
var mils = abs(fmod(time_time, 1) * 100)
|
||||
var secs = abs(fmod(time_time, 60))
|
||||
var mins = abs(time_time / 60)
|
||||
return {"mils": int(mils), "secs": int(secs), "mins": int(mins)}
|
||||
|
||||
func gen_time_string(timer_dict := {}) -> String:
|
||||
return str(int(timer_dict["mins"])).pad_zeros(2) + ":" + str(int(timer_dict["secs"])).pad_zeros(2) + ":" + str(int(timer_dict["mils"])).pad_zeros(2)
|
||||
|
||||
func timer_finished() -> void:
|
||||
for i in 3:
|
||||
$AudioStreamPlayer.play()
|
||||
await get_tree().create_timer(1).timeout
|
||||
start_timer()
|
||||
|
||||
func start_timer() -> void:
|
||||
print("ahh")
|
||||
if not timer_active:
|
||||
$Timer.wait_time = $VBoxContainer/HBoxContainer/SpinBox.value * 60
|
||||
$Timer.start()
|
||||
$VBoxContainer/Inactive.hide()
|
||||
$VBoxContainer/TimerCountdown.show()
|
||||
timer_active = true
|
||||
else:
|
||||
timer_active = false
|
||||
$Timer.stop()
|
||||
$VBoxContainer/Inactive.show()
|
||||
$VBoxContainer/TimerCountdown.hide()
|
||||
$VBoxContainer/HBoxContainer/Start.text = "Start" if not timer_active else "Stop"
|
||||
|
||||
|
||||
func on_pressed() -> void:
|
||||
print("FUCK")
|
1
addons/commitreminder/Reminder.gd.uid
Normal file
1
addons/commitreminder/Reminder.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://vbyesiqqwfur
|
16
addons/commitreminder/commitreminder.gd
Normal file
16
addons/commitreminder/commitreminder.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
const REMINDER = preload("uid://hbpket74t6f7")
|
||||
var reminder
|
||||
|
||||
func _enter_tree() -> void:
|
||||
# Initialization of the plugin goes here.
|
||||
reminder = REMINDER.instantiate()
|
||||
add_control_to_dock(EditorPlugin.DOCK_SLOT_LEFT_BR, reminder)
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
# Clean-up of the plugin goes here.
|
||||
remove_control_from_docks(reminder)
|
||||
reminder.free()
|
1
addons/commitreminder/commitreminder.gd.uid
Normal file
1
addons/commitreminder/commitreminder.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bwllafh4hjbdq
|
7
addons/commitreminder/plugin.cfg
Normal file
7
addons/commitreminder/plugin.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="CommitReminder"
|
||||
description=""
|
||||
author="JoeMama"
|
||||
version=""
|
||||
script="commitreminder.gd"
|
89
addons/commitreminder/reminder.tscn
Normal file
89
addons/commitreminder/reminder.tscn
Normal file
@@ -0,0 +1,89 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://hbpket74t6f7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vbyesiqqwfur" path="res://addons/commitreminder/Reminder.gd" id="1_dxju6"]
|
||||
[ext_resource type="AudioStream" uid="uid://o8wqcv7gjfkn" path="res://Assets/Audio/SFX/Pause.wav" id="2_kjwcf"]
|
||||
|
||||
[node name="Reminder" type="PanelContainer"]
|
||||
process_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_dxju6")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
step = 0.0
|
||||
value = 2.5
|
||||
suffix = "Minutes"
|
||||
|
||||
[node name="Start" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Start"
|
||||
|
||||
[node name="Pause" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Pause"
|
||||
|
||||
[node name="Inactive" type="Label" parent="VBoxContainer"]
|
||||
modulate = Color(0.41215247, 0.41215247, 0.41215247, 1)
|
||||
layout_mode = 2
|
||||
text = "Timer Inactive."
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="TimerCountdown" type="Label" parent="VBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "00:00:00 Left."
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("2_kjwcf")
|
||||
pitch_scale = 1.5
|
||||
|
||||
[node name="Window" type="Window" parent="."]
|
||||
oversampling_override = 1.0
|
||||
title = "COMMIT"
|
||||
initial_position = 4
|
||||
size = Vector2i(256, 100)
|
||||
visible = false
|
||||
exclusive = true
|
||||
always_on_top = true
|
||||
|
||||
[node name="Control" type="Control" parent="Window"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Window/Control"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "REMEMBER TO COMMIT YOUR CHANGES YOU CUNT"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Start" to="." method="start_timer"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Pause" to="." method="on_pressed"]
|
||||
[connection signal="timeout" from="Timer" to="." method="timer_finished"]
|
||||
[connection signal="timeout" from="Timer" to="Window" method="show"]
|
||||
[connection signal="close_requested" from="Window" to="." method="start_timer"]
|
||||
[connection signal="close_requested" from="Window" to="Window" method="hide"]
|
Reference in New Issue
Block a user