-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace activity ACT_ADV_INVENTORY
with uistate.open_menu
, remove ACT_VIEW_RECIPE
#76490
Conversation
Are you interested in giving |
Yup, I will go through them and see what I can do! It is more time-consuming than it should be, as I try to ensure I didn't break anything... |
ACT_ADV_INVENTORY
with uistate.open_menu
ACT_ADV_INVENTORY
with uistate.open_menu
, remove ACT_VIEW_RECIPE
I realized I didn't test temp_hide, so I will do that tomorrow. Edit: Yeah, it works as expected. |
I'm all in favor of spending time to ensure things aren't broken... |
6a3248d
to
bbc1164
Compare
Sorry, I don't remember. Kamayana has fixed a lot of bugs in |
I don't plan to work on it then. However, there is the patch: commit 68af3324a0e5c074039f661a4ab3a0fd0e037ac7
Author: Brambor <[email protected]>
Date: Tue Sep 17 14:35:25 2024 +0200
TODO remove unneded ? kill_advanced_inv
diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp
index 44fa35ae8a..235c4d2418 100644
--- a/src/advanced_inv.cpp
+++ b/src/advanced_inv.cpp
@@ -117,6 +117,12 @@ namespace
std::unique_ptr<advanced_inventory> advinv;
} // namespace
+void kill_advanced_inv()
+{
+ advinv.reset();
+ cancel_aim_processing();
+}
+
void create_advanced_inv()
{
if( !advinv ) {
@@ -129,12 +135,6 @@ void create_advanced_inv()
}
}
-void kill_advanced_inv()
-{
- advinv.reset();
- cancel_aim_processing();
-}
-
void temp_hide_advanced_inv()
{
if( advinv ) {
diff --git a/src/do_turn.cpp b/src/do_turn.cpp
index 21ff4c985a..64fde0e095 100644
--- a/src/do_turn.cpp
+++ b/src/do_turn.cpp
@@ -531,10 +531,6 @@ bool do_turn()
while( u.get_moves() > 0 && u.activity ) {
u.activity.do_turn( u );
}
- // FIXME: hack needed due to the legacy code in advanced_inventory::move_all_items()
- if( !u.activity ) {
- kill_advanced_inv();
- }
// Process NPC sound events before they move or they hear themselves talking
for( npc &guy : g->all_npcs() ) {
diff --git a/src/ui.h b/src/ui.h
index ce63b0b826..780935b6c6 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -553,7 +553,6 @@ class pointmenu_cb : public uilist_callback
void select( uilist *menu ) override;
};
-void kill_advanced_inv();
void temp_hide_advanced_inv();
/**
|
CleverRaven#76490 (comment) Co-authored-by: Brambor <[email protected]>
Summary
None
Purpose of change
view recipe
works only once per opened Advanced Inventory #62996Describe the solution
ACT_VIEW_RECIPE
, just run the menu code directly, as it is just opening a menu over AIM, which is fine.ACT_ADV_INVENTORY
withuistate.open_menu = create_advanced_inv
.Describe alternatives you've considered
They were all stupid.
I could also make this as two PRs. There would be a conflict on the save_legacy though.
Side effect
AIM doesn't open when it should after the save/load cycle if autosave is triggered during the "return to AIM" activity - see testing. This is fine.
Testing
Test fix:
view recipe
works only once per opened Advanced Inventory #62996Test temp_hide_advanced_inv
Test migration
What I did:
/
Open AIM.e
xamine machete.V
iew recipe. (repeat 10 times)There is the save:
TEST migration AIM & VIEW.zip
Note it has
ACT_ADV_INVENTORY
andACT_VIEW_RECIPE
in it in the .sav fileOn master:
In the new version:
ACT_ADV_INVENTORY
orACT_VIEW_RECIPE
.Additional context