summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-05-29 20:06:08 +0200
committereray orçunus <erayorcunus@gmail.com>2020-05-29 20:06:08 +0200
commite38f2a7fb238787aec527f648fc5ce2bce2296c9 (patch)
tree2460c7f7f78fbef3c53b899b65a15364186853d6
parentMerge branch 'master' of https://github.com/GTAmodding/re3 into erorcun (diff)
downloadre3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.tar
re3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.tar.gz
re3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.tar.bz2
re3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.tar.lz
re3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.tar.xz
re3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.tar.zst
re3-e38f2a7fb238787aec527f648fc5ce2bce2296c9.zip
-rw-r--r--src/core/Frontend.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 5350cb02..a38df5e0 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -412,7 +412,7 @@ CMenuManager::ThingsToDoBeforeGoingBack()
if (option.returnPrevPageFunc)
option.returnPrevPageFunc();
- if (option.type == FEOPTION_DYNAMIC)
+ if (m_nCurrOption == option.screenOptionOrder && option.type == FEOPTION_DYNAMIC)
option.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
if (option.onlyApplyOnEnter)
@@ -1344,11 +1344,18 @@ CMenuManager::Draw()
}
#ifdef CUSTOM_FRONTEND_OPTIONS
+ static int lastOption = m_nCurrOption;
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action == MENUACTION_TRIGGERFUNC) {
FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
if (option.onlyApplyOnEnter && m_nCurrOption != i)
option.displayedValue = *option.value;
+ if (m_nCurrOption != lastOption && lastOption == i) {
+ FrontendOption &oldOption = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[lastOption].m_TargetMenu];
+ if (oldOption.type == FEOPTION_DYNAMIC)
+ oldOption.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
+ }
+ lastOption = m_nCurrOption;
}
#endif
@@ -4339,13 +4346,6 @@ CMenuManager::ProcessButtonPresses(void)
m_nCurrOption--;
}
}
-#ifdef CUSTOM_FRONTEND_OPTIONS
- if (m_nCurrOption != prevOption && aScreens[m_nCurrScreen].m_aEntries[prevOption].m_Action == MENUACTION_TRIGGERFUNC) {
- FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[prevOption].m_TargetMenu];
- if (option.type == FEOPTION_DYNAMIC)
- option.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
- }
-#endif
if (optionSelected) {
int option = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;