Skip to content

Commit

Permalink
add option to change json server url
Browse files Browse the repository at this point in the history
  • Loading branch information
itspacchu committed Jan 9, 2023
1 parent 4f09682 commit 7a5b276
Show file tree
Hide file tree
Showing 15 changed files with 982 additions and 969 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Exports/
Exports/*
Demo/*
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="f31830d02a69a1bb00f298c9d3756a18"
dest_md5="f81b9af111048d03acd1137e0fbde6d6"
dest_md5="2ee6d34e81013372acf120b494e7357a"

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="1303efe96fb13f15f2bf3f5400ceb27f"
dest_md5="555470c6c51bb1f10d32ad93ed5538c0"
dest_md5="f489183ac03ef6c8c0e95a5d47628623"

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="c9192c5df837e96e51ef67f84514d0d2"
dest_md5="d6ec7f0a5e4874df2f0964c2511ec864"
dest_md5="5631a673e23e2e08817c770b7800217a"

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="9fb2eab7accbd85a0f14a858ce59eaf6"
dest_md5="787dbd78c7db4c18bd3a1a924aa8d948"
dest_md5="7338ed4211902f27e0b6e020c8d13523"

2 changes: 1 addition & 1 deletion .import/t_grass_4.png-8c4ce0ae1e4976cff282b513cd460d46.md5
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="6bf7e5ed204e3e1bf46d1aa9e11093ca"
dest_md5="da087846e52417df1fd08ea0eadf636d"
dest_md5="7a2349e58bff706c67526f05e432cdda"

2 changes: 1 addition & 1 deletion .import/t_noise.png-e10f8e40ee944b131064956eb50e2fe9.md5
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="96cdc73cd50ed2ad339936efaf39c922"
dest_md5="dc83ed23132ed319f53d6a2aa42d5712"
dest_md5="af8a0c8feeea9080906a65cd1ddaed66"

2 changes: 1 addition & 1 deletion .import/t_rock_2.png-991228c832dc944a83d1afe6dc27f8f1.md5
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="c5a2ae22a6d3dde921f92aeef62da2b6"
dest_md5="9553bb2e594938fed3dbc50a68637553"
dest_md5="4c4570e87513861027a512077fd4a97c"

9 changes: 8 additions & 1 deletion Prefabs/DynamicNodeLoader.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Scripts/DynamicNodeLoader.gd" type="Script" id=1]
[ext_resource path="res://Scripts/GetNodeData.gd" type="Script" id=2]

[node name="DynamicNodeLoader" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 22.721, 0, -27.101 )
script = ExtResource( 1 )

[node name="HTTPRequest" type="HTTPRequest" parent="."]
script = ExtResource( 2 )

[connection signal="request_completed" from="HTTPRequest" to="." method="_on_HTTPRequest_request_completed"]
149 changes: 1 addition & 148 deletions Prefabs/Menu.tscn

Large diffs are not rendered by default.

76 changes: 46 additions & 30 deletions Prefabs/handle_settings.gd
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
extends Panel



# Called when the node enters the scene tree for the first time.
func _ready():
$VBoxContainer/AQ2.pressed = get_parent().get_parent().get_node("WorldEnvironment/DirectionalLight").shadow_enabled
$VBoxContainer/RenderDistance/renderd.value = get_viewport().get_camera().far

func _on_back_pressed():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
var camera = get_viewport().get_camera()
camera.get_parent().get_parent().get_parent().set_process_input(true)
get_parent().get_parent().settings_open = false
queue_free()

func _input(event):
if(Input.is_action_just_pressed("ui_cancel")):
_on_back_pressed()

func _on_AQ2_toggled(button_pressed):
get_parent().get_parent().get_node("WorldEnvironment/DirectionalLight").shadow_enabled = button_pressed


func _on_renderd_value_changed(value):
get_viewport().get_camera().far = value


func _on_reload_pressed():
get_tree().change_scene_to(load("res://Scenes/TestBed.tscn"))
extends Panel



# Called when the node enters the scene tree for the first time.
func _ready():
$VBoxContainer/AQ2.pressed = get_parent().get_parent().get_node("WorldEnvironment/DirectionalLight").shadow_enabled
$VBoxContainer/RenderDistance/renderd.value = get_viewport().get_camera().far

func _on_back_pressed():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
var camera = get_viewport().get_camera()
camera.get_parent().get_parent().get_parent().set_process_input(true)
get_parent().get_parent().settings_open = false
queue_free()

func _input(event):
if(Input.is_action_just_pressed("ui_cancel")):
_on_back_pressed()

func _on_AQ2_toggled(button_pressed):
get_parent().get_parent().get_node("WorldEnvironment/DirectionalLight").shadow_enabled = button_pressed


func _on_renderd_value_changed(value):
get_viewport().get_camera().far = value


func _on_reload_pressed():
get_tree().change_scene_to(load("res://Scenes/TestBed.tscn"))


func _on_CheckButton_toggled(button_pressed: bool) -> void:
var animplayer:AnimationPlayer = get_parent().get_parent().get_node("WorldEnvironment/AnimationPlayer")
if(button_pressed):
animplayer.play("dn")
animplayer.seek(1)
else:
animplayer.play("RESET")
animplayer.seek(0)

func _on_LineEdit_text_entered(new_text: String) -> void:
get_parent().get_parent().get_node("DynamicNodeLoader").queue_free()
var node_loader = load('res://Prefabs/DynamicNodeLoader.tscn').instance()
node_loader.Node_json_url = new_text
get_parent().get_parent().add_child(node_loader)
Loading

0 comments on commit 7a5b276

Please sign in to comment.