大量注文調理後のダイアログ表示対応

This commit is contained in:
kimura 2021-12-09 16:25:29 +09:00
parent b8353af531
commit 3941b2d3b0
1 changed files with 40 additions and 52 deletions

View File

@ -172,14 +172,31 @@ public class KitchenManager : MonoBehaviour
orderIndicatorView.SetBadgeActive(false);
}
orderIndicatorView.SetIndicate(result.result, achieved || cancelled);
if (result.result)
orderIndicatorView.SetIndicate(result.newOrder, achieved || cancelled);
if (LocalCacheManager.Load(Const.ProductViewTypeTag, ProductViewType.Default) == ProductViewType.BulkOrder)
{
BulkOrderShowDialogWithSetup();
}
if (!result.newOrder)
{
if (gameData.OrderIdInProgress != gameData.CancelOrderId)
{
orderIndicatorView.TappedPhone
.ThrottleFirst(TimeSpan.FromSeconds(1f))
.Subscribe(_ =>
{
BulkOrderShowDialogWithSetup();
}).AddTo(this);
}
}
else
{
SoundManager.Instance.StopSE("se_Main_phone_sound");
var messageList = SpreadsheetDataManager.Instance.GetBaseDataList<BulkOrderTextData>(Const.BulkOrderTextDataSheet);
var nextMessageList = messageList.Where(data => data.shopLevel == result.nextOrderLevel).ToList();
orderIndicatorView.TappedPhone.ThrottleFirst(TimeSpan.FromSeconds(1f)).Take(1).Subscribe(_ =>
orderIndicatorView.TappedPhone.Take(1).Subscribe(_ =>
{
// タップで更新
gameData.CompletedProductList.Clear();
@ -193,24 +210,12 @@ public class KitchenManager : MonoBehaviour
{
gameData.OrderTextId = nextMessageList.First().id;
}
GameDataManager.SaveGameData();
var orderData = bulkOrderList.First(data => data.id == result.nextOrderId);
LocalCacheManager.Save(BulkOrder.DataTag, orderData);
BulkOrderNotifyView.ShowDialog(() =>
{
BulkOrder.ShowDialog(
onAchieved: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
},
onCancel: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
});
});
BulkOrderNotifyView.ShowDialog(BulkOrderShowDialogWithSetup);
// 通知をタップ後タップ動作を切り替える
orderIndicatorView.SetIndicate(false, false);
@ -218,49 +223,32 @@ public class KitchenManager : MonoBehaviour
.ThrottleFirst(TimeSpan.FromSeconds(1f))
.Subscribe(__ =>
{
BulkOrder.ShowDialog(
onAchieved: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
},
onCancel: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
});
BulkOrderShowDialogWithSetup();
}).AddTo(this);
}).AddTo(this);
}
else
{
if (gameData.OrderIdInProgress != gameData.CancelOrderId)
{
orderIndicatorView.TappedPhone
.ThrottleFirst(TimeSpan.FromSeconds(1f))
.Subscribe(_ =>
{
BulkOrder.ShowDialog(
onAchieved: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
},
onCancel: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
});
}).AddTo(this);
}
}
#if UNITY_EDITOR
Market.StockFlavorLog();
#endif
}
private (bool result, int nextOrderId, int nextOrderLevel) CheckBulkOrder()
private void BulkOrderShowDialogWithSetup()
{
BulkOrder.ShowDialog(
onAchieved: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
},
onCancel: () =>
{
orderIndicatorView.SetIndicate(false, true);
orderIndicatorView.SetBadgeActive(false);
});
}
private (bool newOrder, int nextOrderId, int nextOrderLevel) CheckBulkOrder()
{
var gameData = GameDataManager.GameData;
var nextOrderLevel = 0;