fix popup item menu and refactor ui system
This commit is contained in:
@@ -39,7 +39,7 @@ public abstract class BaseInteractableObject : MonoBehaviour
|
||||
{
|
||||
case InteractionStatus.None:
|
||||
var filteredActions = _menuActions.Where(x => x.Value.IsEnabled).ToDictionary(i => i.Key, i => i.Value) ;
|
||||
UIManager.Instance.ShowItemsMenu(filteredActions, PopupMenuCallback);
|
||||
GameManager.Instance.UI.ShowItemPopupMenu(filteredActions, PopupMenuCallback);
|
||||
_currentStatus = InteractionStatus.WaitForChoose;
|
||||
break;
|
||||
case InteractionStatus.Complete:
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Bed : BaseInteractableObject
|
||||
|
||||
private void OnAnimationFinished()
|
||||
{
|
||||
UIManager.Instance.ShowTimeSliderDialog("Go to sleep", "Sleep until", OnCancel, OnConfirm);
|
||||
GameManager.Instance.UI.ShowTimeSliderDialog("Go to sleep", "Sleep until", OnCancel, OnConfirm);
|
||||
}
|
||||
private void OnCancel()
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CashierDesk : BaseInteractableObject
|
||||
BuyItems();
|
||||
break;
|
||||
case RadialMenuActions.Work:
|
||||
UIManager.Instance.ShowTimeSliderDialog($"Work", $"Work as {_playerJob.Description}", OnCancel, OnConfirm);
|
||||
GameManager.Instance.UI.ShowTimeSliderDialog($"Work", $"Work as {_playerJob.Description}", OnCancel, OnConfirm);
|
||||
break;
|
||||
default:
|
||||
print("unknown action");
|
||||
|
||||
@@ -12,7 +12,7 @@ public class OfficeTable : BaseInteractableObject
|
||||
|
||||
protected override void InteractAction(RadialMenuActions interactAction)
|
||||
{
|
||||
UIManager.Instance.ShowJobSelectionDialog("Job agency", null, OnConfirm);
|
||||
GameManager.Instance.UI.ShowJobSelectionDialog("Job agency", null, OnConfirm);
|
||||
}
|
||||
|
||||
private void OnConfirm(JobInfoSO selectedJob)
|
||||
|
||||
@@ -11,13 +11,11 @@ public class SelectedVisual : MonoBehaviour
|
||||
private void Start()
|
||||
{
|
||||
InGameMouseHandler.OnSelectedObjectChanged += Mouse_OnSelectedObjectChanged;
|
||||
print($"{_selectedObject.name} is subscribed to OnSelectedObjectChanged");
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
InGameMouseHandler.OnSelectedObjectChanged -= Mouse_OnSelectedObjectChanged;
|
||||
print($"{_selectedObject.name} is Unsubscribed to OnSelectedObjectChanged");
|
||||
}
|
||||
|
||||
private void Mouse_OnSelectedObjectChanged(object sender, OnSelectedObjectChangedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user