mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-12-05 16:16:35 +00:00
修改货币显示
This commit is contained in:
parent
b962f0a2b3
commit
6c0cfc60de
@ -98,6 +98,16 @@ namespace Oshima.FunGame.OshimaModules.Regions
|
|||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string GetCurrencyInfo(PluginConfig pc, User user, string storeName)
|
||||||
|
{
|
||||||
|
double forgePoints = 0;
|
||||||
|
if (pc.TryGetValue("forgepoints", out object? value) && double.TryParse(value.ToString(), out double points))
|
||||||
|
{
|
||||||
|
forgePoints = points;
|
||||||
|
}
|
||||||
|
return $"现有锻造积分:{forgePoints:0.##}";
|
||||||
|
}
|
||||||
|
|
||||||
public override void SaveGlobalStore(Store store, string storeName)
|
public override void SaveGlobalStore(Store store, string storeName)
|
||||||
{
|
{
|
||||||
EntityModuleConfig<Store> storeTemplate = new("stores", "dokyo");
|
EntityModuleConfig<Store> storeTemplate = new("stores", "dokyo");
|
||||||
|
|||||||
@ -2071,12 +2071,12 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
}
|
}
|
||||||
stores.Add("daily", daily);
|
stores.Add("daily", daily);
|
||||||
SetLastStore(user, true, "", "");
|
SetLastStore(user, true, "", "");
|
||||||
return daily.ToString(user) + $"\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
return daily.ToString(user) + $"\r\n☆--- {user.Inventory.Name} ---☆\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetLastStore(user, true, "", "");
|
SetLastStore(user, true, "", "");
|
||||||
return daily.ToString(user) + $"\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
return daily.ToString(user) + $"\r\n☆--- {user.Inventory.Name} ---☆\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4009,12 +4009,13 @@ namespace Oshima.FunGame.OshimaServers.Service
|
|||||||
Store? store = value.VisitStore(stores, user, storeName);
|
Store? store = value.VisitStore(stores, user, storeName);
|
||||||
exist = store != null;
|
exist = store != null;
|
||||||
msg = store?.ToString(user) ?? "";
|
msg = store?.ToString(user) ?? "";
|
||||||
string currencyInfo = value.GetCurrencyInfo(pc, user, storeName);
|
|
||||||
if (exist && msg != "")
|
if (exist && msg != "")
|
||||||
{
|
{
|
||||||
if (currencyInfo.Trim() == "")
|
string currencyInfo = $"☆--- {user.Inventory.Name} ---☆\r\n现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
||||||
|
string regionCurrency = value.GetCurrencyInfo(pc, user, storeName);
|
||||||
|
if (regionCurrency.Trim() != "")
|
||||||
{
|
{
|
||||||
currencyInfo = $"现有{General.GameplayEquilibriumConstant.InGameCurrency}:{user.Inventory.Credits:0.##}\r\n现有{General.GameplayEquilibriumConstant.InGameMaterial}:{user.Inventory.Materials:0.##}";
|
currencyInfo += $"\r\n{regionCurrency}";
|
||||||
}
|
}
|
||||||
msg += "\r\n" + currencyInfo;
|
msg += "\r\n" + currencyInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user