Calculator/Project/Scenes/calculator.tscn
2025-04-15 11:51:57 -07:00

317 lines
11 KiB
Text

[gd_scene load_steps=13 format=3 uid="uid://blletw6rrhjr7"]
[ext_resource type="Script" path="res://Scripts/BasicCalculator.gd" id="1_vmkkw"]
[ext_resource type="StyleBox" uid="uid://bgd3kkjp56k6t" path="res://Style/NormalCalc.tres" id="2_gt3fn"]
[ext_resource type="StyleBox" uid="uid://bfnnrhuw8yyar" path="res://Style/NormalInstant.tres" id="2_xjvyb"]
[ext_resource type="StyleBox" uid="uid://bakatxtwoh52x" path="res://Style/HoverInstant.tres" id="3_c8wjg"]
[ext_resource type="StyleBox" uid="uid://cqpag6x74x8wv" path="res://Style/HoverCalc.tres" id="3_ny0km"]
[ext_resource type="StyleBox" uid="uid://b76lg563f17a1" path="res://Style/PressedCalc.tres" id="4_5juj0"]
[ext_resource type="StyleBox" uid="uid://263e7dk41d7p" path="res://Style/PressedInstant.tres" id="4_s3ro4"]
[ext_resource type="StyleBox" uid="uid://blrv60yt0gbld" path="res://Style/FocusAll.tres" id="5_e2rgu"]
[ext_resource type="StyleBox" uid="uid://dx4v7hg5h47sm" path="res://Style/NormalOperator.tres" id="6_e2yyp"]
[ext_resource type="PackedScene" uid="uid://cj0uj04i3vy83" path="res://Scenes/DifferentOptionsScroll.tscn" id="6_no6pg"]
[ext_resource type="StyleBox" uid="uid://bh5m8n5nsrrs4" path="res://Style/HoverOperator.tres" id="7_p05ac"]
[ext_resource type="StyleBox" uid="uid://cd8st43btla0m" path="res://Style/PressedOperator.tres" id="8_0e5x0"]
[node name="Calculator" type="Control" node_paths=PackedStringArray("Text")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_vmkkw")
Text = NodePath("Text")
[node name="Text" type="LineEdit" parent="."]
layout_mode = 0
offset_right = 800.0
offset_bottom = 80.0
placeholder_text = "Input Math Here"
[node name="Row1" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Add" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 20.0
offset_top = 100.0
offset_right = 60.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "+"
[node name="Subtract" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 80.0
offset_top = 100.0
offset_right = 120.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "-"
[node name="Multiply" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 140.0
offset_top = 100.0
offset_right = 180.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "x"
[node name="Divide" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 200.0
offset_top = 100.0
offset_right = 240.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "/"
[node name="Root" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 260.0
offset_top = 100.0
offset_right = 305.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "Root"
[node name="Power" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 320.0
offset_top = 100.0
offset_right = 365.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "Pow"
[node name="PowEuler" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 380.0
offset_top = 100.0
offset_right = 425.0
offset_bottom = 140.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_styles/normal = ExtResource("2_xjvyb")
theme_override_styles/hover = ExtResource("3_c8wjg")
theme_override_styles/pressed = ExtResource("4_s3ro4")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "E^x"
[node name="RootEuler" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 440.0
offset_top = 100.0
offset_right = 485.0
offset_bottom = 140.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_styles/normal = ExtResource("2_xjvyb")
theme_override_styles/hover = ExtResource("3_c8wjg")
theme_override_styles/pressed = ExtResource("4_s3ro4")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "ln(x)"
[node name="Log" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 493.0
offset_top = 100.0
offset_right = 551.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "Log⬇x"
[node name="Factorial" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 560.0
offset_top = 100.0
offset_right = 600.0
offset_bottom = 140.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_styles/normal = ExtResource("2_xjvyb")
theme_override_styles/hover = ExtResource("3_c8wjg")
theme_override_styles/pressed = ExtResource("4_s3ro4")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "int !"
[node name="Row2" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="One" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 20.0
offset_top = 160.0
offset_right = 60.0
offset_bottom = 200.0
text = "1"
[node name="Two" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 80.0
offset_top = 160.0
offset_right = 120.0
offset_bottom = 200.0
text = "2"
[node name="Three" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 140.0
offset_top = 160.0
offset_right = 180.0
offset_bottom = 200.0
text = "3"
[node name="Four" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 200.0
offset_top = 160.0
offset_right = 240.0
offset_bottom = 200.0
text = "4"
[node name="Five" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 260.0
offset_top = 160.0
offset_right = 305.0
offset_bottom = 200.0
text = "5"
[node name="Six" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 320.0
offset_top = 160.0
offset_right = 365.0
offset_bottom = 200.0
text = "6"
[node name="Seven" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 380.0
offset_top = 160.0
offset_right = 425.0
offset_bottom = 200.0
text = "7"
[node name="Eight" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 440.0
offset_top = 160.0
offset_right = 485.0
offset_bottom = 200.0
text = "8"
[node name="Nine" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 500.0
offset_top = 160.0
offset_right = 540.0
offset_bottom = 200.0
text = "9"
[node name="Zero" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 560.0
offset_top = 160.0
offset_right = 600.0
offset_bottom = 200.0
text = "0
"
[node name="Period" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 620.0
offset_top = 160.0
offset_right = 660.0
offset_bottom = 200.0
text = ".
"
[node name="AC" type="Button" parent="."]
layout_mode = 0
offset_left = 680.0
offset_top = 700.0
offset_right = 725.0
offset_bottom = 740.0
theme_override_styles/normal = ExtResource("2_gt3fn")
theme_override_styles/hover = ExtResource("3_ny0km")
theme_override_styles/pressed = ExtResource("4_5juj0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "AC"
[node name="Equals" type="Button" parent="."]
layout_mode = 0
offset_left = 740.0
offset_top = 700.0
offset_right = 780.0
offset_bottom = 740.0
theme_override_styles/normal = ExtResource("2_gt3fn")
theme_override_styles/hover = ExtResource("3_ny0km")
theme_override_styles/pressed = ExtResource("4_5juj0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "="
[node name="OptionButton" parent="." instance=ExtResource("6_no6pg")]
layout_mode = 1
[connection signal="text_changed" from="Text" to="." method="GetKeyInput"]
[connection signal="pressed" from="Row1/Add" to="." method="Operation_Change" binds= ["Add"]]
[connection signal="pressed" from="Row1/Subtract" to="." method="Operation_Change" binds= ["Subtract"]]
[connection signal="pressed" from="Row1/Multiply" to="." method="Operation_Change" binds= ["Multiply"]]
[connection signal="pressed" from="Row1/Divide" to="." method="Operation_Change" binds= ["Divide"]]
[connection signal="pressed" from="Row1/Root" to="." method="Operation_Change" binds= ["Root"]]
[connection signal="pressed" from="Row1/Power" to="." method="Operation_Change" binds= ["Pow"]]
[connection signal="pressed" from="Row1/PowEuler" to="." method="Instant_Calculate" binds= ["PowEuler"]]
[connection signal="pressed" from="Row1/RootEuler" to="." method="Instant_Calculate" binds= ["RootEuler"]]
[connection signal="pressed" from="Row1/Log" to="." method="Operation_Change" binds= ["Log"]]
[connection signal="pressed" from="Row1/Factorial" to="." method="Instant_Calculate" binds= ["Factorial"]]
[connection signal="pressed" from="Row2/One" to="." method="AddNumber" binds= [1]]
[connection signal="pressed" from="Row2/Two" to="." method="AddNumber" binds= [2]]
[connection signal="pressed" from="Row2/Three" to="." method="AddNumber" binds= [3]]
[connection signal="pressed" from="Row2/Four" to="." method="AddNumber" binds= [4]]
[connection signal="pressed" from="Row2/Five" to="." method="AddNumber" binds= [5]]
[connection signal="pressed" from="Row2/Six" to="." method="AddNumber" binds= [6]]
[connection signal="pressed" from="Row2/Seven" to="." method="AddNumber" binds= [7]]
[connection signal="pressed" from="Row2/Eight" to="." method="AddNumber" binds= [8]]
[connection signal="pressed" from="Row2/Nine" to="." method="AddNumber" binds= [9]]
[connection signal="pressed" from="Row2/Zero" to="." method="AddNumber" binds= [0]]
[connection signal="pressed" from="Row2/Period" to="." method="AddString" binds= ["."]]
[connection signal="pressed" from="AC" to="." method="Scrub"]
[connection signal="pressed" from="Equals" to="." method="Calculate"]