This commit is contained in:
Oscar
2025-05-27 00:59:12 +03:00
parent 670b0ade24
commit 37173c8b39
14 changed files with 730 additions and 184 deletions

View File

@@ -0,0 +1,26 @@
@using System.Threading.Tasks
@inherits PanelComponent
<root class="interaction-panel">
<div class="label">@InteractionString</div>
@if (IsHoldInteraction)
{
<div class="progress-bar">
<div class="progress-fill" style="width: @(ProgressionHold * 100)%"></div>
</div>
}
</root>
@code {
[Property] public string InteractionString { get; set; } = "Interact";
[Property] public bool IsHoldInteraction { get; set; } = false;
[Property] public float ProgressionHold { get; set; } = 0f;
public async Task TriggerInteractAnimation()
{
AddClass("interacted");
await Task.Delay(300);
RemoveClass("interacted");
}
}

View File

@@ -0,0 +1,13 @@
namespace Sandbox.UI;
public class HoverInfoPanelBase : WorldPanel
{
[Property] public string Label { get; set; } = "Описание";
[Property] public bool Visible { get; set; } = false;
public HoverInfoPanelBase(SceneWorld world) : base(world)
{
PanelBounds = new Rect(-200, -100, 400, 200);
WorldScale = 0.05f;
}
}

View File

@@ -0,0 +1,24 @@
.interaction-panel {
padding: 8px;
background-color: rgba(0,0,0,0.7);
border-radius: 6px;
color: white;
font-size: 16px;
.label {
margin-bottom: 4px;
}
.progress-bar {
width: 100px;
height: 8px;
background-color: #333;
border-radius: 4px;
.progress-fill {
height: 100%;
background-color: limegreen;
border-radius: 4px;
}
}
&.interacted {
background-color: rgba(0, 128, 255, 0.6);
}
}