|
@@ -36,12 +36,14 @@ namespace Fort23.Mono
|
|
|
|
|
|
_shopItemConfig = ConfigComponent.Instance.Get<ShopItemConfig>(shopItem.id);
|
|
|
_callback = callback;
|
|
|
- WidgetItem itemWidget = await UIManager.Instance.CreateGComponent<WidgetItem>(null, ItemRoot, poolName: _poolName);
|
|
|
+ WidgetItem itemWidget =
|
|
|
+ await UIManager.Instance.CreateGComponent<WidgetItem>(null, ItemRoot, poolName: _poolName);
|
|
|
itemWidget.InitWidget(new ItemInfo(_shopItemConfig.itemId[0], _shopItemConfig.itemCount[0]));
|
|
|
ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(_shopItemConfig.itemId[0]);
|
|
|
Text_name.text = LanguageManager.Instance.Text(itemConfig.itemName);
|
|
|
- Text_desc.text = LanguageManager.Instance.Text(itemWidget.itemInfo.config.itemName);
|
|
|
- Text_ItemCount.text = "当前持有:" + PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.itemId[0]);
|
|
|
+ Text_desc.text = LanguageManager.Instance.Text(itemWidget.itemInfo.config.itemDesc);
|
|
|
+ Text_ItemCount.text =
|
|
|
+ "当前持有:" + PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.itemId[0]);
|
|
|
// UseSlider.value = 1;
|
|
|
// UseSlider.minValue = 1;
|
|
|
Text_BuyCount.text = "1";
|
|
@@ -59,7 +61,8 @@ namespace Fort23.Mono
|
|
|
Text_LimitCount.text = "无";
|
|
|
if (_shopItemConfig.price != 0)
|
|
|
{
|
|
|
- int total = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) / _shopItemConfig.price);
|
|
|
+ int total = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) /
|
|
|
+ _shopItemConfig.price);
|
|
|
maxCount = total >= 10 ? 10 : total;
|
|
|
}
|
|
|
|
|
@@ -80,7 +83,8 @@ namespace Fort23.Mono
|
|
|
maxCount = _shopItemConfig.buyCount - _shopItem.buyCount;
|
|
|
if (_shopItemConfig.price != 0)
|
|
|
{
|
|
|
- int temp = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) / _shopItemConfig.price);
|
|
|
+ int temp = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) /
|
|
|
+ _shopItemConfig.price);
|
|
|
if (temp < maxCount)
|
|
|
{
|
|
|
maxCount = temp;
|
|
@@ -98,13 +102,20 @@ namespace Fort23.Mono
|
|
|
// UseSlider.value = 1;
|
|
|
}
|
|
|
|
|
|
- Text_Price.text = _shopItemConfig.price.ToString();
|
|
|
+
|
|
|
if (_shopItemConfig.costItemId == GlobalParam.RMB_1031)
|
|
|
{
|
|
|
+ Text_Price.text = "¥" + _shopItemConfig.price.ToString();
|
|
|
ImageCurrency.gameObject.SetActive(false);
|
|
|
}
|
|
|
+ else if (_shopItemConfig.costItemId == 0)
|
|
|
+ {
|
|
|
+ ImageCurrency.gameObject.SetActive(false);
|
|
|
+ Text_Price.text = "免费";
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
+ Text_Price.text = _shopItemConfig.price.ToString();
|
|
|
ImageCurrency.gameObject.SetActive(true);
|
|
|
}
|
|
|
|
|
@@ -214,7 +225,25 @@ namespace Fort23.Mono
|
|
|
int count = (int)arg0;
|
|
|
currentSelectCount = count;
|
|
|
Text_BuyCount.text = count.ToString();
|
|
|
- Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
|
|
|
+
|
|
|
+
|
|
|
+ if (_shopItemConfig.costItemId == GlobalParam.RMB_1031)
|
|
|
+ {
|
|
|
+ Text_Price.text = $"¥{(count * _shopItemConfig.price).ToString()}";
|
|
|
+
|
|
|
+ ImageCurrency.gameObject.SetActive(false);
|
|
|
+ }
|
|
|
+ else if (_shopItemConfig.costItemId == 0)
|
|
|
+ {
|
|
|
+ Text_Price.text = "免费";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
|
|
|
+ ImageCurrency.gameObject.SetActive(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ // Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
|
|
|
}
|
|
|
|
|
|
public async override CTask Close()
|