diff --git a/client/levels/hud/hud.gd b/client/levels/hud/hud.gd index cda4818b26e6cdaf3600248b5f49aa732b8c5270..22e8c89ce86720dc3445b441773c763fa87fd78d 100644 --- a/client/levels/hud/hud.gd +++ b/client/levels/hud/hud.gd @@ -5,12 +5,13 @@ var PLAYERDISPLAY var SETTINGSDISPLAY +var MOBILEPLAYERSBUTTON +var MOBILESETTINGSBUTON + var profilePic = preload("res://models/listPlayer/profile.png") var t = preload("res://models/listPlayer/testTheme.tres") var panelTheme = preload("res://levels/commons/themes/panelAddFriends.tres") -# pour le moment c'est moche, dsl -# c'est à cause des thèmes var userDamages var userName var userImg @@ -21,6 +22,8 @@ func _ready(): LISTPLAYER = $listPlayers/Panel/MarginContainer/VBoxContainer/playerContainer/marginPlayer/playersList PLAYERDISPLAY = $listPlayers SETTINGSDISPLAY = $settings + MOBILEPLAYERSBUTTON = $playerlistZone + MOBILESETTINGSBUTON = $settingsZone userDamages = $MarginContainer/VBoxContainer/bas/stats/percent userName = $MarginContainer/VBoxContainer/bas/stats/VBoxContainer/name userImg = $MarginContainer/VBoxContainer/bas/stats/VBoxContainer/pic @@ -28,7 +31,22 @@ func _ready(): inventory = $MarginContainer/VBoxContainer/bas/stats/inventaire/obj displayListPlayer() displayNbKills() - showInventory("res://models/icon.png") + showInventory("res://models/icon.png") + + # Mobile HUD connections + MOBILEPLAYERSBUTTON.connect("pressed", self, "buttonMobile", ["playerList"]) + MOBILESETTINGSBUTON.connect("pressed", self, "buttonMobile", ["settings"]) + + +func buttonMobile(button_name): + if button_name == "playerList" && SETTINGSDISPLAY.visibility == false && PLAYERDISPLAY.visibility == false: + PLAYERDISPLAY.visibility = true + if button_name == "playerList" && SETTINGSDISPLAY.visibility == false && PLAYERDISPLAY.visibility == true: + PLAYERDISPLAY.visibility = false + if button_name == "settings" && SETTINGSDISPLAY.visibility == false && PLAYERDISPLAY.visibility == false: + SETTINGSDISPLAY.visibility = true + if button_name == "settings" && SETTINGSDISPLAY.visibility == true && PLAYERDISPLAY.visibility == false: + SETTINGSDISPLAY.visibility = false func _input(ev): if ev is InputEventKey : diff --git a/client/levels/hud/hud.tscn b/client/levels/hud/hud.tscn index 53fb9b1794c4084ef0935c244e6588a349a9836e..604c8bf0a278a021940e7789e2824e023eed0895 100644 --- a/client/levels/hud/hud.tscn +++ b/client/levels/hud/hud.tscn @@ -14,19 +14,15 @@ [sub_resource type="StreamTexture" id=1] flags = 4 -load_path = "res://.import/hud_bg2.png-3c6e0009587ce068b78ff42b6d42129a.stex" [sub_resource type="StreamTexture" id=2] flags = 4 -load_path = "res://.import/hud_bg1.png-c137c7c9656bbc9c3f36f041e130cb80.stex" [sub_resource type="StreamTexture" id=3] flags = 4 -load_path = "res://.import/disco.png-7887829e2bd295b181d2ab6939359ff1.stex" [sub_resource type="StreamTexture" id=4] flags = 4 -load_path = "res://.import/case.png-3b77851e53283d3fff3d8edc79644146.stex" [sub_resource type="StreamTexture" id=5] @@ -100,6 +96,25 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="playerlistZone" type="Button" parent="."] +margin_right = 309.0 +margin_bottom = 201.0 +flat = true +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} + +[node name="settingsZone" type="Button" parent="."] +anchor_left = 1.0 +anchor_right = 1.0 +margin_left = -309.0 +margin_bottom = 201.0 +flat = true +__meta__ = { +"_edit_use_anchors_": false +} + [node name="bg_hud2" type="TextureRect" parent="."] anchor_left = 1.0 anchor_top = 1.0 @@ -845,3 +860,10 @@ text = " APPLIQUER " [node name="AnimationPlayer" type="AnimationPlayer" parent="settings"] autoplay = "fade in" + +[node name="MarginContainer2" type="MarginContainer" parent="."] +margin_right = 40.0 +margin_bottom = 40.0 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/client/levels/lobby/lobby.tscn b/client/levels/lobby/lobby.tscn index e1e470aa853ca5b3326c5917316fbeb9aed32d3a..08aa6fe24debf294b038ba04020254d9963505ab 100644 --- a/client/levels/lobby/lobby.tscn +++ b/client/levels/lobby/lobby.tscn @@ -104,7 +104,7 @@ margin_bottom = 115.0 size_flags_horizontal = 3 size_flags_vertical = 3 theme = ExtResource( 4 ) -text = "It's the final countdown +text = "It`s the final countdown " align = 1 valign = 1