mirror of
https://gitlab.acidiclight.dev/sociallydistant/sociallydistant.git
synced 2025-01-22 09:31:47 -05:00
Add entry sounds to LineEditor
Signed-off-by: Ritchie Frodomar <alkalinethunder@gmail.com>
This commit is contained in:
parent
685e611c8a
commit
ad4aa04497
2 changed files with 1 additions and 59 deletions
|
@ -72,13 +72,7 @@ namespace SociallyDistant.Core.DataManagement
|
|||
{
|
||||
return narrativeIdLookup.ContainsKey(narrativeId);
|
||||
}
|
||||
|
||||
public void Remove(ObjectId instanceId)
|
||||
{
|
||||
var data = this.First(x => x.InstanceId == instanceId);
|
||||
Remove(data);
|
||||
}
|
||||
|
||||
|
||||
public void Remove(ObjectId instanceId)
|
||||
{
|
||||
var data = this.First(x => x.InstanceId == instanceId);
|
||||
|
|
|
@ -273,58 +273,6 @@ public sealed class CraftingProgramController : ProgramController
|
|||
itemBannerText.Text = $"<b><size=32>{data.Title.ToUpper()}</size></b>{Environment.NewLine}{data.Category}";
|
||||
itemDescription.Text = data.Description;
|
||||
}
|
||||
|
||||
private async void OnInteract()
|
||||
{
|
||||
if (currentItem != null)
|
||||
{
|
||||
interactionButton.Visibility = Visibility.Hidden;
|
||||
interactionPanel.Visibility = Visibility.Visible;
|
||||
|
||||
await DoInteractProgress(0.2f);
|
||||
|
||||
currentItem.Value.Recipe.DisassembleComponents(SociallyDistantGame.Instance);
|
||||
|
||||
WorldManager.Instance.World.Inventory.Remove(currentItem.Value.WorldItem);
|
||||
|
||||
this.currentItem = null;
|
||||
interactionPanel.Visibility = Visibility.Hidden;
|
||||
RefreshInterface();
|
||||
}
|
||||
else if (currentRecipe != null)
|
||||
{
|
||||
interactionButton.Visibility = Visibility.Hidden;
|
||||
interactionPanel.Visibility = Visibility.Visible;
|
||||
|
||||
await DoInteractProgress(0.5f);
|
||||
|
||||
if (currentRecipe.TryCraft(SociallyDistantGame.Instance))
|
||||
{
|
||||
var data = new WorldInventoryItem() { InstanceId = WorldManager.Instance.GetNextObjectId(), RecipeId = currentRecipe.Id, Quantity = 1, };
|
||||
WorldManager.Instance.World.Inventory.Add(data);
|
||||
|
||||
this.currentItem = new InventoryItemModel { WorldItem = data.InstanceId, Recipe = currentRecipe };
|
||||
currentRecipe = null;
|
||||
}
|
||||
|
||||
interactionPanel.Visibility = Visibility.Hidden;
|
||||
RefreshInterface();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DoInteractProgress(float duration)
|
||||
{
|
||||
var progress = 0f;
|
||||
|
||||
while (progress < duration)
|
||||
{
|
||||
interactionProgress.Value = progress / duration;
|
||||
interactionPercentage.Text = $"{Math.Round((progress / duration) * 100)}%";
|
||||
|
||||
await Task.Delay(10);
|
||||
progress += 0.010f;
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnInteract()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue