summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExpoSeed <43502820+ExpoSeed@users.noreply.github.com>2020-06-13 01:41:00 -0500
committerExpoSeed <43502820+ExpoSeed@users.noreply.github.com>2020-06-13 01:41:00 -0500
commit7ed360156a81f6cd590bd725a4063bf035e405bd (patch)
tree61925bbf6f297c5558561d51134f44f160950154
parent54cd9458deb8a67dafc3f999602ce1330b73ad7b (diff)
fixed errors and added explanations
-rw-r--r--Increase-money-limit.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/Increase-money-limit.md b/Increase-money-limit.md
index 5e0347b..d8bc8b8 100644
--- a/Increase-money-limit.md
+++ b/Increase-money-limit.md
@@ -4,16 +4,17 @@ This tutorial will raise the money limit to 9,999,999.
## Contents
1. [Increase max money amount](1-increase-max-money-amount)
-2. [Change X position on the money box](2-change-x-position-on-the-money-box)
-3. [Increase max digits](3-increase-max-digits)
+2. [Fix usages of money](2-fix-usages-of-money)
## 1. Increase max money amount
-Edit [src/money.c](../blob/master/src/money.c):
+The first and most obvious thing we need to do is increase the max money constant. Edit [src/money.c](../blob/master/src/money.c):
```diff
-#define MAX_MONEY 999999
+#define MAX_MONEY 9999999
```
-Also in the same file:
+Doing this change alone will have some consequences elsewhere though. A 7 digit number for money won't be processed and displayed correctly.
+
+The position the money amount is at is now incorrect. We can fix this by editing the function to print the amount in the same file:
```diff
void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, u8 speed)
{
@@ -21,6 +22,7 @@ Also in the same file:
+ PrintMoneyAmount(windowId, 0x20, 1, amount, speed);
}
+We also need to fix the printing of the money itself, as right now, it only supports a 6 digit number. All we need to do is change 6 to 7 in the same file:
void PrintMoneyAmount(u8 windowId, u8 x, u8 y, int amount, u8 speed)
{
u8 *txtPtr;
@@ -39,10 +41,11 @@ Also in the same file:
StringExpandPlaceholders(txtPtr, gText_PokedollarVar1);
AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, speed, NULL);
}
+Now that money prints properly, we need to update the places where they are used.
```
-## 2. Change X position on the money box
-Edit [src/shop.c](../blob/master/src/shop.c):
+## 2. Fix usages of money
+The X value when printing money in shops also needs to be adjusted. Edit [src/shop.c](../blob/master/src/shop.c):
```diff
static void BuyMenuPrintItemQuantityAndPrice(u8 taskId)
{
@@ -57,8 +60,7 @@ Edit [src/shop.c](../blob/master/src/shop.c):
}
```
-## 3. Increase max digits
-Edit [src/trainer_card.c](../blob/master/src/trainer_card.c):
+Finally, we need to adjust the function call in the trainer card. Edit [src/trainer_card.c](../blob/master/src/trainer_card.c):
```diff
static void PrintMoneyOnCard(void)
{