Skip to content

Commit

Permalink
attempt to reduce size for phones (Godot 3 TSBTool web export)
Browse files Browse the repository at this point in the history
  • Loading branch information
BAD-AL committed Jul 10, 2024
1 parent 305cb7a commit 53d8fbb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TSBProjects/TSBTool_Godot_3/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.import
.mono
.vs
Export/Win64/
Export/
*.user
launchSettings.json
28 changes: 28 additions & 0 deletions TSBProjects/TSBTool_Godot_3/Forms/main_panel.gd
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
extends Panel

var myCallback:JavaScriptObject
var textureRect:TextureRect

"""
Screen reduction stuff
"""
func check_screen_size():
var screen_width = OS.get_window_size().x
print("check_screen_size")
if screen_width < 800:
hide_element()
else:
show_element()

func _on_resized():
check_screen_size()

func hide_element():
textureRect.hide()

func show_element():
textureRect.show()


# Called when the node enters the scene tree for the first time.
func _ready():
disable_buttons()
#setup
textureRect = $MarginContainer/VBoxContainer/middlePanel/HBoxContainer/TextureRect
print("main_panel._ready() os :" + OS.get_name())
var tecmoControl = $MarginContainer/VBoxContainer/bottomPanel/tecmoControl
print("main_panel._ready() C# message:" + tecmoControl.TecmoHelper.GetMessageFromCSharp())
Globals.tecmoHelper = tecmoControl.TecmoHelper
# Screen size stuff
check_screen_size()
get_tree().get_root().connect("size_changed", self, "_on_resized")

if OS.get_name() == "HTML5":
myCallback = JavaScript.create_callback(self, "fileLoaded")
Expand Down Expand Up @@ -193,3 +220,4 @@ func fileLoaded(args:Array):
Globals.tecmoHelper.LoadRomBytesFromBase64String(base64String)
enable_buttons()


2 changes: 1 addition & 1 deletion docs/TSBTool_Godot_3/TSBTool_Godot3.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<script type='text/javascript' src='TSBTool_Godot3.js'></script>
<script type='text/javascript'>//<![CDATA[

const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"TSBTool_Godot3","experimentalVK":false,"fileSizes":{"TSBTool_Godot3.pck":19386000,"TSBTool_Godot3.wasm":26067241},"focusCanvas":true,"gdnativeLibs":[]};
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"TSBTool_Godot3","experimentalVK":false,"fileSizes":{"TSBTool_Godot3.pck":19703984,"TSBTool_Godot3.wasm":18795755},"focusCanvas":true,"gdnativeLibs":[]};
var engine = new Engine(GODOT_CONFIG);

(function() {
Expand Down
2 changes: 1 addition & 1 deletion docs/TSBTool_Godot_3/TSBTool_Godot3.js

Large diffs are not rendered by default.

Binary file modified docs/TSBTool_Godot_3/TSBTool_Godot3.pck
Binary file not shown.
Binary file modified docs/TSBTool_Godot_3/TSBTool_Godot3.wasm
Binary file not shown.

0 comments on commit 53d8fbb

Please sign in to comment.