فهرست منبع

increased speed 32x, added functionality of seeing current speed

galo 2 سال پیش
والد
کامیت
1d7a877419
3فایلهای تغییر یافته به همراه22 افزوده شده و 8 حذف شده
  1. 8 1
      launcher.gd
  2. 9 7
      launcher.tscn
  3. 5 0
      project.godot

+ 8 - 1
launcher.gd

@@ -83,9 +83,16 @@ func force_update():
 	dowloadupdate()
 	dowload = false
 
+var buffer = 0.0
+var buffertext = ''
+
 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'
+		$Label.text = 'dowloading '+String.humanize_size(downloaded_bytes) +' of '+String.humanize_size(body_size)
+		if (downloaded_bytes-buffer)/delta != 0:
+			buffertext = '\n' + ' at speed ' + String.humanize_size(float(downloaded_bytes-buffer)/delta) + '/s'
+		$Label.text += buffertext
+		buffer = downloaded_bytes
 		$ProgressBar.value = downloaded_bytes*100/body_size

+ 9 - 7
launcher.tscn

@@ -15,6 +15,7 @@ font_data = ExtResource( 3 )
 script = ExtResource( 1 )
 
 [node name="HTTPRequest" type="HTTPRequest" parent="."]
+download_chunk_size = 65536
 
 [node name="HTTPRequest2" type="HTTPRequest" parent="."]
 
@@ -53,12 +54,13 @@ anchor_top = 0.5
 anchor_right = 1.0
 anchor_bottom = 0.5
 margin_top = -7.0
-margin_bottom = 7.0
+margin_bottom = 46.0
 rect_pivot_offset = Vector2( 95.3067, 6.6933 )
 custom_fonts/font = SubResource( 1 )
 text = "Checking most recent version!"
 align = 1
 valign = 1
+autowrap = true
 __meta__ = {
 "_edit_use_anchors_": false
 }
@@ -69,9 +71,9 @@ anchor_top = 0.5
 anchor_right = 0.5
 anchor_bottom = 0.5
 margin_left = -30.0
-margin_top = 45.2357
+margin_top = 85.9482
 margin_right = 30.0
-margin_bottom = 65.2357
+margin_bottom = 105.948
 custom_fonts/font = SubResource( 1 )
 disabled = true
 text = "launch"
@@ -86,9 +88,9 @@ anchor_top = 0.5
 anchor_right = 0.5
 anchor_bottom = 0.5
 margin_left = -54.5
-margin_top = 83.2327
+margin_top = 123.945
 margin_right = 54.5
-margin_bottom = 103.233
+margin_bottom = 143.946
 custom_fonts/font = SubResource( 1 )
 text = "force update"
 script = ExtResource( 6 )
@@ -102,9 +104,9 @@ anchor_top = 0.5
 anchor_right = 0.5
 anchor_bottom = 0.5
 margin_left = -33.0
-margin_top = 11.8171
+margin_top = 52.5296
 margin_right = 33.0
-margin_bottom = 35.8171
+margin_bottom = 76.5296
 custom_fonts/font = SubResource( 1 )
 pressed = true
 text = "music"

+ 5 - 0
project.godot

@@ -19,11 +19,16 @@ config/name="gamelauncher"
 run/main_scene="res://launcher.tscn"
 config/icon="res://Logo2small.png"
 
+[debug]
+
+settings/fps/force_fps=120
+
 [display]
 
 window/size/width=360
 window/size/height=512
 window/size/resizable=false
+window/vsync/use_vsync=false
 
 [rendering]