Skip to content
Snippets Groups Projects
Commit dbb10dae authored by SCHIEBER MORGANE's avatar SCHIEBER MORGANE :fries:
Browse files

correct the display function + can't avoid the delay of the displaying of the list

parent f7d69e45
Branches
Tags
No related merge requests found
[gd_resource type="Theme" load_steps=2 format=2]
[gd_resource type="Theme" load_steps=4 format=2]
[ext_resource path="res://levels/commons/fonts/montserrat/Montserrat-SemiBold.otf" type="DynamicFontData" id=1]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.0509804, 0.0509804, 0.0509804, 1 )
......@@ -7,7 +9,20 @@ corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[sub_resource type="DynamicFont" id=2]
font_data = ExtResource( 1 )
[resource]
default_font = SubResource( 2 )
Label/colors/font_color = Color( 1, 1, 1, 1 )
Label/colors/font_color_shadow = Color( 0, 0, 0, 0 )
Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 )
Label/constants/line_spacing = 3
Label/constants/shadow_as_outline = 0
Label/constants/shadow_offset_x = 1
Label/constants/shadow_offset_y = 1
Label/fonts/font = null
Label/styles/normal = null
Panel/styles/panel = SubResource( 1 )
Panel/styles/panelf = null
Panel/styles/panelnc = null
......@@ -3,9 +3,11 @@ extends Control
var LISTPLAYER
var PLAYERDISPLAY
var PRESSED = 1
var profilePic = preload("res://models/listPlayer/profile.png")
var t = preload("res://models/listPlayer/testTheme.tres")
var panelTheme = preload("res://models/listPlayer/panelAddFriends.tres")
#var themePseudo = preload("res://levels/commons/themes/labelSkillFont.tres")
var panelTheme = preload("res://levels/commons/themes/panelAddFriends.tres")
# pour le moment c'est moche, dsl
# c'est à cause des thèmes
......@@ -13,25 +15,34 @@ var panelTheme = preload("res://models/listPlayer/panelAddFriends.tres")
func _ready():
LISTPLAYER = $listPlayers/Panel/MarginContainer/VBoxContainer/playerContainer/marginPlayer/playersList
PLAYERDISPLAY = $listPlayers
displayListPlayer()
# listPlayer is a list like [[player1,char],[player2,char],...]
var listPlayer = []
# Total of players in the game
var nbPlayers = 16
displayListPlayer([],16)
#set_process_input(true)
func _input(ev):
if ev is InputEventKey :
if ev is InputEventKey:
#if not(ev.is_echo()) and ev.get_scancode() == 16777218:
#(print(OS.get_scancode_string(ev.scancode)))
#print("bruh")
#PLAYERDISPLAY.visible = true
if ev.is_echo() and ev.get_scancode() == 16777218:
#(print(OS.get_scancode_string(ev.scancode)))
PLAYERDISPLAY.visible = true
else:
PLAYERDISPLAY.visible = false
# display the player list
func displayListPlayer():
# on recup les players de la game en cours dans cette fonction
# pour le moment idk comment on les recup
for i in range(0,15):
# Display the player list
func displayListPlayer(listPlayer,nbPlayers):
for i in range(0,nbPlayers-1):
addPlayer("salu","Paco le roi du disco")
# We'll used this instead
# addPlayer(listPlayer[i][0],listPlayer[i][1])
# Add the player and the character played in the player list
func addPlayer(playerName,characterPlayed):
var pseudo = ""+playerName+" - "+characterPlayed+""
# Create the objects to add
......@@ -56,10 +67,10 @@ func addPlayer(playerName,characterPlayed):
newPanel.set_custom_minimum_size(Vector2(newPanel.get_size().x,30))
## Pseudo
newPanel.set_name(playerName)
#newPseudo.set_theme(themePseudo)
newPseudo.set_text(pseudo)
newPseudo.set_h_size_flags(3)
newPseudo.set_v_size_flags(4)
#newPseudo.set_theme(t)
## Profile icon
newTextureProfile.set_normal_texture(profilePic)
newTextureProfile.set_expand(true)
......
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://levels/hud/hudListPlayers.gd" type="Script" id=1]
[ext_resource path="res://models/listPlayer/bgTestTmp.jpg" type="Texture" id=2]
[ext_resource path="res://levels/hud/hudListPlayers.tres" type="StyleBox" id=3]
[ext_resource path="res://levels/hud/assets/backgdListPlayers.png" type="Texture" id=4]
[ext_resource path="res://models/listPlayer/fibre-font.otf" type="DynamicFontData" id=5]
<<<<<<< HEAD
[ext_resource path="res://models/listPlayer/themes_sliderContainer.tres" type="Theme" id=6]
[ext_resource path="res://levels/commons/fonts/montserrat/Montserrat-SemiBold.otf" type="DynamicFontData" id=7]
[sub_resource type="DynamicFont" id=1]
size = 40
extra_spacing_char = 1
extra_spacing_space = 2
font_data = ExtResource( 5 )
[sub_resource type="DynamicFont" id=2]
font_data = ExtResource( 7 )
[sub_resource type="Theme" id=3]
default_font = SubResource( 2 )
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
......@@ -117,4 +124,5 @@ margin_left = 15.0
margin_top = 5.0
margin_right = 789.0
margin_bottom = 315.0
theme = SubResource( 3 )
custom_constants/separation = 10
[gd_resource type="Theme" load_steps=2 format=2]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.0509804, 0.0509804, 0.0509804, 1 )
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
[resource]
Panel/styles/panel = SubResource( 1 )
Panel/styles/panelf = null
Panel/styles/panelnc = null
[gd_resource type="Theme" load_steps=4 format=2]
[gd_resource type="Theme" load_steps=6 format=2]
[ext_resource path="res://levels/addFriendsMulti/assets/grabbergrab.png" type="Texture" id=1]
[ext_resource path="res://levels/addFriendsMulti/assets/scrollbar.png" type="Texture" id=2]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.756863, 0.294118, 0.917647, 1 )
......@@ -12,7 +15,8 @@ content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
region_rect = Rect2( 0, 0, 11, 250 )
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 36, 500 )
axis_stretch_vertical = 2
[sub_resource type="StyleBoxTexture" id=3]
......@@ -20,6 +24,7 @@ content_margin_left = 2.0
content_margin_right = 2.0
content_margin_top = 0.0
content_margin_bottom = 0.0
texture = ExtResource( 2 )
region_rect = Rect2( 0, 0, 11, 329 )
[resource]
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment