Skip to content

Commit

Permalink
优化输出格式,PURCHASEHISTORY 新增余额充值显示
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed May 20, 2022
1 parent 01c0f49 commit 651aff0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ASFEnhance/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Reflection;

[assembly: System.CLSCompliant(false)]
[assembly: AssemblyVersion("1.6.1.432")]
[assembly: AssemblyFileVersion("1.6.1.432")]
[assembly: AssemblyVersion("1.6.1.434")]
[assembly: AssemblyFileVersion("1.6.1.434")]

[assembly: AssemblyCopyright("Copyright © 2022 Chr_")]
[assembly: AssemblyProduct("ASFEnhance")]
Expand Down
11 changes: 10 additions & 1 deletion ASFEnhance/Localization/Langs.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion ASFEnhance/Localization/Langs.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
<value> - Store purchase: {0:0.00} {1}</value>
</data>
<data name="PruchaseHistoryTypeRefunded" xml:space="preserve">
<value> - Refunded purchase: {0:0.00} {1}</value>
<value> - Refunded purchase: {0:0.00} {1}</value>
</data>
<data name="PruchaseHistoryStatusTotalExternalPurchase" xml:space="preserve">
<value> - Total external spend: {0:0.00} {1}</value>
Expand Down Expand Up @@ -585,4 +585,7 @@
<data name="CommandHelpCmdNotFound" xml:space="preserve">
<value>找不到相关命令的帮助</value>
</data>
<data name="PruchaseHistoryTypeWalletPurchase" xml:space="preserve">
<value> - 余额充值: {0:0.00} {1}</value>
</data>
</root>
5 changes: 4 additions & 1 deletion ASFEnhance/Localization/Langs.resx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
<value> - 其他类型: {0:0.00} {1}</value>
</data>
<data name="PruchaseHistoryTypeRefunded" xml:space="preserve">
<value> - 退款: {0:0.00} {1}</value>
<value> - 退款: {0:0.00} {1}</value>
</data>
<data name="PruchaseHistoryGroupStatus" xml:space="preserve">
<value>数据统计(仅供参考):</value>
Expand Down Expand Up @@ -585,4 +585,7 @@
<data name="CommandHelpCmdNotFound" xml:space="preserve">
<value>找不到相关命令的帮助</value>
</data>
<data name="PruchaseHistoryTypeWalletPurchase" xml:space="preserve">
<value> - 余额充值: {0:0.00} {1}</value>
</data>
</root>
5 changes: 4 additions & 1 deletion ASFEnhance/Localization/Langs.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
<value> - 其他类型: {0:0.00} {1}</value>
</data>
<data name="PruchaseHistoryTypeRefunded" xml:space="preserve">
<value> - 退款: {0:0.00} {1}</value>
<value> - 退款: {0:0.00} {1}</value>
</data>
<data name="PruchaseHistoryTypeMarketPurchase" xml:space="preserve">
<value> - 市场购买: {0:0.00} {1}</value>
Expand Down Expand Up @@ -585,4 +585,7 @@
<data name="CommandHelpCmdNotFound" xml:space="preserve">
<value>找不到相关命令的帮助</value>
</data>
<data name="PruchaseHistoryTypeWalletPurchase" xml:space="preserve">
<value> - 余额充值: {0:0.00} {1}</value>
</data>
</root>
2 changes: 1 addition & 1 deletion ASFEnhance/Other/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ internal static string ResponseASFEnhanceVersion()
{
StringBuilder sb = new();

sb.AppendLine(Langs.MultipleLineResult);
sb.AppendLine(Langs.CommandHelp);

int count = 0;
Expand Down Expand Up @@ -90,6 +89,7 @@ internal static string ResponseASFEnhanceVersion()

if (count > 0)
{
sb.AppendLine();
sb.AppendLine(Langs.HelpArgsExplain);
}

Expand Down
4 changes: 4 additions & 0 deletions ASFEnhance/Store/HtmlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ int ParseMoneyString(string strMoney)
result.RefundPurchaseWallet += walletChange;
}
}
else
{
result.WalletPurchase += total;
}
}
else if (strType.StartsWith("礼物购买"))
{
Expand Down
3 changes: 3 additions & 0 deletions ASFEnhance/Store/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ internal class HistoryParseResponse
public int RefundPurchase;
/// <summary>退款[余额]</summary>
public int RefundPurchaseWallet;
/// <summary>购买余额</summary>
public int WalletPurchase;
/// <summary>其他</summary>
public int Other;

Expand All @@ -77,6 +79,7 @@ internal class HistoryParseResponse
InGamePurchase = a.InGamePurchase + b.InGamePurchase,
RefundPurchase = a.RefundPurchase + b.RefundPurchase,
RefundPurchaseWallet = a.RefundPurchaseWallet + b.RefundPurchaseWallet,
WalletPurchase = a.WalletPurchase + b.WalletPurchase,
Other = a.Other + b.Other,
};
return result;
Expand Down
1 change: 1 addition & 0 deletions ASFEnhance/Store/WebRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ internal static async Task<bool> DeleteRecommend(Bot bot, uint gameID)
result.AppendLine(string.Format(Langs.PruchaseHistoryTypeMarketSelling, historyData.MarketSelling / 100.0, symbol));

result.AppendLine(Langs.PruchaseHistoryGroupOther);
result.AppendLine(string.Format(Langs.PruchaseHistoryTypeWalletPurchase, historyData.WalletPurchase / 100.0, symbol));
result.AppendLine(string.Format(Langs.PruchaseHistoryTypeOther, historyData.Other / 100.0, symbol));
result.AppendLine(string.Format(Langs.PruchaseHistoryTypeRefunded, historyData.RefundPurchase / 100.0, symbol));
result.AppendLine(string.Format(Langs.PruchaseHistoryTypeExternal, (historyData.RefundPurchase - historyData.RefundPurchaseWallet) / 100.0, symbol));
Expand Down

0 comments on commit 651aff0

Please sign in to comment.