Add minimap to sidebar
This commit is contained in:
@@ -141,12 +141,6 @@ Sprint={
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":7,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
MiniMap={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
Inventory={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||
@@ -209,6 +203,11 @@ Debug={
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":45,"key_label":0,"unicode":45,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
AltAttack={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[internationalization]
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public partial class DataViewer : Control
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.Attack))
|
||||
_currentModel.PlayPrimaryAttackAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.MiniMap))
|
||||
if (Input.IsActionJustPressed(GameInputs.AltAttack))
|
||||
_currentModel.PlaySecondaryAttackAnimation();
|
||||
if (Input.IsActionJustPressed(GameInputs.Inventory) && _currentModel is ICanActivate canActivate)
|
||||
canActivate.Activate();
|
||||
|
||||
@@ -189,16 +189,6 @@ public partial class Game : Node3D, IGame
|
||||
InGameUI.InventoryMenu.Hide();
|
||||
InGameUI.InventoryMenu.SetProcessInput(false);
|
||||
})
|
||||
.Handle((in GameState.Output.OpenMiniMap _) =>
|
||||
{
|
||||
InGameUI.MiniMap.SetProcessUnhandledInput(true);
|
||||
InGameUI.MiniMap.Show();
|
||||
})
|
||||
.Handle((in GameState.Output.CloseMiniMap _) =>
|
||||
{
|
||||
InGameUI.MiniMap.SetProcessUnhandledInput(false);
|
||||
InGameUI.MiniMap.Hide();
|
||||
})
|
||||
.Handle((in GameState.Output.OpenDebugMenu _) =>
|
||||
{
|
||||
InGameUI.DebugMenu.Show();
|
||||
|
||||
@@ -8,9 +8,11 @@ process_mode = 3
|
||||
light_mask = 2
|
||||
visibility_layer = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
@@ -23,13 +25,13 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="SubViewportContainer" type="SubViewportContainer" parent="CenterContainer"]
|
||||
custom_minimum_size = Vector2(800, 800)
|
||||
custom_minimum_size = Vector2(300, 300)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="CenterContainer/SubViewportContainer"]
|
||||
transparent_bg = true
|
||||
handle_input_locally = false
|
||||
size = Vector2i(800, 800)
|
||||
size = Vector2i(500, 500)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="Minimap Camera" type="Camera3D" parent="CenterContainer/SubViewportContainer/SubViewport"]
|
||||
|
||||
@@ -48,8 +48,6 @@ public partial class InGameUI : Control, IInGameUI
|
||||
.Handle((in InGameUILogic.Output.AnnounceMessageOnMainScreen output) => { InventoryMessageUI.DisplayMessage(output.Message); })
|
||||
.Handle((in InGameUILogic.Output.AnnounceMessageInInventory output) => { InventoryMenu.DisplayMessage(output.Message); })
|
||||
.Handle((in InGameUILogic.Output.RemoveItemFromInventory output) => { InventoryMenu.RemoveItem(output.Item); })
|
||||
.Handle((in InGameUILogic.Output.DisplayMinimap _) => { MiniMap.SetProcessUnhandledInput(true); MiniMap.Show(); })
|
||||
.Handle((in InGameUILogic.Output.HideMinimap _) => { MiniMap.SetProcessUnhandledInput(false); MiniMap.Hide(); })
|
||||
.Handle((in InGameUILogic.Output.ShowInventory _) => { InventoryMenu.RefreshInventoryScreen(); InventoryMenu.Show(); InventoryMenu.SetProcessInput(true); })
|
||||
.Handle((in InGameUILogic.Output.HideInventory _) => { CloseInventory(); });
|
||||
|
||||
@@ -64,17 +62,6 @@ public partial class InGameUI : Control, IInGameUI
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed(GameInputs.MiniMap))
|
||||
{
|
||||
GD.Print("MiniMap button pressed");
|
||||
InGameUILogic.Input(new InGameUILogic.Input.ShowMinimap());
|
||||
}
|
||||
if (@event.IsActionReleased(GameInputs.MiniMap))
|
||||
{
|
||||
GD.Print("MiniMap button released");
|
||||
InGameUILogic.Input(new InGameUILogic.Input.HideMinimap());
|
||||
}
|
||||
|
||||
if (@event.IsActionPressed(GameInputs.Inventory))
|
||||
{
|
||||
GD.Print("Inventory button pressed");
|
||||
|
||||
@@ -106,7 +106,6 @@ size_flags_vertical = 3
|
||||
|
||||
[node name="MiniMap" parent="HBoxContainer/Panel/MarginContainer/VBoxContainer" instance=ExtResource("2_6sfje")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Sigil Marker" type="ReferenceRect" parent="HBoxContainer/Panel/MarginContainer/VBoxContainer"]
|
||||
|
||||
Reference in New Issue
Block a user