Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
release 1.43
Browse files Browse the repository at this point in the history
  • Loading branch information
superRaptor911 committed Aug 26, 2020
1 parent 2281dfe commit ec5f7f0
Show file tree
Hide file tree
Showing 22 changed files with 307 additions and 142 deletions.
3 changes: 3 additions & 0 deletions Maps/BaseLevel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ signal bot_removed(bot)

export var Level_Name = "no_name"
export var capture_mod = false
# author , INC = "preinstalled"
export var author = "INC"


var team1 = preload("res://Objects/scripts/Team.gd").new(0,self)
var team2 = preload("res://Objects/scripts/Team.gd").new(1,self)
Expand Down
7 changes: 7 additions & 0 deletions Menus/Editor/LevelEditorMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func _on_convert_pressed():
level_node.name = "Level"
level_node.set_script(load("res://Maps/BaseLevel.gd"))
level_node.Level_Name = map_name
level_node.author = String(OS.get_unique_id())
level_node.add_to_group("Level", true)
final_level.add_child(level_node)
level_node.owner = final_level
Expand Down Expand Up @@ -91,6 +92,7 @@ func _on_convert_pressed():
level_node.name = "Level"
level_node.set_script(load("res://Maps/BaseLevel.gd"))
level_node.Level_Name = map_name
level_node.author = String(OS.get_unique_id())
level_node.add_to_group("Level", true)
final_level.add_child(level_node)
level_node.owner = final_level
Expand Down Expand Up @@ -138,6 +140,11 @@ func _on_convert_pressed():
return
var save_path = "user://custom_maps/" + game_server.serverInfo.map + ".dat"
game_states.save_data(save_path, levelInfo, false)

var notice = Notice.new()
notice.showNotice(self, "Generated !",
"Your map was generated. You can now play your map in New Game", Color.white, Color.green)



func _on_more_pressed():
Expand Down
1 change: 1 addition & 0 deletions Menus/HUD/Hud.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ __meta__ = {
}

[node name="admin_menu" type="Button" parent="pause_menu/container"]
visible = false
margin_top = 180.0
margin_right = 260.0
margin_bottom = 230.0
Expand Down
41 changes: 38 additions & 3 deletions Menus/Lobby/Lobby.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ var selected_gameMode = ["",""]
var selected_gameMode_id = 0




func _ready():
game_server.bot_settings.bot_count = 0
game_server.bot_settings.bot_difficulty = 1
loadLevelInfos()
loadCustomMaps()
loadDownloadedMaps()
network.connect("player_removed", self, "_on_player_removed")
#show IP address
for i in IP.get_local_addresses():
Expand Down Expand Up @@ -54,15 +53,48 @@ func loadCustomMaps():
var data = game_states.load_data("user://custom_maps/"+file_name, false)
var img = Image.new()
img.load(data.icon)
print(data.icon)
var img_tex = ImageTexture.new()
img_tex.create_from_image(img)
data.icon = img_tex
data.author = String(OS.get_unique_id())
levels.append(data)

file_name = dir.get_next()


func loadDownloadedMaps():
print("Loading Download")
var download_dir = "user://downloads/"
var authors_dir = Directory.new()
authors_dir.open(download_dir)

authors_dir.list_dir_begin()
var author_id = authors_dir.get_next()

while author_id != "":
if authors_dir.current_is_dir() and author_id != "." and author_id != "..":
var dir = Directory.new()
dir.open(download_dir + author_id + "/custom_maps/")
dir.list_dir_begin()
var file_name : String= dir.get_next()

while file_name != "":
if not dir.current_is_dir() and file_name != "." and file_name != "..":
if file_name.get_extension() == "dat":
var data = game_states.load_data(download_dir + author_id + "/custom_maps/" + file_name, false)
var img = Image.new()
img.load(data.icon)
print(download_dir + author_id + "/custom_maps/" + file_name)
var img_tex = ImageTexture.new()
img_tex.create_from_image(img)
data.icon = img_tex
data.author = author_id
levels.append(data)

file_name = dir.get_next()
author_id = authors_dir.get_next()


func setLevelInfo(info):
if selected_level != info:
selected_level = info
Expand Down Expand Up @@ -91,6 +123,9 @@ func setGameModeInfo(info):
func _start_game():
game_server.serverInfo.map = selected_level.name
game_server.serverInfo.game_mode = selected_gameMode[0]
if selected_level.has("author"):
game_server.serverInfo.author = selected_level.author

network.serverAvertiser.serverInfo = game_server.serverInfo
network.add_child(network.serverAvertiser)
get_tree().change_scene(selected_gameMode[1])
Expand Down
4 changes: 4 additions & 0 deletions Menus/MainMenu/ExtrasMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ func _on_msgDev_pressed():
UiAnim.animZoomOut([$bug, $back])
yield(get_tree().create_timer(0.5 * UiAnim.anim_scale), "timeout")
MenuManager.changeScene("Extras/MsgDev")


func _on_rate_pressed():
OS.shell_open("https://play.google.com/store/apps/details?id=com.raptor.inc")
58 changes: 38 additions & 20 deletions Menus/MainMenu/ExtrasMenu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ __meta__ = {
}

[node name="src_code" type="Button" parent="."]
anchor_left = 0.368
anchor_top = 0.546
anchor_right = 0.637
anchor_bottom = 0.662
margin_left = 0.499725
margin_top = 0.25705
margin_right = 8.17975
margin_bottom = -0.26297
anchor_left = 0.369
anchor_top = 0.511
anchor_right = 0.643
anchor_bottom = 0.594
margin_left = 0.554565
margin_top = 0.0950928
margin_right = 1.83459
margin_bottom = 0.335083
custom_styles/pressed = SubResource( 2 )
custom_styles/normal = SubResource( 2 )
custom_fonts/font = ExtResource( 1 )
Expand All @@ -76,14 +76,14 @@ __meta__ = {
}

[node name="bug" type="Button" parent="."]
anchor_left = 0.328
anchor_top = 0.736
anchor_right = 0.701
anchor_bottom = 0.855
margin_left = -0.16156
margin_top = 0.010498
margin_right = -0.601562
margin_bottom = 0.330505
anchor_left = 0.322
anchor_top = 0.669
anchor_right = 0.695
anchor_bottom = 0.753
margin_left = -0.160034
margin_top = 0.319977
margin_right = -0.600098
margin_bottom = -0.160034
custom_styles/pressed = SubResource( 2 )
custom_styles/normal = SubResource( 2 )
custom_fonts/font = ExtResource( 1 )
Expand All @@ -92,15 +92,32 @@ __meta__ = {
"_edit_use_anchors_": false
}

[node name="rate" type="Button" parent="."]
anchor_left = 0.32
anchor_top = 0.832
anchor_right = 0.695
anchor_bottom = 0.915
margin_left = 0.399963
margin_top = -0.0400391
margin_right = -0.600098
margin_bottom = 0.200012
custom_styles/pressed = SubResource( 2 )
custom_styles/normal = SubResource( 2 )
custom_fonts/font = ExtResource( 1 )
text = "Rate "
__meta__ = {
"_edit_use_anchors_": false
}

[node name="msgDev" type="Button" parent="."]
anchor_left = 0.336
anchor_top = 0.327
anchor_right = 0.666
anchor_bottom = 0.447
anchor_right = 0.667
anchor_bottom = 0.425
margin_left = 0.242157
margin_top = 0.258316
margin_right = 0.842224
margin_bottom = -0.141693
margin_right = -0.437927
margin_bottom = -0.301697
custom_styles/pressed = SubResource( 2 )
custom_styles/normal = SubResource( 2 )
custom_fonts/font = ExtResource( 1 )
Expand All @@ -127,5 +144,6 @@ __meta__ = {
}
[connection signal="pressed" from="src_code" to="." method="_on_src_code_pressed"]
[connection signal="pressed" from="bug" to="." method="_on_bug_pressed"]
[connection signal="pressed" from="rate" to="." method="_on_rate_pressed"]
[connection signal="pressed" from="msgDev" to="." method="_on_msgDev_pressed"]
[connection signal="pressed" from="back" to="." method="_on_back_pressed"]
4 changes: 4 additions & 0 deletions Menus/MainMenu/MainMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ func _on_extras_pressed():
func _on_lev_edit_pressed():
MusicMan.click()
MenuManager.changeScene("EditorMapSelector")


func _on_community_pressed():
MenuManager.changeScene("CommunityMenu")
2 changes: 1 addition & 1 deletion Menus/MainMenu/MainMenu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,5 @@ __meta__ = {
[connection signal="pressed" from="VBoxContainer/store" to="." method="_on_store_pressed"]
[connection signal="pressed" from="VBoxContainer/Button3" to="." method="_on_Button3_pressed"]
[connection signal="pressed" from="VBoxContainer/lev_edit" to="." method="_on_lev_edit_pressed"]
[connection signal="pressed" from="VBoxContainer/community" to="." method="_on_lev_edit_pressed"]
[connection signal="pressed" from="VBoxContainer/community" to="." method="_on_community_pressed"]
[connection signal="pressed" from="extras" to="." method="_on_extras_pressed"]
25 changes: 13 additions & 12 deletions Menus/MainMenu/NewGame.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[ext_resource path="res://Menus/resources/red_btn.tres" type="StyleBox" id=6]
[ext_resource path="res://font_s28.tres" type="DynamicFont" id=7]

[sub_resource type="StyleBoxFlat" id=7]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.290196, 0.290196, 0.290196, 0.607843 )
corner_radius_top_left = 10
corner_radius_top_right = 10
Expand Down Expand Up @@ -41,39 +41,40 @@ margin_top = 0.159988
margin_right = -0.400024
margin_bottom = -0.160034
rect_pivot_offset = Vector2( 265.194, 202.474 )
custom_styles/panel = SubResource( 7 )
custom_styles/panel = SubResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Button" type="Button" parent="Panel"]
anchor_left = 0.207
anchor_top = 0.211
anchor_top = 0.602
anchor_right = 0.793
anchor_bottom = 0.404
anchor_bottom = 0.794
margin_left = 0.0319901
margin_top = 0.121002
margin_right = -0.0320129
margin_bottom = -0.0792084
margin_top = -0.102783
margin_right = -0.0320435
margin_bottom = 0.0970154
custom_styles/hover = ExtResource( 2 )
custom_styles/pressed = ExtResource( 2 )
custom_styles/focus = ExtResource( 2 )
custom_styles/normal = ExtResource( 2 )
custom_fonts/font = SubResource( 2 )
disabled = true
text = "Join Lan"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Button2" type="Button" parent="Panel"]
anchor_left = 0.207
anchor_top = 0.585
anchor_top = 0.17
anchor_right = 0.793
anchor_bottom = 0.777
margin_left = 0.0319901
margin_top = -0.0186005
anchor_bottom = 0.363
margin_left = 0.0320053
margin_top = 0.0612411
margin_right = -0.0320129
margin_bottom = 0.181396
margin_bottom = -0.138748
custom_styles/hover = ExtResource( 2 )
custom_styles/pressed = ExtResource( 2 )
custom_styles/focus = ExtResource( 2 )
Expand Down
Loading

0 comments on commit ec5f7f0

Please sign in to comment.