summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghoulslash <41651341+ghoulslash@users.noreply.github.com>2020-09-09 13:19:19 -0600
committerghoulslash <41651341+ghoulslash@users.noreply.github.com>2020-09-09 13:19:19 -0600
commitd349bf9d3466c3f93bcaa53f7b3eef0312b36be4 (patch)
treebe84ac7f301d3438eb84e5e15306d50b186b5fe4
parent5a82983e25e469de5cb427d9c90af1b52dcf03df (diff)
Created Repeated Field Medicine Use (markdown)
-rw-r--r--Repeated-Field-Medicine-Use.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/Repeated-Field-Medicine-Use.md b/Repeated-Field-Medicine-Use.md
new file mode 100644
index 0000000..f9cb188
--- /dev/null
+++ b/Repeated-Field-Medicine-Use.md
@@ -0,0 +1,47 @@
+## Keep Party Menu Open During Field Medicine Use
+
+Credit: ghoulslash
+
+If you're using a lot of potions at once, it can be annoying to keep returning to the bag after use. This simple fix keeps the menu open unless you run out of potions. The user will have to select `Cancel` or press `B` to exit the party menu. But this is intuitive.
+
+Let's start by opening [src/party_menu.c](../blob/master/src/party_menu.c)
+
+### Handle Medicine
+
+Find the function `ItemUseCB_Medicine`. Towards the end of the function, replace
+```c
+ .....
+ else
+ {
+ GetMonNickname(mon, gStringVar1);
+ GetMedicineItemEffectMessage(item);
+ DisplayPartyMenuMessage(gStringVar4, TRUE);
+ ScheduleBgCopyTilemapToVram(2);
+ gTasks[taskId].func = task;
+ }
+```
+
+with
+
+```c
+ .....
+ else
+ {
+ GetMonNickname(mon, gStringVar1);
+ GetMedicineItemEffectMessage(item);
+ DisplayPartyMenuMessage(gStringVar4, TRUE);
+ ScheduleBgCopyTilemapToVram(2);
+ if (gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(item, 1))
+ gTasks[taskId].func = Task_ReturnToChooseMonAfterText;
+ else
+ gTasks[taskId].func = task;
+ }
+```
+
+Next, find `Task_DisplayHPRestoredMessage`. Replace `gTasks[taskId].func = Task_ClosePartyMenuAfterText;` with:
+```c
+ if (gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(gSpecialVar_ItemId, 1))
+ gTasks[taskId].func = Task_ReturnToChooseMonAfterText;
+ else
+ gTasks[taskId].func = Task_ClosePartyMenuAfterText;
+```