Skip to content

Commit

Permalink
Merge pull request #129 from tecMTST/128-rework-feed-de-noticias
Browse files Browse the repository at this point in the history
novo menu feed de noticias finalizado
  • Loading branch information
mihailov-vf authored Aug 22, 2024
2 parents 7288f54 + e9319ab commit 339abb0
Show file tree
Hide file tree
Showing 67 changed files with 256 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ content_margin_left = 10.0
content_margin_right = 10.0
content_margin_top = 10.0
content_margin_bottom = 10.0
bg_color = Color( 0.2, 0.23, 0.31, 1 )
bg_color = Color( 0.364706, 0.396078, 0.486275, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 39 additions & 4 deletions projeto/elementos/scripts/ScriptsCartaoDeLevel/CartaoGeral.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ export var idCard = "Teste"
export var Imagem_card: StreamTexture
export var E_jogavel: bool
export var Cena_do_jogo: String
export var img_coracao_nao_apertado: StreamTexture
export var img_coracao_apertado: StreamTexture

onready var card_img: TextureRect = $PainelPrincipal/ImgCard
onready var card_2: TextureRect = $PainelHidden/outline3/ImgCard2
onready var titulo_texto: RichTextLabel = $PainelPrincipal/Titulo
onready var desc_basica: Label = $PainelPrincipal/Desc
onready var animacao_coracao: AnimationPlayer = $AnimationCoracao
onready var botao_saibaMais = $PainelPrincipal/SaibaMais
onready var tween_card: Tween = $Tween

var saiba_mais_apertado: bool = false
var coracao_apertado: bool = false
Expand All @@ -25,6 +29,7 @@ func _atualizar_card():
var valoresId = valoresNoDict.get(String(idCard))

card_img.texture = Imagem_card
card_2.texture = Imagem_card

# Extrai valores específicos do cartão
Titulo = valoresId.get("Titulo")
Expand All @@ -39,28 +44,48 @@ func _atualizar_painel():
var valoresNoDict = loadJson(JsonCards)
var valoresId = valoresNoDict.get(String(idCard))

instanciaSaibaMais.Imagem_card = Imagem_card
instanciaSaibaMais.E_jogavel = E_jogavel
instanciaSaibaMais.Cena_do_jogo = Cena_do_jogo

# Extrai valores específicos para o painel
Descricao_avancada = valoresId.get("DescricaoAvancada")
instanciaSaibaMais.Descricao_avancada = Descricao_avancada

add_child(instanciaSaibaMais)
get_tree().root.add_child(instanciaSaibaMais)

func _ready():
recarregar_like()
_atualizar_card()
# var save = Salvamento.carregar_tudo("like")
# var dados = save.Dados
# print(dados[idCard])
# print(dados)

func recarregar_like():
if not Salvamento.existe("like", idCard):
# print('Não possue like')
save_like()
else:
var save = Salvamento.carregar_tudo("like")
var dados = save.Dados
if dados[idCard] == false:
$PainelPrincipal/Coracao.texture = img_coracao_nao_apertado
coracao_apertado = false
else:
$PainelPrincipal/Coracao.texture = img_coracao_apertado
coracao_apertado = true

func _tocar_animacao_coracao():
if coracao_apertado == false:
animacao_coracao.play("Animação")
yield(animacao_coracao, "animation_finished")
coracao_apertado = true
save_like()
else:
animacao_coracao.play_backwards("Animação")
yield(animacao_coracao, "animation_finished")
coracao_apertado = false
save_like()

func _on_SaibaMais_pressed():
var botao_tween = $Tween
Expand All @@ -75,11 +100,14 @@ func _on_SaibaMais_pressed():

func _on_coracaobotao_pressed():
var coracao_tween = $PainelPrincipal/Coracao/TweenCoracao
coracao_tween.interpolate_property($PainelPrincipal/Coracao, "scale", Vector2(1.907, 1.907), Vector2(2, 2), 0.2, Tween.TRANS_ELASTIC)
coracao_tween.interpolate_property($PainelPrincipal/Coracao, "scale", Vector2(2, 2), Vector2(1.907, 1.907), 0.2, Tween.TRANS_ELASTIC)
coracao_tween.interpolate_property($PainelPrincipal/Coracao, "scale", Vector2(1.245, 1.245), Vector2(1.7, 1.7), 0.2, Tween.TRANS_ELASTIC)
coracao_tween.interpolate_property($PainelPrincipal/Coracao, "scale", Vector2(1.7, 1.7), Vector2(1.245, 1.245), 0.2, Tween.TRANS_ELASTIC)
coracao_tween.start()
_tocar_animacao_coracao()

func save_like():
Salvamento.salvar("like", idCard, coracao_apertado)

func loadJson(nomejson):
var arquivo = File.new()
if arquivo.file_exists(nomejson):
Expand All @@ -93,3 +121,10 @@ func loadJson(nomejson):
else:
print("File Open Error: could not open file " + nomejson)
arquivo.close()

func _on_VisibilityNotifier2D_screen_entered():
tween_card.interpolate_property($PainelPrincipal, "rect_position", Vector2(55, -5), Vector2(55, 32), 0.7, Tween.TRANS_LINEAR)
tween_card.interpolate_property($PainelPrincipal, "modulate:a", 0.2, 1, 0.5, Tween.TRANS_LINEAR)
tween_card.interpolate_property($PainelHidden, "rect_position", Vector2(19, -5), Vector2(19, 60), 0.7, Tween.TRANS_LINEAR)
tween_card.interpolate_property($PainelHidden, "modulate:a", 0.2, 1, 0.5, Tween.TRANS_LINEAR)
tween_card.start()
183 changes: 73 additions & 110 deletions projeto/recursos/feed_de_noticias/PainelSaibaMais.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,168 +2,131 @@

[ext_resource path="res://recursos/feed_de_noticias/SeletorDeNiveis/TemaSeletorDeLevel.tres" type="Theme" id=1]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Noticia_aberta/noticia.png" type="Texture" id=2]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Feed_noticias/Voltar/Voltar_pressed.png" type="Texture" id=3]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Noticia_aberta/noticia_outline.png" type="Texture" id=4]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Feed_noticias/Voltar/Voltar_normal.png" type="Texture" id=5]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Feed_noticias/Leia_mais/Leia_Mais_pressed.png" type="Texture" id=3]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Noticia_aberta/outline_noticia.png" type="Texture" id=4]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Feed_noticias/Leia_mais/Leia_mais.png" type="Texture" id=5]
[ext_resource path="res://elementos/fontes/Lacquer-Regular.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://recursos/feed_de_noticias/SeletorDeNiveis/ManuseadorDaDescricaoAvancada.gd" type="Script" id=7]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Noticia_aberta/Group 7.png" type="Texture" id=8]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Noticia_aberta/botao_jogar/jogar_pressed.png" type="Texture" id=9]
[ext_resource path="res://elementos/UI/minigame_senhorinha/Feed/Noticia_aberta/botao_jogar/jogar_normal.png" type="Texture" id=10]

[sub_resource type="DynamicFont" id=1]
size = 24
size = 27
font_data = ExtResource( 6 )

[node name="PainelSaibaMais" type="CanvasLayer"]
script = ExtResource( 7 )
[sub_resource type="DynamicFont" id=2]
size = 32
font_data = ExtResource( 6 )

[node name="Fundo" type="ColorRect" parent="."]
modulate = Color( 1, 1, 1, 0 )
anchor_left = 0.503
anchor_top = 0.5
anchor_right = 0.503
anchor_bottom = 0.5
margin_left = -562.16
margin_top = -765.0
margin_right = 581.84
margin_bottom = 727.0
color = Color( 0.247059, 0.717647, 0.239216, 1 )
[node name="PainelSaibaMais" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 7 )

[node name="TweenFundo" type="Tween" parent="Fundo"]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
follow_viewport_enable = true

[node name="PainelDescricao" type="TextureRect" parent="."]
modulate = Color( 1, 1, 1, 0 )
[node name="PainelDescricao" type="TextureRect" parent="CanvasLayer"]
anchor_left = 0.5
anchor_top = 0.606
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.606
anchor_bottom = 0.5
margin_left = -337.0
margin_top = -498.68
margin_top = 860.0
margin_right = 337.0
margin_bottom = 499.321
margin_bottom = 1637.0
theme = ExtResource( 1 )
texture = ExtResource( 2 )
expand = true
stretch_mode = 1

[node name="ImgCard" type="TextureRect" parent="PainelDescricao"]
anchor_left = 0.5
anchor_top = 0.174
anchor_right = 0.5
anchor_bottom = 0.174
margin_left = -337.0
margin_top = -173.652
margin_right = 337.0
margin_bottom = 186.348
theme = ExtResource( 1 )
texture = ExtResource( 8 )
expand = true
stretch_mode = 1

[node name="outline" type="TextureRect" parent="PainelDescricao"]
[node name="outline" type="TextureRect" parent="CanvasLayer/PainelDescricao"]
anchor_left = 0.5
anchor_top = 0.5
anchor_top = 0.501
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -344.0
margin_top = -511.0
margin_right = 344.0
margin_bottom = 505.0
anchor_bottom = 0.501
margin_left = -345.0
margin_top = -400.277
margin_right = 348.0
margin_bottom = 400.723
theme = ExtResource( 1 )
texture = ExtResource( 4 )
expand = true
stretch_mode = 1

[node name="Desc" type="Label" parent="PainelDescricao"]
[node name="Desc" type="RichTextLabel" parent="CanvasLayer/PainelDescricao"]
anchor_left = 0.5
anchor_top = 0.612
anchor_top = 0.44
anchor_right = 0.5
anchor_bottom = 0.612
margin_left = -321.0
margin_top = -235.776
margin_right = 323.0
margin_bottom = 258.224
mouse_filter = 1
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_fonts/font = SubResource( 1 )
anchor_bottom = 0.44
margin_left = -313.0
margin_top = -317.88
margin_right = 309.0
margin_bottom = 317.12
custom_colors/default_color = Color( 0, 0, 0, 1 )
custom_fonts/italics_font = SubResource( 1 )
custom_fonts/bold_font = SubResource( 1 )
custom_fonts/normal_font = SubResource( 1 )
bbcode_enabled = true
bbcode_text = "Coloque Uma Descrição avancada Aqui"
text = "Coloque Uma Descrição avancada Aqui"
autowrap = true
max_lines_visible = 10

[node name="SaibaMenos" type="TextureButton" parent="PainelDescricao"]
anchor_left = 0.498223
anchor_top = 0.964
anchor_right = 0.498223
anchor_bottom = 0.964
margin_left = -83.802
margin_top = -24.072
margin_right = 83.198
margin_bottom = 20.928
[node name="SaibaMenos" type="TextureButton" parent="CanvasLayer/PainelDescricao"]
anchor_left = 0.502
anchor_top = -0.026
anchor_right = 0.502
anchor_bottom = -0.026
margin_left = -94.348
margin_top = -15.798
margin_right = 66.652
margin_bottom = 29.202
rect_scale = Vector2( 1.17494, 0.69494 )
mouse_filter = 1
toggle_mode = true
texture_normal = ExtResource( 5 )
texture_pressed = ExtResource( 3 )
expand = true
stretch_mode = 4

[node name="TweenSaibaMenos" type="Tween" parent="PainelDescricao/SaibaMenos"]

[node name="voltar" type="Label" parent="PainelDescricao/SaibaMenos"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -79.5
margin_top = -20.5
margin_right = 75.5
margin_bottom = 15.5
mouse_filter = 1
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_fonts/font = SubResource( 1 )
text = "Voltar"
align = 1
valign = 1
autowrap = true
max_lines_visible = 10

[node name="Jogar" type="TextureButton" parent="PainelDescricao"]
anchor_left = 0.49919
anchor_top = 0.902879
anchor_right = 0.49919
anchor_bottom = 0.902879
margin_left = -96.4541
margin_top = -21.0733
margin_right = 96.5459
margin_bottom = 27.9267
[node name="TweenSaibaMenos" type="Tween" parent="CanvasLayer/PainelDescricao/SaibaMenos"]

[node name="Jogar" type="TextureButton" parent="CanvasLayer/PainelDescricao"]
anchor_left = 0.512
anchor_top = 0.936
anchor_right = 0.512
anchor_bottom = 0.936
margin_left = -115.088
margin_top = -29.272
margin_right = 114.912
margin_bottom = 28.728
mouse_filter = 1
toggle_mode = true
texture_normal = ExtResource( 10 )
texture_pressed = ExtResource( 9 )
expand = true
stretch_mode = 4
stretch_mode = 5

[node name="TweenJogar" type="Tween" parent="PainelDescricao/Jogar"]
[node name="TweenJogar" type="Tween" parent="CanvasLayer/PainelDescricao/Jogar"]

[node name="Jogar" type="Label" parent="PainelDescricao/Jogar"]
anchor_left = 0.5
[node name="Jogar" type="Label" parent="CanvasLayer/PainelDescricao/Jogar"]
anchor_left = 0.489
anchor_top = 0.5
anchor_right = 0.5
anchor_right = 0.489
anchor_bottom = 0.5
margin_left = -80.4997
margin_top = -18.5007
margin_right = 74.5003
margin_bottom = 17.4993
margin_left = -77.47
margin_top = -21.0
margin_right = 77.53
margin_bottom = 18.0
mouse_filter = 1
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_fonts/font = SubResource( 1 )
text = "Jogar"
custom_fonts/font = SubResource( 2 )
text = "jogar"
align = 1
valign = 1
autowrap = true
max_lines_visible = 10

[node name="TweenPainel" type="Tween" parent="PainelDescricao"]
[node name="TweenPainel" type="Tween" parent="CanvasLayer/PainelDescricao"]

[connection signal="button_up" from="PainelDescricao/SaibaMenos" to="." method="_on_SaibaMenos_button_up"]
[connection signal="button_up" from="PainelDescricao/Jogar" to="." method="_on_Jogar_button_up"]
[connection signal="button_up" from="CanvasLayer/PainelDescricao/SaibaMenos" to="." method="_on_SaibaMenos_button_up"]
[connection signal="button_up" from="CanvasLayer/PainelDescricao/Jogar" to="." method="_on_Jogar_button_up"]
Loading

0 comments on commit 339abb0

Please sign in to comment.