Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Core/GameEngine/Include/Common/OptionPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class OptionPreferences : public UserPreferences
void setOnlineIPAddress(UnsignedInt IP);
Bool getArchiveReplaysEnabled() const;
Bool getAlternateMouseModeEnabled();
Bool getRightMouseScrollWithAlternateMouseEnabled() const;
Bool getRetaliationModeEnabled();
Bool getDoubleClickAttackMoveEnabled();
Real getScrollFactor();
Expand Down
12 changes: 12 additions & 0 deletions Core/GameEngine/Source/Common/OptionPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,18 @@
return FALSE;
}

Bool OptionPreferences::getRightMouseScrollWithAlternateMouseEnabled() const
{
OptionPreferences::const_iterator it = find("UseRightMouseScrollWithAlternateMouse");
if (it == end())
return TheGlobalData->m_useRightMouseScrollWithAlternateMouse;

Check failure on line 210 in Core/GameEngine/Source/Common/OptionPreferences.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-profile+t+e

'm_useRightMouseScrollWithAlternateMouse' : is not a member of 'GlobalData'

Check failure on line 210 in Core/GameEngine/Source/Common/OptionPreferences.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'm_useRightMouseScrollWithAlternateMouse' : is not a member of 'GlobalData'

Check failure on line 210 in Core/GameEngine/Source/Common/OptionPreferences.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6+t+e

'm_useRightMouseScrollWithAlternateMouse' : is not a member of 'GlobalData'

Check failure on line 210 in Core/GameEngine/Source/Common/OptionPreferences.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-debug+t+e

'm_useRightMouseScrollWithAlternateMouse': is not a member of 'GlobalData'

Check failure on line 210 in Core/GameEngine/Source/Common/OptionPreferences.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32+t+e

'm_useRightMouseScrollWithAlternateMouse': is not a member of 'GlobalData'

Check failure on line 210 in Core/GameEngine/Source/Common/OptionPreferences.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-profile+t+e

'm_useRightMouseScrollWithAlternateMouse': is not a member of 'GlobalData'

if (stricmp(it->second.str(), "yes") == 0) {
return TRUE;
}
return FALSE;
Comment thread
Skyaero42 marked this conversation as resolved.
}
Comment thread
xezon marked this conversation as resolved.

Bool OptionPreferences::getRetaliationModeEnabled()
{
OptionPreferences::const_iterator it = find("Retaliation");
Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class GlobalData : public SubsystemInterface
Bool m_enableStaticLOD;
Int m_terrainLODTargetTimeMS;
Bool m_useAlternateMouse;
Bool m_useRightMouseScrollWithAlternateMouse; // TheSuperHackers @feature User option for RMB scroll in Alternate Mouse mode.
Bool m_clientRetaliationModeEnabled;
Bool m_doubleClickAttackMove;
Bool m_rightMouseAlwaysScrolls;
Expand Down
9 changes: 9 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,15 @@ GlobalData::GlobalData()
//-allAdvice feature
//m_allAdvice = FALSE;

m_useAlternateMouse = FALSE;
#if RTS_GENERALS
// disable mouse scrolling in alternate mouse mode, per Harvard 7/15/03
m_useRightMouseScrollWithAlternateMouse = FALSE;
#else
m_useRightMouseScrollWithAlternateMouse = TRUE;
#endif
Comment thread
xezon marked this conversation as resolved.
m_clientRetaliationModeEnabled = TRUE; //On by default.
m_doubleClickAttackMove = FALSE;
Comment thread
Skyaero42 marked this conversation as resolved.

}

Expand Down Expand Up @@ -1194,6 +1202,7 @@ void GlobalData::parseGameDataDefinition( INI* ini )
// override INI values with user preferences
OptionPreferences optionPref;
TheWritableGlobalData->m_useAlternateMouse = optionPref.getAlternateMouseModeEnabled();
TheWritableGlobalData->m_useRightMouseScrollWithAlternateMouse = optionPref.getRightMouseScrollWithAlternateMouseEnabled();
TheWritableGlobalData->m_clientRetaliationModeEnabled = optionPref.getRetaliationModeEnabled();
TheWritableGlobalData->m_doubleClickAttackMove = optionPref.getDoubleClickAttackMoveEnabled();
TheWritableGlobalData->m_keyboardScrollFactor = optionPref.getScrollFactor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,13 @@ static void saveOptions()
TheWritableGlobalData->m_useAlternateMouse = GadgetCheckBoxIsChecked(checkAlternateMouse);
(*pref)["UseAlternateMouse"] = TheWritableGlobalData->m_useAlternateMouse ? "yes" : "no";

// TheSuperHackers @todo Add check box ?
{
Bool useRightMouseScrollWithAlternateMouse = pref->getRightMouseScrollWithAlternateMouseEnabled();
(*pref)["UseRightMouseScrollWithAlternateMouse"] = useRightMouseScrollWithAlternateMouse ? "yes" : "no";
TheWritableGlobalData->m_useRightMouseScrollWithAlternateMouse = useRightMouseScrollWithAlternateMouse;
}

TheWritableGlobalData->m_clientRetaliationModeEnabled = GadgetCheckBoxIsChecked(checkRetaliation);
(*pref)["Retaliation"] = TheWritableGlobalData->m_clientRetaliationModeEnabled? "yes" : "no";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
m_anchor = msg->getArgument( 0 )->pixel;
m_currentPos = msg->getArgument( 0 )->pixel;

if (!TheInGameUI->isSelecting() && !m_isScrolling)
const Bool userWantsRMBScroll = !TheGlobalData->m_useAlternateMouse || TheGlobalData->m_useRightMouseScrollWithAlternateMouse;

if (userWantsRMBScroll && !TheInGameUI->isSelecting() && !m_isScrolling)
{
setScrolling(SCROLL_RMB);
}
Expand Down
Loading