Browse Source

Initial commit

galo 2 years ago
commit
4410c18e58

+ 2 - 0
.gitattributes

@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto

+ 3 - 0
.import/Helm.ogg-3f6f1d0f76f599f2ecb6bc024b31a2f1.md5

@@ -0,0 +1,3 @@
+source_md5="e524d38d90585ff02459d7c6bbaac72e"
+dest_md5="30471d666aeb32206f7e1a3347e16911"
+

BIN
.import/Helm.ogg-3f6f1d0f76f599f2ecb6bc024b31a2f1.oggstr


+ 3 - 0
.import/Logo2small.png-ca4ea4bd6feb2cda642f8d09d6f20643.md5

@@ -0,0 +1,3 @@
+source_md5="1a8ceb1e30d5bb89afe8ff81a03589df"
+dest_md5="bcdd16beb6f8e268df17d36478390fb3"
+

BIN
.import/Logo2small.png-ca4ea4bd6feb2cda642f8d09d6f20643.stex


+ 3 - 0
.import/dowloadbackground.png-ba905579a24c28f29cf248b17d480d13.md5

@@ -0,0 +1,3 @@
+source_md5="4951f2d52d8145b49e918faff9ee3128"
+dest_md5="857dc287e32938d22e24c8c945c221e9"
+

BIN
.import/dowloadbackground.png-ba905579a24c28f29cf248b17d480d13.stex


+ 3 - 0
.import/dowloadbackground.png-e479ad5f02bc7bbd34622f4733ff6bf8.md5

@@ -0,0 +1,3 @@
+source_md5="4951f2d52d8145b49e918faff9ee3128"
+dest_md5="857dc287e32938d22e24c8c945c221e9"
+

BIN
.import/dowloadbackground.png-e479ad5f02bc7bbd34622f4733ff6bf8.stex


+ 3 - 0
.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5

@@ -0,0 +1,3 @@
+source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
+dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
+

BIN
.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex


+ 13 - 0
Button.gd

@@ -0,0 +1,13 @@
+extends Button
+
+
+
+func _on_Button_button_down():
+	var PATH = OS.get_executable_path().get_base_dir().plus_file('run.bat')
+	print(PATH)
+	OS.execute(PATH, [], false)
+	
+#	OS.execute("F:/Users/Galo/Documents/GitHub/Game Export/launcher/run.bat", [], false)
+
+	yield(get_tree().create_timer(1.0), "timeout")
+	get_tree().quit()

+ 14 - 0
CheckBox.gd

@@ -0,0 +1,14 @@
+extends CheckBox
+
+func _ready():
+	if ResourceLoader.exists('user://patches/music.tres'):
+		var loader = load("user://patches/music.tres")
+		$AudioStreamPlayer.playing = loader.data[0]
+		pressed = loader.data[0]
+
+func _on_CheckBox_toggled(button_pressed):
+	$AudioStreamPlayer.playing = button_pressed
+	var data2 = load("res://dataresource.gd").new()
+	data2.data = [button_pressed]
+	ResourceSaver.save('user://patches/music.tres', data2)
+	pass # Replace with function body.

BIN
Helm.ogg


+ 15 - 0
Helm.ogg.import

@@ -0,0 +1,15 @@
+[remap]
+
+importer="ogg_vorbis"
+type="AudioStreamOGGVorbis"
+path="res://.import/Helm.ogg-3f6f1d0f76f599f2ecb6bc024b31a2f1.oggstr"
+
+[deps]
+
+source_file="res://Helm.ogg"
+dest_files=[ "res://.import/Helm.ogg-3f6f1d0f76f599f2ecb6bc024b31a2f1.oggstr" ]
+
+[params]
+
+loop=true
+loop_offset=0

BIN
Logo2small.png


+ 34 - 0
Logo2small.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/Logo2small.png-ca4ea4bd6feb2cda642f8d09d6f20643.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://Logo2small.png"
+dest_files=[ "res://.import/Logo2small.png-ca4ea4bd6feb2cda642f8d09d6f20643.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0

+ 3 - 0
dataresource.gd

@@ -0,0 +1,3 @@
+extends Resource
+
+export(Array) var data

+ 7 - 0
default_env.tres

@@ -0,0 +1,7 @@
+[gd_resource type="Environment" load_steps=2 format=2]
+
+[sub_resource type="ProceduralSky" id=1]
+
+[resource]
+background_mode = 2
+background_sky = SubResource( 1 )

BIN
dowloadbackground.png


+ 34 - 0
dowloadbackground.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/dowloadbackground.png-e479ad5f02bc7bbd34622f4733ff6bf8.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://dowloadbackground.png"
+dest_files=[ "res://.import/dowloadbackground.png-e479ad5f02bc7bbd34622f4733ff6bf8.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0

+ 42 - 0
export_presets.cfg

@@ -0,0 +1,42 @@
+[preset.0]
+
+name="Windows Desktop"
+platform="Windows Desktop"
+runnable=true
+custom_features=""
+export_filter="all_resources"
+include_filter=""
+exclude_filter=""
+export_path="../Game Export/launcher/GameLauncher.exe"
+patch_list=PoolStringArray(  )
+script_export_mode=1
+script_encryption_key=""
+
+[preset.0.options]
+
+texture_format/bptc=false
+texture_format/s3tc=true
+texture_format/etc=false
+texture_format/etc2=false
+texture_format/no_bptc_fallbacks=true
+binary_format/64_bits=true
+binary_format/embed_pck=false
+custom_template/release=""
+custom_template/debug=""
+codesign/enable=false
+codesign/identity_type=0
+codesign/identity=""
+codesign/password=""
+codesign/timestamp=true
+codesign/timestamp_server_url=""
+codesign/digest_algorithm=1
+codesign/description=""
+codesign/custom_options=PoolStringArray(  )
+application/icon=""
+application/file_version=""
+application/product_version=""
+application/company_name=""
+application/product_name=""
+application/file_description=""
+application/copyright=""
+application/trademarks=""

BIN
gamelauncher - Copia.zip


BIN
gamelauncher.7z


BIN
gamelauncher.zip


BIN
icon.png


+ 34 - 0
icon.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://icon.png"
+dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0

+ 81 - 0
launcher.gd

@@ -0,0 +1,81 @@
+extends Node
+
+var currentversion = 00
+var status = 0
+var downloaded_bytes = 0
+var body_size = 0
+var dowload = true
+
+export var versionfile = 'https://git.galodev.net/galo/ghosthandupdate/raw/master/version.json'
+export var pckfile = 'https://download1645.mediafire.com/u9zz5bf2gvng/e8fuz27b4t5uvvq/GhostHand.pck'
+
+func _ready():
+	if ResourceLoader.exists('user://patches/currentversion.tres'):
+		var loader = load("user://patches/currentversion.tres")
+		currentversion = loader.data[0]['version']
+		print(currentversion)
+	var directory = Directory.new()
+	if directory.dir_exists("user://patches"):
+		pass
+	else:
+		directory.make_dir("user://patches")
+	$HTTPRequest2.request(versionfile)
+
+func dowloadupdate():
+	print('dowloading patch')
+	$HTTPRequest.set_download_file('res://GhostHand.pck')
+	$HTTPRequest.request(pckfile)
+
+func _on_HTTPRequest_request_completed(result, response_code, headers, body):
+	if response_code == 200:
+		set_process(false)
+		$Label.text = 'your dowload just finished'
+		$Button.set_disabled(false)
+		$ProgressBar.value = 100
+#		ProjectSettings.load_resource_pack('user://patches/newpatch.pck')
+#		get_tree().change_scene_to(load("res://Login/Client.tscn"))
+	else:
+		server_connect_fail()
+
+func server_connect_fail():
+	$Label.text = 'server connection failure!'
+	print('failed to connect to server')
+#		if ResourceLoader.exists('user://patches/newpatch.pck'):
+#			ProjectSettings.load_resource_pack('user://patches/newpatch.pck')
+#		get_tree().change_scene_to(load("res://Login/Client.tscn"))
+
+func _on_HTTPRequest2_request_completed(result, response_code, headers, body):
+	if response_code == 200:
+		var data = JSON.parse(body.get_string_from_ascii())
+		var dataprocess = data.result
+		print(body.get_string_from_ascii())
+		print(dataprocess)
+		body_size = dataprocess['size']
+		var dict = Directory.new()
+		if dataprocess['version'] > currentversion:
+			dowloadupdate()
+			dowload = false
+			var data2 = load("res://dataresource.gd").new()
+			data2.data = [dataprocess]
+			ResourceSaver.save('user://patches/currentversion.tres', data2)
+		else:
+			print('no version to dowload')
+			$Label.text = 'you are on the most recent version!!!'
+			$Button.set_disabled(false)
+#			ProjectSettings.load_resource_pack('user://patches/newpatch.pck')
+#			get_tree().change_scene_to(load("res://Client/Client.tscn"))
+	else:
+		server_connect_fail()
+		$Label.text = 'server connection failure!'
+	pass # Replace with function body.
+
+func force_update():
+	dowloadupdate()
+	dowload = false
+
+func _process(delta):
+	status = $HTTPRequest.get_http_client_status()
+	downloaded_bytes = $HTTPRequest.get_downloaded_bytes()
+	if not dowload:
+		$Label.text = 'dowloading '+str(downloaded_bytes/1024) +' kbs of '+ str(int(body_size)/1024) +' kbs'
+		$ProgressBar.value = downloaded_bytes*100/body_size

+ 122 - 0
launcher.tscn

@@ -0,0 +1,122 @@
+[gd_scene load_steps=8 format=2]
+
+[ext_resource path="res://launcher.gd" type="Script" id=1]
+[ext_resource path="res://dowloadbackground.png" type="Texture" id=2]
+[ext_resource path="res://yoster.ttf" type="DynamicFontData" id=3]
+[ext_resource path="res://CheckBox.gd" type="Script" id=4]
+[ext_resource path="res://Helm.ogg" type="AudioStream" id=5]
+[ext_resource path="res://Button.gd" type="Script" id=6]
+
+[sub_resource type="DynamicFont" id=1]
+size = 12
+font_data = ExtResource( 3 )
+
+[node name="Node" type="Node"]
+script = ExtResource( 1 )
+
+[node name="HTTPRequest" type="HTTPRequest" parent="."]
+
+[node name="HTTPRequest2" type="HTTPRequest" parent="."]
+
+[node name="dowloadbackground" type="Sprite" parent="."]
+modulate = Color( 1, 1, 1, 0.352941 )
+texture = ExtResource( 2 )
+centered = false
+
+[node name="ColorRect" type="ColorRect" parent="dowloadbackground"]
+use_parent_material = true
+anchor_right = 1.0
+anchor_bottom = 1.0
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="ProgressBar" type="ProgressBar" parent="."]
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+margin_left = -100.0
+margin_top = -24.6051
+margin_right = 100.0
+margin_bottom = -10.6051
+custom_fonts/font = SubResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Sprite" type="Sprite" parent="."]
+position = Vector2( 0, -18.3543 )
+
+[node name="Label" type="Label" parent="."]
+anchor_top = 0.5
+anchor_right = 1.0
+anchor_bottom = 0.5
+margin_top = -7.0
+margin_bottom = 7.0
+rect_pivot_offset = Vector2( 95.3067, 6.6933 )
+custom_fonts/font = SubResource( 1 )
+text = "Checking most recent version!"
+align = 1
+valign = 1
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Button" type="Button" parent="."]
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+margin_left = -30.0
+margin_top = 45.2357
+margin_right = 30.0
+margin_bottom = 65.2357
+custom_fonts/font = SubResource( 1 )
+disabled = true
+text = "launch"
+script = ExtResource( 6 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Button2" type="Button" parent="."]
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+margin_left = -54.5
+margin_top = 83.2327
+margin_right = 54.5
+margin_bottom = 103.233
+custom_fonts/font = SubResource( 1 )
+text = "force update"
+script = ExtResource( 6 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="CheckBox" type="CheckBox" parent="."]
+anchor_left = 0.5
+anchor_top = 0.5
+anchor_right = 0.5
+anchor_bottom = 0.5
+margin_left = -33.0
+margin_top = 11.8171
+margin_right = 33.0
+margin_bottom = 35.8171
+custom_fonts/font = SubResource( 1 )
+pressed = true
+text = "music"
+script = ExtResource( 4 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="CheckBox"]
+stream = ExtResource( 5 )
+[connection signal="request_completed" from="HTTPRequest" to="." method="_on_HTTPRequest_request_completed"]
+[connection signal="request_completed" from="HTTPRequest2" to="." method="_on_HTTPRequest2_request_completed"]
+[connection signal="button_down" from="Button" to="Button" method="_on_Button_button_down"]
+[connection signal="button_down" from="Button2" to="." method="force_update"]
+[connection signal="toggled" from="CheckBox" to="CheckBox" method="_on_CheckBox_toggled"]

+ 33 - 0
project.godot

@@ -0,0 +1,33 @@
+; 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=4
+
+_global_script_classes=[  ]
+_global_script_class_icons={
+
+}
+
+[application]
+
+config/name="gamelauncher"
+run/main_scene="res://launcher.tscn"
+config/icon="res://Logo2small.png"
+
+[display]
+
+window/size/width=360
+window/size/height=512
+window/size/resizable=false
+
+[rendering]
+
+quality/driver/driver_name="GLES2"
+vram_compression/import_etc=true
+vram_compression/import_etc2=false
+environment/default_environment="res://default_env.tres"

BIN
yoster.ttf