Improved map render logic

This commit is contained in:
Paul Black 2023-05-11 11:09:33 -06:00
parent 943c6bd49c
commit 211cf8f9c2
6 changed files with 105 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://6g3ltm1o5q38"
path="res://.godot/imported/forest.png-cf2d64c64f8a560645ae1c6d8cccffdd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://2DArt/host/mapIcons/forest.png"
dest_files=["res://.godot/imported/forest.png-cf2d64c64f8a560645ae1c6d8cccffdd.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://888gbreh0kwg"
path="res://.godot/imported/toyfactory.png-4d4b37de3d162cee44a0b19f3282eaf6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://2DArt/host/mapIcons/toyfactory.png"
dest_files=["res://.godot/imported/toyfactory.png-4d4b37de3d162cee44a0b19f3282eaf6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -1,9 +1,11 @@
[gd_scene load_steps=6 format=3 uid="uid://cv5bctupikqe7"]
[gd_scene load_steps=8 format=3 uid="uid://cv5bctupikqe7"]
[ext_resource type="Script" path="res://scripts/host.gd" id="1_r5rkm"]
[ext_resource type="Texture2D" uid="uid://b8hvwlbkrib4k" path="res://2DArt/Main Menu/PlayScreenHOST.png" id="2_s15iu"]
[ext_resource type="Texture2D" uid="uid://bmyat8a6alp2y" path="res://2DArt/host/mapIcons/toyland.png" id="3_rgmyq"]
[ext_resource type="Texture2D" uid="uid://br7n6qfnfpm4v" path="res://2DArt/host/mapIcons/islands.png" id="4_gvop1"]
[ext_resource type="Texture2D" uid="uid://6g3ltm1o5q38" path="res://2DArt/host/mapIcons/forest.png" id="5_4jx7h"]
[ext_resource type="Texture2D" uid="uid://888gbreh0kwg" path="res://2DArt/host/mapIcons/toyfactory.png" id="6_y4i2t"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xhmtq"]
@ -212,6 +214,18 @@ position = Vector2(407.969, 287.031)
scale = Vector2(0.110227, 0.110227)
texture = ExtResource("4_gvop1")
[node name="Forest" type="Sprite2D" parent="."]
visible = false
position = Vector2(407.875, 287.125)
scale = Vector2(0.125156, 0.125156)
texture = ExtResource("5_4jx7h")
[node name="Toyfactory" type="Sprite2D" parent="."]
visible = false
position = Vector2(408, 287)
scale = Vector2(0.10025, 0.10025)
texture = ExtResource("6_y4i2t")
[node name="Label2" type="Label" parent="."]
layout_mode = 0
offset_left = 351.0

View file

@ -18,8 +18,7 @@ func _on_playground_pressed():
$mapSelected.text = "Toyland"
Global.mapName = "Toyland"
SCENE = "res://scenes/toyland.tscn"
$Toyland.visible = true
$Islands.visible = false
toggle_map_render("toyland")
func _on_islands_pressed():
$mapSelected.text = "Islands"
@ -27,11 +26,19 @@ func _on_islands_pressed():
SCENE = "res://scenes/islands.tscn"
$Islands.visible = true
$Toyland.visible = false
toggle_map_render("islands")
func _on_forrest_button_pressed():
$mapSelected.text = "Forest"
Global.mapName = "Forrest"
SCENE = "res://scenes/forrest.tscn"
toggle_map_render("forest")
func _on_toyfactory_button_pressed():
$mapSelected.text = "Toy Factory"
Global.mapName = "toyfactory"
SCENE = "res://scenes/toyfactory.tscn"
toggle_map_render("toyfactory")
func _on_start_button_pressed():
var PORT = $portBox.text
@ -126,7 +133,16 @@ func _on_round_timer_text_changed(new_text):
Global.roundTimer = int(seconds)
func _on_toyfactory_button_pressed():
$mapSelected.text = "Toy Factory"
Global.mapName = "toyfactory"
SCENE = "res://scenes/toyfactory.tscn"
func toggle_map_render(map):
$Toyland.visible = false
$Islands.visible = false
$Forest.visible = false
$Toyfactory.visible = false
if map == "toyland":
$Toyland.visible = true
elif map == "islands":
$Islands.visible = true
elif map == "forest":
$Forest.visible = true
elif map == "toyfactory":
$Toyfactory.visible = true