Skip to content

Commit 59479c0

Browse files
authored
[GEN][ZH] Add default key mappings for the 'Ignore Prerequisites' and 'Free Build' debug commands (#1313)
Can now toggle 'Ignore Prerequisites' with ALT + P and 'Free Build' with ALT + B
1 parent 7035ac4 commit 59479c0

File tree

2 files changed

+50
-0
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream
  • Generals/Code/GameEngine/Source/GameClient/MessageStream

2 files changed

+50
-0
lines changed

Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,31 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
692692
map->m_usableIn = COMMANDUSABLE_GAME;
693693
}
694694
}
695+
696+
#if defined(RTS_DEBUG)
697+
{
698+
// Is useful for Generals and Zero Hour.
699+
MetaMapRec *map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_DEMO_REMOVE_PREREQ);
700+
if (map->m_key == MK_NONE)
701+
{
702+
map->m_key = MK_P;
703+
map->m_transition = DOWN;
704+
map->m_modState = ALT;
705+
map->m_usableIn = COMMANDUSABLE_GAME;
706+
}
707+
}
708+
{
709+
// Is useful for Generals and Zero Hour.
710+
MetaMapRec *map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_DEMO_FREE_BUILD);
711+
if (map->m_key == MK_NONE)
712+
{
713+
map->m_key = MK_B;
714+
map->m_transition = DOWN;
715+
map->m_modState = ALT;
716+
map->m_usableIn = COMMANDUSABLE_GAME;
717+
}
718+
}
719+
#endif // defined(RTS_DEBUG)
695720
}
696721

697722
//-------------------------------------------------------------------------------------------------

GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,31 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t)
754754
map->m_usableIn = COMMANDUSABLE_GAME;
755755
}
756756
}
757+
758+
#if defined(RTS_DEBUG)
759+
{
760+
// Is useful for Generals and Zero Hour.
761+
MetaMapRec *map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_DEMO_REMOVE_PREREQ);
762+
if (map->m_key == MK_NONE)
763+
{
764+
map->m_key = MK_P;
765+
map->m_transition = DOWN;
766+
map->m_modState = ALT;
767+
map->m_usableIn = COMMANDUSABLE_GAME;
768+
}
769+
}
770+
{
771+
// Is useful for Generals and Zero Hour.
772+
MetaMapRec *map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_DEMO_FREE_BUILD);
773+
if (map->m_key == MK_NONE)
774+
{
775+
map->m_key = MK_B;
776+
map->m_transition = DOWN;
777+
map->m_modState = ALT;
778+
map->m_usableIn = COMMANDUSABLE_GAME;
779+
}
780+
}
781+
#endif // defined(RTS_DEBUG)
757782
}
758783

759784
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)