Pārlūkot izejas kodu

Small cleanups
* Follow up to 0f88530.
* Removed underscores from YAML labels to follow standard.

aleos89 7 gadi atpakaļ
vecāks
revīzija
024a5de8dc
4 mainītis faili ar 38 papildinājumiem un 58 dzēšanām
  1. 7 27
      conf/import-tmpl/tax.yml
  2. 18 18
      conf/tax.yml
  3. 5 5
      src/map/buyingstore.cpp
  4. 8 8
      src/map/tax.cpp

+ 7 - 27
conf/import-tmpl/tax.yml

@@ -1,27 +1,7 @@
-## Taxes for selling something (vending)
-## Zeny received for the seller will be reduced after taxes from the total selling price but the buyer pays just the total selling price
-#Selling:
-#  # Tax applied for total transaction
-#  In_Total:
-#  - Minimal_Value: 0
-#    Tax: 0
-#
-#  # Tax by selling entry
-#  Each_Entry:
-#  # 10% if >= 100,000,001
-#  - Minimal_Value: 100000001
-#    Tax: 1000
-#
-## Taxes for buying something (buyingstore)
-## Zeny received for the seller will be the total selling price but the buyer must pay taxes for the total selling price
-#Buying:
-#  # Tax applied for total transaction
-#  In_Total:
-#  - Minimal_Value: 0
-#    Tax: 0
-#
-#  # Tax by buying entry
-#  Each_Entry:
-#  # 10% if >= 100,000,001
-#  - Minimal_Value: 100000001
-#    Tax: 1000
+# Taxes for selling something (Vending)
+# Zeny received for the seller will be reduced after taxes from the total selling price but the buyer pays just the total selling price
+Selling:
+
+# Taxes for buying something (Buyingstore)
+# Zeny received for the seller will be the total selling price but the buyer must pay taxes for the total selling price
+Buying:

+ 18 - 18
conf/tax.yml

@@ -1,51 +1,51 @@
-# Taxes for selling something (vending)
+# Taxes for selling something (Vending)
 # Zeny received for the seller will be reduced after taxes from the total selling price but the buyer pays just the total selling price
 Selling:
   # Tax applied for total transaction
-  In_Total:
-  - Minimal_Value: 0
+  InTotal:
+  - MinimalValue: 0
     Tax: 0
 
   # Tax by selling entry
-  Each_Entry:
+  EachEntry:
   # 10% if >= 100,000,001
-  - Minimal_Value: 100000001
+  - MinimalValue: 100000001
     Tax: 1000
   # 8% if >= 10,000,001
-  - Minimal_Value: 10000001
+  - MinimalValue: 10000001
     Tax: 800
   # 6% if >= 1,000,001
-  - Minimal_Value: 1000001
+  - MinimalValue: 1000001
     Tax: 600
   # 4% if >= 100,001
-  - Minimal_Value: 100001
+  - MinimalValue: 100001
     Tax: 400
   # 2% if >= 10,001
-  - Minimal_Value: 10001
+  - MinimalValue: 10001
     Tax: 200
 
-# Taxes for buying something (buyingstore)
+# Taxes for buying something (Buyingstore)
 # Zeny received for the seller will be the total selling price but the buyer must pay taxes for the total selling price
 Buying:
   # Tax applied for total transaction
-  In_Total:
-  - Minimal_Value: 0
+  InTotal:
+  - MinimalValue: 0
     Tax: 0
 
   # Tax by buying entry
-  Each_Entry:
+  EachEntry:
   # 10% if >= 100,000,001
-  - Minimal_Value: 100000001
+  - MinimalValue: 100000001
     Tax: 1000
   # 8% if >= 10,000,001
-  - Minimal_Value: 10000001
+  - MinimalValue: 10000001
     Tax: 800
   # 6% if >= 1,000,001
-  - Minimal_Value: 1000001
+  - MinimalValue: 1000001
     Tax: 600
   # 4% if >= 100,001
-  - Minimal_Value: 100001
+  - MinimalValue: 100001
     Tax: 400
   # 2% if >= 10,001
-  - Minimal_Value: 10001
+  - MinimalValue: 10001
     Tax: 200

+ 5 - 5
src/map/buyingstore.cpp

@@ -165,7 +165,7 @@ int8 buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
 
 	taxdata = tax_get(TAX_BUYING);
 	if (battle_config.display_tax_info) {
-		clif_displaymessage(sd->fd, msg_txt(sd, 773)); // [ Tax Information ]
+		clif_displaymessage(sd->fd, msg_txt(sd, 776)); // [ Tax Information ]
 	}
 
 	// check item list
@@ -219,7 +219,7 @@ int8 buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
 
 		if (battle_config.display_tax_info) {
 			memset(msg, '\0', CHAT_SIZE_MAX);
-			sprintf(msg, msg_txt(sd, 774), itemdb_jname(nameid), price, '+', tax / 100., sd->buyingstore.items[i].price_vat); // %s : %u %c %.2f%% => %u
+			sprintf(msg, msg_txt(sd, 777), itemdb_jname(nameid), price, '+', tax / 100., sd->buyingstore.items[i].price_vat); // %s : %u %c %.2f%% => %u
 			clif_displaymessage(sd->fd, msg);
 		}
 	}
@@ -239,10 +239,10 @@ int8 buyingstore_create(struct map_session_data* sd, int zenylimit, unsigned cha
 	}
 
 	if (battle_config.display_tax_info && taxdata->total.size()) {
-		clif_displaymessage(sd->fd, msg_txt(sd, 775)); // [ Total Transaction Tax ]
+		clif_displaymessage(sd->fd, msg_txt(sd, 778)); // [ Total Transaction Tax ]
 		for (const auto &tax : taxdata->total) {
 			memset(msg, '\0', CHAT_SIZE_MAX);
-			sprintf(msg, msg_txt(sd, 776), tax.tax / 100., tax.minimal); // Tax: %.2f%% Minimal Transaction: %u
+			sprintf(msg, msg_txt(sd, 779), tax.tax / 100., tax.minimal); // Tax: %.2f%% Minimal Transaction: %u
 			clif_displaymessage(sd->fd, msg);
 		}
 	}
@@ -540,7 +540,7 @@ void buyingstore_trade(struct map_session_data* sd, uint32 account_id, unsigned
 
 		if (battle_config.display_tax_info) {
 			char msg[CHAT_SIZE_MAX];
-			sprintf(msg, msg_txt(sd, 777), itemdb_jname(nameid), (double)zeny, (double)zeny_paid);
+			sprintf(msg, msg_txt(sd, 780), itemdb_jname(nameid), (double)zeny, (double)zeny_paid); // %s : %.0f => %.0f
 			clif_displaymessage(pl_sd->fd, msg);
 		}
 

+ 8 - 8
src/map/tax.cpp

@@ -47,11 +47,11 @@ struct s_tax *tax_get(enum e_tax_type type) {
  * @param source: The source YAML file.
  */
 static void tax_readdb_sub(const YAML::Node &node, struct s_tax *taxdata, int *count, const std::string &source) {
-	if (node["In_Total"].IsDefined()) {
-		for (const auto &tax : node["In_Total"]) {
-			if (tax["Minimal_Value"].IsDefined() && tax["Tax"].IsDefined()) {
+	if (node["InTotal"].IsDefined()) {
+		for (const auto &tax : node["InTotal"]) {
+			if (tax["MinimalValue"].IsDefined() && tax["Tax"].IsDefined()) {
 				struct s_tax_entry entry;
-				entry.minimal = tax["Minimal_Value"].as<size_t>();
+				entry.minimal = tax["MinimalValue"].as<size_t>();
 				entry.tax = tax["Tax"].as<unsigned short>();
 				taxdata->total.push_back(entry);
 				std::sort(taxdata->total.begin(), taxdata->total.end(),
@@ -60,11 +60,11 @@ static void tax_readdb_sub(const YAML::Node &node, struct s_tax *taxdata, int *c
 			}
 		}
 	}
-	if (node["Each_Entry"].IsDefined()) {
-		for (const auto &tax : node["Each_Entry"]) {
-			if (tax["Minimal_Value"].IsDefined() && tax["Tax"].IsDefined()) {
+	if (node["EachEntry"].IsDefined()) {
+		for (const auto &tax : node["EachEntry"]) {
+			if (tax["MinimalValue"].IsDefined() && tax["Tax"].IsDefined()) {
 				struct s_tax_entry entry;
-				entry.minimal = tax["Minimal_Value"].as<size_t>();
+				entry.minimal = tax["MinimalValue"].as<size_t>();
 				entry.tax = tax["Tax"].as<unsigned short>();
 				taxdata->each.push_back(entry);
 				std::sort(taxdata->each.begin(), taxdata->each.end(),