Compare commits

..

6 Commits

Author SHA1 Message Date
05763c25b1
Created the ability to drop items on the ground after the player dies.
制作玩家死亡后,背包物品掉在地上的功能。
2024-06-08 23:59:24 +08:00
Cold-Mint
0dd3de228e
Merge pull request #1 from Web13234/master
Some optimizations about localized text
2024-06-08 21:12:12 +08:00
霧雨烨
871ea247f0 Replaced hard-coded MaxSloganIndex with automatically fetched Slogan counts on load 2024-06-08 20:27:02 +08:00
霧雨烨
27aec2f754 Corrected the Japanese ID "jp" to "ja" in the translation file. 2024-06-08 20:19:54 +08:00
霧雨烨
067e9fe8c9 idk why filename that was supposed to be "Slogan" became "slogan", but it's "Slogan" now 2024-06-08 19:16:11 +08:00
霧雨烨
759bd31ff3 Corrected a clerical error by ColdMint chan 2024-06-08 18:06:52 +08:00
42 changed files with 163 additions and 63 deletions

View File

@ -1,5 +1,5 @@
id,zh,en,jp
#kill self
id,zh,en,ja
#suicide
#自杀
death_info_self_1,{0}误伤了自己。,{0} accidentally shot himself.,{0}誤って自分を傷つけました。
death_info_self_1,{0}误伤了自己。,{0} accidentally shot themself.,{0}誤って自分を傷つけました。
death_info_self_2,{0}忘记了瞄准。,{0} forgot to aim.,{0}照準を忘れました。
1 id,zh,en,jp id,zh,en,ja
2 #kill self #suicide
3 #自杀 #自杀
4 death_info_self_1,{0}误伤了自己。,{0} accidentally shot himself.,{0}誤って自分を傷つけました。 death_info_self_1,{0}误伤了自己。,{0} accidentally shot themself.,{0}誤って自分を傷つけました。
5 death_info_self_2,{0}忘记了瞄准。,{0} forgot to aim.,{0}照準を忘れました。 death_info_self_2,{0}忘记了瞄准。,{0} forgot to aim.,{0}照準を忘れました。

View File

@ -6,10 +6,10 @@ uid="uid://dwx0hwuy0uqio"
[deps]
files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.jp.translation"]
files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation"]
source_file="res://locals/DeathInfo.csv"
dest_files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.jp.translation"]
dest_files=["res://locals/DeathInfo.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation"]
[params]

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +1,2 @@
id,zh,en,jp
id,zh,en,ja
Left Mouse Button,鼠标左键,Left Mouse Button,マウスの左ボタンです
1 id zh en jp ja
2 Left Mouse Button 鼠标左键 Left Mouse Button マウスの左ボタンです マウスの左ボタンです

View File

@ -6,10 +6,10 @@ uid="uid://dvvc7sup2d2ii"
[deps]
files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.jp.translation"]
files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation"]
source_file="res://locals/InputMapping.csv"
dest_files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.jp.translation"]
dest_files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation"]
[params]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,9 @@
id,zh,en,jp
id,zh,en,ja
map_generator_is_running,地图生成器正在运行中,请稍后重试。,"Map Generator is running, please try again later.",マップ生成器が動作中ですので、後ほどリトライしてください。
missing_parameters,缺少参数。,Missing parameters.,パラメータが不足しています。
room_root_node_must_be_node2d,房间根节点必须是 Node2D。,Room root node must be Node2D.,ルートードはNode2Dでなければなりません。
room_root_node_must_be_node2d,房间根节点必须是 Node2D。,Room root node must be an instance of Node2D.,ルートードはNode2Dでなければなりません。
width_or_height_of_room_slot_must_be_1,房间槽的宽度或高度必须为1。,The width or height of the room slot must be 1.,部屋の溝の幅または高さは1でなければなりません。
connected_room_timeout,连接房间超时。,Connecting the room timed out.,接続部屋はタイムアウトです。
connected_room_timeout,连接房间超时。,Timeout when connecting rooms.,接続部屋はタイムアウトです。
projectiles_is_empty,未设置抛射体。,The projectile is not set.,射出体は設置されていません。
map_generator_missing_parameters,地图生成器缺少参数。,Map generator missing parameters.,マップジェネレータが不足しています。
map_generator_attempts_to_parse_empty_layout_diagrams,地图生成器尝试解析空的布局图。,Map generator attempts to parse empty layout diagrams.,マップジェネレータは空のレイアウト図を解析しようとしています。
@ -11,7 +11,7 @@ map_generator_has_no_starting_room_data,地图生成器没有起点房间数据
room_placement_strategy_terminates_map_generation,房间的放置策略终止了地图生成。,The room placement strategy terminates map generation.,部屋の配置ポリシーはマップ作成を終了します。
start_room_placement_information_returns_empty,起始房间放置信息返回空。,Start room placement information returns empty.,スタートルーム放置情報は空に戻ります。
start_room_placement_failed,起始房间放置失败。,Start room placement failed.,スタートルーム放置失敗です。
room_data_missing,房间数据缺失。,Room data missing.,部屋データが欠落しています。
room_data_missing,房间数据缺失。,Missing room data.,部屋データが欠落しています。
failed_to_calculate_the_room_location,计算房间{0}位置时失败。,Failed to calculate the location of room {0}.,部屋{0}の位置を計算するのに失敗します。
place_existing_rooms,放置已存在的房间{0}。,Place existing rooms {0}.,既存の部屋を置きます{0}。
room_placement_failed,房间{0}放置失败。,Room {0} placement failed.,部屋{0}の放置に失敗します。

1 id zh en jp ja
2 map_generator_is_running 地图生成器正在运行中,请稍后重试。 Map Generator is running, please try again later. マップ生成器が動作中ですので、後ほどリトライしてください。
3 missing_parameters 缺少参数。 Missing parameters. パラメータが不足しています。
4 room_root_node_must_be_node2d 房间根节点必须是 Node2D。 Room root node must be Node2D. Room root node must be an instance of Node2D. ルートノードはNode2Dでなければなりません。
5 width_or_height_of_room_slot_must_be_1 房间槽的宽度或高度必须为1。 The width or height of the room slot must be 1. 部屋の溝の幅または高さは1でなければなりません。
6 connected_room_timeout 连接房间超时。 Connecting the room timed out. Timeout when connecting rooms. 接続部屋はタイムアウトです。
7 projectiles_is_empty 未设置抛射体。 The projectile is not set. 射出体は設置されていません。
8 map_generator_missing_parameters 地图生成器缺少参数。 Map generator missing parameters. マップジェネレータが不足しています。
9 map_generator_attempts_to_parse_empty_layout_diagrams 地图生成器尝试解析空的布局图。 Map generator attempts to parse empty layout diagrams. マップジェネレータは空のレイアウト図を解析しようとしています。
11 room_placement_strategy_terminates_map_generation 房间的放置策略终止了地图生成。 The room placement strategy terminates map generation. 部屋の配置ポリシーはマップ作成を終了します。
12 start_room_placement_information_returns_empty 起始房间放置信息返回空。 Start room placement information returns empty. スタートルーム放置情報は空に戻ります。
13 start_room_placement_failed 起始房间放置失败。 Start room placement failed. スタートルーム放置失敗です。
14 room_data_missing 房间数据缺失。 Room data missing. Missing room data. 部屋データが欠落しています。
15 failed_to_calculate_the_room_location 计算房间{0}位置时失败。 Failed to calculate the location of room {0}. 部屋{0}の位置を計算するのに失敗します。
16 place_existing_rooms 放置已存在的房间{0}。 Place existing rooms {0}. 既存の部屋を置きます{0}。
17 room_placement_failed 房间{0}放置失败。 Room {0} placement failed. 部屋{0}の放置に失敗します。

View File

@ -6,10 +6,10 @@ uid="uid://btmjafjh5r6bk"
[deps]
files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.jp.translation"]
files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation"]
source_file="res://locals/Log.csv"
dest_files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.jp.translation"]
dest_files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation"]
[params]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
id,zh,en,jp
id,zh,en,ja
product_name,异界旅人,A traveler from another world,異界の旅人です
start_game,开始游戏,Start game,ゲームを始めます
settings,设置,Settings,備え付け

1 id zh en jp ja
2 product_name 异界旅人 A traveler from another world 異界の旅人です
3 start_game 开始游戏 Start game ゲームを始めます
4 settings 设置 Settings 備え付け

View File

@ -6,10 +6,10 @@ uid="uid://bpdkorm7lprma"
[deps]
files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.jp.translation"]
files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation"]
source_file="res://locals/UI.csv"
dest_files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.jp.translation"]
dest_files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation"]
[params]

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,3 @@
id,zh,en,jp
id,zh,en,ja
staff_of_the_undead,死灵法杖,StaffOfTheUndead,ネクロポリスの杖です
staff_of_the_undead_desc,发射诅咒,可将敌人转化为邪恶的怪物。,Cast a curse that transforms enemies into evil monsters.,呪いを発射して、敵を邪悪な怪物に変えることができます。
1 id zh en jp ja
2 staff_of_the_undead 死灵法杖 StaffOfTheUndead ネクロポリスの杖です ネクロポリスの杖です
3 staff_of_the_undead_desc 发射诅咒,可将敌人转化为邪恶的怪物。 Cast a curse that transforms enemies into evil monsters. 呪いを発射して、敵を邪悪な怪物に変えることができます。 呪いを発射して、敵を邪悪な怪物に変えることができます。

View File

@ -2,14 +2,14 @@
importer="csv_translation"
type="Translation"
uid="uid://dmhmjvtquyu16"
uid="uid://ci3wou75hhj6e"
[deps]
files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.jp.translation"]
files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.ja.translation"]
source_file="res://locals/Weapon.csv"
dest_files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.jp.translation"]
dest_files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.ja.translation"]
[params]

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,8 @@
id,zh,en,jp
slogan_1,游戏属于每一个人。,The game belongs to everyone.,ゲームはすべての人のものです。
slogan_2,如果你想要得到爱,你就播种爱。,"If you want love, you sow love.",愛を手に入れたければ、愛の種をまきます。
slogan_3,快乐?伤心?痛苦?,Happy? Sad? Pain?,楽しいですか?悲しいですか?苦しいですか?
slogan_4,kaWaYi!,kaWaYi!,kaWaYi!
slogan_5,魔法是想象的世界。,Magic is an imaginary world.,魔法は想像の世界です。
id,zh,en,ja
slogan_0,游戏属于每一个人。,The game belongs to everyone.,ゲームはすべての人のものです。
slogan_1,如果你想要得到爱,你就播种爱。,"If you want love, you sow love.",愛を手に入れたければ、愛の種をまきます。
slogan_2,快乐?伤心?痛苦?,Happy? Sad? Pain?,楽しいですか?悲しいですか?苦しいですか?
slogan_3,Kawaii!,Kawaii!,Kawaii!
slogan_4,魔法是想象的世界。,Magic is an imaginary world.,魔法は想像の世界です。
slogan_5,也试试Minecraft,Also try Minecraft!,Minecraftもやってみて
slogan_6,也试试Terraria,Also try Terraria!,Terrariaもやってみて
1 id zh en jp ja
2 slogan_1 slogan_0 游戏属于每一个人。 The game belongs to everyone. ゲームはすべての人のものです。 ゲームはすべての人のものです。
3 slogan_2 slogan_1 如果你想要得到爱,你就播种爱。 If you want love, you sow love. 愛を手に入れたければ、愛の種をまきます。 愛を手に入れたければ、愛の種をまきます。
4 slogan_3 slogan_2 快乐?伤心?痛苦? Happy? Sad? Pain? 楽しいですか?悲しいですか?苦しいですか? 楽しいですか?悲しいですか?苦しいですか?
5 slogan_4 slogan_3 kaWaYi! Kawaii! kaWaYi! Kawaii! kaWaYi! Kawaii!
6 slogan_5 slogan_4 魔法是想象的世界。 Magic is an imaginary world. 魔法は想像の世界です。 魔法は想像の世界です。
7 slogan_5 也试试Minecraft! Also try Minecraft! Minecraftもやってみて!
8 slogan_6 也试试Terraria! Also try Terraria! Terrariaもやってみて!

View File

@ -2,14 +2,14 @@
importer="csv_translation"
type="Translation"
uid="uid://dbgkevd34vb0d"
uid="uid://bgfmprv2sm645"
[deps]
files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.jp.translation"]
files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation"]
source_file="res://locals/Slogan.csv"
dest_files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.jp.translation"]
dest_files=["res://locals/Slogan.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation"]
[params]

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -45,3 +45,18 @@ script = ExtResource("2_6p8mv")
[node name="StaffOfTheUndead" parent="." instance=ExtResource("3_ud0w8")]
position = Vector2(231, 116)
[node name="StaffOfTheUndead2" parent="." instance=ExtResource("3_ud0w8")]
position = Vector2(113, 149)
[node name="StaffOfTheUndead5" parent="." instance=ExtResource("3_ud0w8")]
position = Vector2(213, 177)
[node name="StaffOfTheUndead6" parent="." instance=ExtResource("3_ud0w8")]
position = Vector2(290, 167)
[node name="StaffOfTheUndead3" parent="." instance=ExtResource("3_ud0w8")]
position = Vector2(70, 88)
[node name="StaffOfTheUndead4" parent="." instance=ExtResource("3_ud0w8")]
position = Vector2(367, 85)

View File

@ -146,7 +146,8 @@ hotbar_previous={
[internationalization]
locale/translations=PackedStringArray("res://locals/UI.en.translation", "res://locals/UI.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.zh.translation", "res://locals/InputMapping.jp.translation", "res://locals/Log.jp.translation", "res://locals/UI.jp.translation", "res://locals/Weapon.jp.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.jp.translation", "res://locals/Slogan.zh.translation", "res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.jp.translation", "res://locals/DeathInfo.zh.translation")
locale/translations=PackedStringArray("res://locals/DeathInfo.en.translation", "res://locals/DeathInfo.ja.translation", "res://locals/DeathInfo.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.ja.translation", "res://locals/InputMapping.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.ja.translation", "res://locals/Log.zh.translation", "res://locals/Slogan.en.translation", "res://locals/Slogan.ja.translation", "res://locals/Slogan.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.ja.translation", "res://locals/UI.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.ja.translation", "res://locals/Weapon.zh.translation")
locale/test="ja"
[layer_names]

View File

@ -124,7 +124,7 @@ layout_mode = 2
[node name="GodotLabel" type="Label" parent="VBoxContainer2/HBoxContainer"]
layout_mode = 2
text = "Power by"
text = "Powered by"
horizontal_alignment = 2
[node name="LinkButton" type="LinkButton" parent="VBoxContainer2/HBoxContainer"]

View File

@ -1,4 +1,5 @@
using ColdMint.scripts.utils;
using Godot;
namespace ColdMint.scripts;
@ -9,7 +10,15 @@ namespace ColdMint.scripts;
/// </summary>
public static class SloganProvider
{
private const int MaxSloganIndex = 5;
static SloganProvider()
{
// Calculate SloganCount From translation file
// 从翻译文件中计算口号计数
var sloganTrans = ResourceLoader.Load<OptimizedTranslation>("res://locals/Slogan.en.translation")!;
SloganCount = sloganTrans.GetTranslatedMessageList().Length;
}
private static int SloganCount { get; }
/// <summary>
@ -19,7 +28,7 @@ public static class SloganProvider
/// <returns></returns>
public static string? GetSlogan()
{
var index = GD.Randi() % MaxSloganIndex + 1;
return TranslationServerUtils.Translate("slogan_" + index);
var index = GD.Randi() % SloganCount;
return TranslationServerUtils.Translate($"slogan_{index}");
}
}

View File

@ -151,7 +151,7 @@ public partial class CharacterTemplate : CharacterBody2D
//Check whether the new Hp is greater than the maximum Hp. If yes, set the current Hp to the maximum Hp. If no, set the current Hp to the new HP
//判断新的Hp是否大于最大Hp若大于那么将当前Hp设置为最大Hp否则设置为新的Hp
CurrentHp = newHp > MaxHp ? MaxHp : newHp;
Visible = true;
Show();
}
/// <summary>
@ -318,7 +318,7 @@ public partial class CharacterTemplate : CharacterBody2D
}
else
{
pickAbleItem.Visible = false;
pickAbleItem.Hide();
pickAbleItem.ProcessMode = ProcessModeEnum.Disabled;
}
@ -358,7 +358,7 @@ public partial class CharacterTemplate : CharacterBody2D
var timeSpan = DateTime.Now - _lastDamageTime;
if (timeSpan > Config.HealthBarDisplaysTime)
{
_healthBar.Visible = false;
_healthBar.Hide();
}
}
}
@ -410,7 +410,7 @@ public partial class CharacterTemplate : CharacterBody2D
}
}
_healthBar.Visible = true;
_healthBar.Show();
_healthBar.Value = CurrentHp;
}
@ -437,6 +437,7 @@ public partial class CharacterTemplate : CharacterBody2D
//Character death
//角色死亡
OnDie(damageTemplate);
ThrowAllItemOnDie();
return true;
}
@ -528,6 +529,44 @@ public partial class CharacterTemplate : CharacterBody2D
_animatedSprite2D.FlipH = FacingLeft;
}
/// <summary>
/// <para>Throw all items when the creature dies</para>
/// <para>当生物死亡后抛出所有物品</para>
/// </summary>
private void ThrowAllItemOnDie()
{
//If the item container is null, then return
//如果物品容器为null那么返回
if (_itemContainer == null)
{
return;
}
var len = _itemContainer.GetItemSlotCount();
if (len == 0)
{
return;
}
CurrentItem = null;
const float height = -Config.CellSize * 7;
const float horizontalDirection = Config.CellSize * 15;
for (var i = 0; i < len; i++)
{
//Generates a random number that controls the horizontal velocity of thrown items (range: 0.01 to 1)
//生成一个随机数,用于控制抛出物品的水平方向速度(范围为0.01到1)
var percent = GD.Randf() + 0.01f;
if (GD.Randf() > 0.5)
{
ThrowItem(i, -1, new Vector2(horizontalDirection * percent, height));
}
else
{
ThrowItem(i, -1, new Vector2(-horizontalDirection * percent, height));
}
}
}
/// <summary>
/// <para>Throw item</para>
/// <para>抛出物品</para>
@ -539,6 +578,8 @@ public partial class CharacterTemplate : CharacterBody2D
/// <param name="number">
/// <para>How many to throw</para>
/// <para>要扔几个</para>
/// <para>The amount passed into a negative number will throw all the items in the slot at once.</para>
/// <para>数量传入一个负数,将一次扔出槽内的所有物品。</para>
/// </param>
/// <param name="velocity">
///<para>The speed to be applied to the item</para>
@ -563,6 +604,11 @@ public partial class CharacterTemplate : CharacterBody2D
return;
}
if (item is not Node2D node2D)
{
return;
}
switch (item)
{
case WeaponTemplate weaponTemplate:
@ -571,7 +617,7 @@ public partial class CharacterTemplate : CharacterBody2D
return;
}
weaponTemplate.Reparent(GameSceneNodeHolder.WeaponContainer);
CallDeferred("WeaponTemplateReparent", weaponTemplate);
var timer = new Timer();
weaponTemplate.AddChild(timer);
timer.WaitTime = _itemCollisionRecoveryTime;
@ -587,13 +633,17 @@ public partial class CharacterTemplate : CharacterBody2D
};
timer.Start();
weaponTemplate.Sleeping = false;
// weaponTemplate.LinearVelocity = Vector2.Zero;
//Setting an initial speed of 0 for items here prevents the problem of throwing items too fast.
//在这里给物品设置一个为0的初始速度可防止扔出物品时速度过快的问题。
weaponTemplate.LinearVelocity = Vector2.Zero;
break;
}
node2D.ProcessMode = ProcessModeEnum.Inherit;
node2D.Show();
//We apply force to objects.
//我们给物品施加力。
switch (CurrentItem)
switch (node2D)
{
case CharacterBody2D characterBody2D:
characterBody2D.Velocity = velocity;
@ -605,9 +655,25 @@ public partial class CharacterTemplate : CharacterBody2D
//Remove items from the item container
//在物品容器内移除物品
itemSlotNode.RemoveItem(number);
if (number < 0)
{
itemSlotNode.RemoveItem(item.Quantity);
}
else
{
itemSlotNode.RemoveItem(number);
}
}
/// <summary>
/// <para>Replace the parent node of the weapon</para>
/// <para>替换武器的父节点</para>
/// </summary>
/// <param name="weaponTemplate"></param>
private void WeaponTemplateReparent(WeaponTemplate weaponTemplate)
{
weaponTemplate.Reparent(GameSceneNodeHolder.WeaponContainer);
}
public sealed override void _PhysicsProcess(double delta)
{

View File

@ -353,9 +353,15 @@ public partial class Player : CharacterTemplate
}
}
/// <summary>
/// <para>When the player dies</para>
/// <para>当玩家死亡的时候</para>
/// </summary>
/// <param name="damageTemplate"></param>
protected override async Task OnDie(DamageTemplate damageTemplate)
{
Visible = false;
Hide();
ProcessMode = ProcessModeEnum.Disabled;
if (EventManager.GameOverEvent == null)
{
return;

View File

@ -97,7 +97,7 @@ public partial class ItemSlotNode : MarginContainer
if (_quantityLabel != null)
{
_quantityLabel.Visible = false;
_quantityLabel.Hide();
}
}
@ -213,16 +213,16 @@ public partial class ItemSlotNode : MarginContainer
switch (quantity)
{
case null:
_quantityLabel.Visible = false;
_quantityLabel.Hide();
return;
case > 1:
//When the quantity is greater than 1, we display the quantity.
//当数量大于1时我们显示数量
_quantityLabel.Text = quantity.ToString();
_quantityLabel.Visible = true;
_quantityLabel.Show();
break;
default:
_quantityLabel.Visible = false;
_quantityLabel.Hide();
break;
}
}
@ -236,6 +236,6 @@ public partial class ItemSlotNode : MarginContainer
_iconTextureRect = GetNode<TextureRect>("BackgroundTexture/CenterContainer/IconTextureRect");
_quantityLabel = GetNode<Label>("Control/QuantityLabel");
_control = GetNode<Control>("Control");
_quantityLabel.Visible = false;
_quantityLabel.Hide();
}
}

View File

@ -15,7 +15,7 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
public override void InitializeUi()
{
Visible = false;
Hide();
}
public override void InitializeData()
@ -34,7 +34,7 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
{
var replayEvent = new GameReplayEvent();
EventManager.GameReplayEvent?.Invoke(replayEvent);
Visible = false;
Hide();
};
}
}
@ -46,7 +46,7 @@ public partial class GameOverLoaderMenuLoader : UiLoaderTemplate
return;
}
Visible = true;
Show();
_deathInfoLabel.Text = gameOverEvent.DeathInfo;
}

View File

@ -269,12 +269,12 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
{
if (_nodeBinding.GraphEdit != null)
{
_nodeBinding.GraphEdit.Visible = false;
_nodeBinding.GraphEdit.Hide();
}
if (_nodeBinding.CreateOrEditorPanel != null)
{
_nodeBinding.CreateOrEditorPanel.Visible = true;
_nodeBinding.CreateOrEditorPanel.Show();
}
if (_nodeBinding.RoomNameLineEdit != null && _defaultRoomName != null)
@ -301,7 +301,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
if (_nodeBinding.HBoxContainer != null)
{
_nodeBinding.HBoxContainer.Visible = false;
_nodeBinding.HBoxContainer.Hide();
}
};
}
@ -377,7 +377,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
{
if (_nodeBinding.SaveOrLoadPanel != null)
{
_nodeBinding.SaveOrLoadPanel.Visible = false;
_nodeBinding.SaveOrLoadPanel.Hide();
}
};
}
@ -388,7 +388,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
{
if (_nodeBinding.SaveOrLoadPanel != null)
{
_nodeBinding.SaveOrLoadPanel.Visible = false;
_nodeBinding.SaveOrLoadPanel.Hide();
}
};
}
@ -399,7 +399,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
{
if (_nodeBinding.SaveOrLoadPanel != null)
{
_nodeBinding.SaveOrLoadPanel.Visible = true;
_nodeBinding.SaveOrLoadPanel.Show();
}
if (_nodeBinding.ActionButton != null)
@ -427,7 +427,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
{
if (_nodeBinding.SaveOrLoadPanel != null)
{
_nodeBinding.SaveOrLoadPanel.Visible = true;
_nodeBinding.SaveOrLoadPanel.Show();
}
if (_nodeBinding.ActionButton != null)
@ -716,17 +716,17 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate
{
if (_nodeBinding.GraphEdit != null)
{
_nodeBinding.GraphEdit.Visible = true;
_nodeBinding.GraphEdit.Show();
}
if (_nodeBinding.CreateOrEditorPanel != null)
{
_nodeBinding.CreateOrEditorPanel.Visible = false;
_nodeBinding.CreateOrEditorPanel.Hide();
}
if (_nodeBinding.HBoxContainer != null)
{
_nodeBinding.HBoxContainer.Visible = true;
_nodeBinding.HBoxContainer.Show();
}
}
}

View File

@ -25,6 +25,7 @@ public partial class PlayerSpawn : Marker2D
{
if (GameSceneNodeHolder.Player != null)
{
GameSceneNodeHolder.Player.ProcessMode = ProcessModeEnum.Inherit;
GameSceneNodeHolder.Player.Position = GlobalPosition;
GameSceneNodeHolder.Player.Revive(GameSceneNodeHolder.Player.MaxHp);
return;