diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index cba5f56..27b6648 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -1,4 +1,6 @@ -[gd_resource type="Theme" load_steps=77 format=3 uid="uid://cyfdqgfonv22k"] +[gd_resource type="Theme" load_steps=78 format=3 uid="uid://cyfdqgfonv22k"] + +[ext_resource type="FontFile" uid="uid://byrf43x8my2ym" path="res://Silver.ttf" id="1_cylyq"] [sub_resource type="StyleBoxFlat" id="1"] content_margin_left = 6.0 @@ -504,6 +506,8 @@ region_rect = Rect2(0, 0, 12, 12) [resource] +default_font = ExtResource("1_cylyq") +default_font_size = 36 Button/colors/font_color = Color(0.780392, 0.780392, 0.780392, 1) Button/colors/font_color_disabled = Color(1, 1, 1, 0.3) Button/colors/font_color_focus = Color(0.868235, 0.868235, 0.868235, 1) @@ -512,7 +516,7 @@ Button/colors/icon_color_hover = Color(1.15, 1.15, 1.15, 1) Button/colors/icon_color_pressed = Color(0.135294, 0.496079, 1.04176, 1) Button/constants/hseparation = 2 -Button/fonts/font = null +Button/fonts/font = ExtResource("1_cylyq") Button/styles/disabled = SubResource("1") Button/styles/focus = SubResource("2") Button/styles/hover = SubResource("3") @@ -614,7 +618,7 @@ Label/constants/shadow_as_outline = 0 Label/constants/shadow_offset_x = 1 Label/constants/shadow_offset_y = 1 -Label/fonts/font = null +Label/fonts/font = ExtResource("1_cylyq") Label/styles/normal = SubResource("54") LineEdit/colors/clear_button_color = Color(0.780392, 0.780392, 0.780392, 1) LineEdit/colors/clear_button_color_pressed = Color(0.117647, 0.431373, 0.905882, 1) @@ -625,7 +629,7 @@ LineEdit/colors/read_only = Color(1, 1, 1, 0.3) LineEdit/colors/selection_color = Color(0.117647, 0.431373, 0.905882, 0.4) LineEdit/constants/minimum_spaces = 12 -LineEdit/fonts/font = null +LineEdit/fonts/font = ExtResource("1_cylyq") LineEdit/icons/clear = SubResource("56") LineEdit/styles/focus = SubResource("2") LineEdit/styles/normal = SubResource("4") diff --git a/DungeonShooting_Godot/src/game/role/Player.cs b/DungeonShooting_Godot/src/game/role/Player.cs index 2a6c2fa..f59ac15 100644 --- a/DungeonShooting_Godot/src/game/role/Player.cs +++ b/DungeonShooting_Godot/src/game/role/Player.cs @@ -77,20 +77,14 @@ if (Input.IsActionJustPressed("exchange")) //切换武器 { ExchangeNext(); - RefreshGunTexture(); } else if (Input.IsActionJustPressed("throw")) //扔掉武器 { ThrowWeapon(); - RefreshGunTexture(); } else if (Input.IsActionJustPressed("interactive")) //互动物体 { - var item = TriggerInteractive(); - if (item is Weapon) - { - RefreshGunTexture(); - } + TriggerInteractive(); } else if (Input.IsActionJustPressed("reload")) //换弹 { @@ -122,6 +116,40 @@ PlayAnim(); } + public override void ExchangeNext() + { + base.ExchangeNext(); + RefreshGunTexture(); + } + + public override void ExchangePrev() + { + base.ExchangePrev(); + RefreshGunTexture(); + } + + public override void ThrowWeapon(int index) + { + base.ThrowWeapon(index); + RefreshGunTexture(); + } + + public override void ThrowWeapon() + { + base.ThrowWeapon(); + RefreshGunTexture(); + } + + public override bool PickUpWeapon(Weapon weapon, bool exchange = true) + { + var v = base.PickUpWeapon(weapon, exchange); + if (v) + { + RefreshGunTexture(); + } + return v; + } + protected override void OnChangeHp(int hp) { GameApplication.Instance.Ui.SetHp(hp); diff --git a/DungeonShooting_Godot/src/game/room/RoomManager.cs b/DungeonShooting_Godot/src/game/room/RoomManager.cs index 91c760b..4f20281 100644 --- a/DungeonShooting_Godot/src/game/room/RoomManager.cs +++ b/DungeonShooting_Godot/src/game/room/RoomManager.cs @@ -102,8 +102,8 @@ Player.PickUpWeapon(WeaponManager.GetGun("1001")); // Player.PickUpWeapon(WeaponManager.GetGun("1002")); - Player.PickUpWeapon(WeaponManager.GetGun("1003")); Player.PickUpWeapon(WeaponManager.GetGun("1004")); + Player.PickUpWeapon(WeaponManager.GetGun("1003")); // var enemy1 = new Enemy(); // enemy1.PutDown(new Vector2(100, 100), RoomLayerEnum.YSortLayer);