9.20下午
This commit is contained in:
parent
43916fdea0
commit
fa517b71c3
@ -16,14 +16,18 @@ var character_data:Dictionary
|
||||
var system_config_data:Dictionary={
|
||||
|
||||
}
|
||||
|
||||
var system_game_data:Dictionary={
|
||||
"unlock_character":["test_character_01","test_character_02"]
|
||||
}
|
||||
|
||||
var now_game_data:Dictionary={
|
||||
"time":99999,
|
||||
"character":{
|
||||
"character_data":{
|
||||
|
||||
},
|
||||
"unlock_character":["test_character_01"]
|
||||
"script_data":{
|
||||
|
||||
},
|
||||
"difficulty":0
|
||||
}
|
||||
func _ready() -> void:
|
||||
load_texture_data()
|
||||
|
@ -2,7 +2,90 @@
|
||||
"test_character_01":{
|
||||
"character":{
|
||||
"name":"朱雀院椿(测试)",
|
||||
"star":5,
|
||||
"star":3,
|
||||
"skin":[
|
||||
{
|
||||
"name":"皮肤1",
|
||||
"card_face":"test_character_tsubaki",
|
||||
"character":"角色图片路径"
|
||||
}
|
||||
],
|
||||
"skin_now_use":0
|
||||
},
|
||||
"basic_mes":{
|
||||
"script_category":"剧本类别",
|
||||
"place":"地点",
|
||||
"sex":0,
|
||||
"race":"种族",
|
||||
"birthday":"xxxx-xx-xx",
|
||||
|
||||
"introduction":"这是一个介绍",
|
||||
"basic_attribute":[
|
||||
{
|
||||
"name":"体质",
|
||||
"value":100,
|
||||
},
|
||||
{
|
||||
"name":"敏捷",
|
||||
"value":100,
|
||||
},
|
||||
{
|
||||
"name":"智力",
|
||||
"value":100,
|
||||
},
|
||||
{
|
||||
"name":"感知",
|
||||
"value":100,
|
||||
},
|
||||
],
|
||||
"fight_attribute":[
|
||||
{
|
||||
"name":"生命",
|
||||
"value":100,
|
||||
},
|
||||
{
|
||||
"name":"精神",
|
||||
"value":100,
|
||||
},
|
||||
{
|
||||
"name":"物理攻击",
|
||||
"value":100,
|
||||
},
|
||||
{
|
||||
"name":"法术强度",
|
||||
"value":100,
|
||||
},
|
||||
]
|
||||
},
|
||||
"special":[
|
||||
{
|
||||
"name":"倾国倾城",
|
||||
"introduction":"鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果"
|
||||
}
|
||||
],
|
||||
"ability":[
|
||||
{
|
||||
"name":"武学 LV3",
|
||||
"introduction":"鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果鼠标点击显示具体效果"
|
||||
}
|
||||
],
|
||||
|
||||
"favor":[{
|
||||
"name":"姐姐",
|
||||
"value":100
|
||||
}
|
||||
],
|
||||
"reputation":[
|
||||
{
|
||||
"name":"某地区",
|
||||
"value":100
|
||||
}
|
||||
]
|
||||
},
|
||||
"test_character_02":{
|
||||
"character":{
|
||||
"name":"朱雀院椿(测试)",
|
||||
"star":3,
|
||||
"skin":[
|
||||
{
|
||||
"name":"皮肤1",
|
||||
|
@ -1,6 +1,5 @@
|
||||
extends Control
|
||||
signal back
|
||||
signal start_game(character_data:Dictionary)
|
||||
const CHARACTER_SELECT_CARD = preload("res://scene/character_select_card.tscn")
|
||||
@onready var character_add_pos: VFlowContainer = $VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos
|
||||
@onready var start: ToolButton = $VBoxContainer/HBoxContainer2/TextureRect/start
|
||||
@ -8,8 +7,11 @@ const CHARACTER_SELECT_CARD = preload("res://scene/character_select_card.tscn")
|
||||
var now_select_node
|
||||
var now_select_data:
|
||||
set(val):
|
||||
if now_select_node!=null:
|
||||
now_select_node.is_selected=false
|
||||
start.disable(val==null)
|
||||
now_select_data=val
|
||||
|
||||
var data:Dictionary={
|
||||
|
||||
}
|
||||
@ -20,18 +22,12 @@ func _ready() -> void:
|
||||
start.disable(true)
|
||||
for i in character_add_pos.get_children():
|
||||
i.queue_free()
|
||||
for i in Global.now_game_data["unlock_character"]:
|
||||
for i in Global.system_game_data["unlock_character"]:
|
||||
var new_character=CHARACTER_SELECT_CARD.instantiate()
|
||||
character_add_pos.add_child(new_character)
|
||||
new_character.set_data(Global.get_character_data(i))
|
||||
new_character.pressed.connect(pressed)
|
||||
func generate_debug_data(debug_size:int):
|
||||
for i in debug_size:
|
||||
var new_card_data={
|
||||
"id":"card"+str(i),
|
||||
"texture":"texture_test",
|
||||
|
||||
}
|
||||
|
||||
func pressed(data,node,is_select):
|
||||
|
||||
if is_select:
|
||||
@ -46,5 +42,6 @@ func pressed(data,node,is_select):
|
||||
|
||||
|
||||
func _on_start_pressed() -> void:
|
||||
start_game.emit(now_select_data)
|
||||
Global.now_game_data.character_data=now_select_data
|
||||
SceneManager.change_scene_to("res://scene/game_flow.tscn")
|
||||
pass # Replace with function body.
|
||||
|
@ -132,30 +132,6 @@ layout_mode = 2
|
||||
[node name="character_select_card4" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card5" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card6" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card7" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card8" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card9" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card10" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card11" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card12" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="character_select_card13" parent="VBoxContainer/HBoxContainer/margin/HBoxContainer/ScrollContainer/character_add_pos" instance=ExtResource("8_6whmw")]
|
||||
layout_mode = 2
|
||||
|
||||
|
@ -10,8 +10,15 @@ var is_selected:bool=false:
|
||||
pass
|
||||
is_selected=val
|
||||
@onready var texture_face: TextureRect = %texture_face
|
||||
@onready var star_group=[$mask/HBoxContainer/HBoxContainer/TextureRect, $mask/HBoxContainer/HBoxContainer/TextureRect2, $mask/HBoxContainer/HBoxContainer/TextureRect3, $mask/HBoxContainer/HBoxContainer/TextureRect4, $mask/HBoxContainer/HBoxContainer/TextureRect5]
|
||||
@onready var n: Label = %n
|
||||
|
||||
|
||||
func set_star_num(num:int):
|
||||
for i in star_group.size():
|
||||
if i<num:
|
||||
star_group[i].show()
|
||||
else:
|
||||
star_group[i].hide()
|
||||
var data:Dictionary={
|
||||
|
||||
}
|
||||
@ -31,6 +38,6 @@ func set_data(_data:Dictionary):
|
||||
data=_data
|
||||
var skin_data=data["character"]["skin"][data["character"]["skin_now_use"]]
|
||||
texture_face.texture=Global.get_texture(skin_data["card_face"])
|
||||
|
||||
|
||||
set_star_num(data["character"]["star"])
|
||||
n.text=data["character"]["name"]
|
||||
pass
|
||||
|
@ -10,10 +10,10 @@
|
||||
[ext_resource type="Texture2D" uid="uid://8k7vqfjdvba6" path="res://res/ui/ui_017_character_select/mmask.png" id="6_s7boh"]
|
||||
|
||||
[node name="character_select_card" type="TextureRect"]
|
||||
custom_minimum_size = Vector2(247.5, 424.8)
|
||||
custom_minimum_size = Vector2(247.5, 441.205)
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.143229
|
||||
anchor_bottom = 0.437037
|
||||
anchor_bottom = 0.446412
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("1_fqxfe")
|
||||
@ -22,7 +22,6 @@ script = ExtResource("2_4knig")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="mask" type="TextureRect" parent="."]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.116364
|
||||
@ -110,16 +109,21 @@ texture = ExtResource("5_8s615")
|
||||
[node name="ToolButton" parent="mask" instance=ExtResource("6_ju3ox")]
|
||||
layout_mode = 1
|
||||
|
||||
[node name="n" type="Label" parent="."]
|
||||
[node name="n" type="Label" parent="mask"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
anchor_left = 0.327273
|
||||
anchor_top = 0.894068
|
||||
anchor_right = 0.665455
|
||||
anchor_bottom = 0.942797
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -29.0
|
||||
offset_top = -9.0
|
||||
offset_right = 35.0
|
||||
offset_bottom = 14.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "角色名字"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[connection signal="pressed" from="mask/ToolButton" to="." method="_on_tool_button_pressed"]
|
||||
|
@ -26,15 +26,18 @@ func _on_back_pressed() -> void:
|
||||
|
||||
|
||||
func _on_texture_rect_pressed() -> void:
|
||||
Global.now_game_data["difficulty"]=0
|
||||
select.emit(0)
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _on_texture_rect_2_pressed() -> void:
|
||||
Global.now_game_data["difficulty"]=1
|
||||
select.emit(1)
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
func _on_texture_rect_3_pressed() -> void:
|
||||
Global.now_game_data["difficulty"]=2
|
||||
select.emit(2)
|
||||
pass # Replace with function body.
|
||||
|
@ -142,6 +142,7 @@ func init_button_connection():
|
||||
|
||||
func _on_enter_button_pressed() -> void:
|
||||
enter_script.emit(now_selected_script_id)
|
||||
Global.now_game_data["script_data"]=Global.get_script_data(now_selected_script_id)
|
||||
$DrawerContainer2.change_open(true)
|
||||
pass # Replace with function body.
|
||||
|
||||
|
@ -581,4 +581,3 @@ layout_mode = 2
|
||||
[connection signal="back" from="DrawerContainer2/difficulty_selection" to="." method="_on_difficulty_selection_back"]
|
||||
[connection signal="select" from="DrawerContainer2/difficulty_selection" to="." method="_on_difficulty_selection_select"]
|
||||
[connection signal="back" from="DrawerContainer/character_select" to="." method="_on_character_select_back"]
|
||||
[connection signal="start_game" from="DrawerContainer/character_select" to="." method="_on_character_select_start_game"]
|
||||
|
Loading…
Reference in New Issue
Block a user