ULTIMA4: Use to keybinder

This commit is contained in:
Paul Gilbert 2020-04-13 20:11:09 -07:00
parent 5144447327
commit aa04a30eb3
5 changed files with 23 additions and 14 deletions

View File

@ -68,6 +68,7 @@ Debugger::Debugger() : Shared::Debugger() {
registerCmd("ready", WRAP_METHOD(Debugger, cmdReadyWeapon));
registerCmd("search", WRAP_METHOD(Debugger, cmdSearch));
registerCmd("talk", WRAP_METHOD(Debugger, cmdTalk));
registerCmd("use", WRAP_METHOD(Debugger, cmdUse));
registerCmd("3d", WRAP_METHOD(Debugger, cmd3d));
registerCmd("collisions", WRAP_METHOD(Debugger, cmdCollisions));
@ -849,6 +850,20 @@ bool Debugger::cmdTalk(int argc, const char **argv) {
return isDebuggerActive();
}
bool Debugger::cmdUse(int argc, const char **argv) {
print("Use which item:");
if (settings._enhancements) {
// a little xu4 enhancement: show items in inventory when prompted for an item to use
g_context->_stats->setView(STATS_ITEMS);
}
#ifdef IOS
U4IOS::IOSConversationHelper::setIntroString("Use which item?");
#endif
itemUse(gameGetInput().c_str());
return isDebuggerActive();
}
bool Debugger::cmd3d(int argc, const char **argv) {
if (g_context->_location->_context == CTX_DUNGEON) {

View File

@ -184,6 +184,12 @@ private:
* Talk
*/
bool cmdTalk(int argc, const char **argv);
/**
* Use
*/
bool cmdUse(int argc, const char **argv);
private:
/**
* Collision detection on/off

View File

@ -683,19 +683,6 @@ bool GameController::keyPressed(int key) {
break;
}
case 'u': {
screenMessage("Use which item:\n");
if (settings._enhancements) {
/* a little xu4 enhancement: show items in inventory when prompted for an item to use */
g_context->_stats->setView(STATS_ITEMS);
}
#ifdef IOS
U4IOS::IOSConversationHelper::setIntroString("Use which item?");
#endif
itemUse(gameGetInput().c_str());
break;
}
case 'v':
if (g_music->toggle())
screenMessage("Volume On!\n");

View File

@ -63,6 +63,7 @@ static const KeybindingRecord KEYS[] = {
{ KEYBIND_READY_WEAPON, "READY-WEAPON", "Ready Weapon", "ready", nullptr },
{ KEYBIND_SEARCH, "SEARCH", "Search", "search", "s", nullptr },
{ KEYBIND_TALK, "TALK", "Talk", "talk", "t", nullptr },
{ KEYBIND_USE, "USE", "Use", "use", "u", nullptr },
{ KEYBIND_NONE, nullptr, nullptr, nullptr, nullptr, nullptr }
};

View File

@ -35,7 +35,7 @@ enum KeybindingAction {
KEYBIND_IGNITE, KEYBIND_JIMMY, KEYBIND_LOCATE, KEYBIND_MIX,
KEYBIND_NEW_ORDER, KEYBIND_OPEN_DOOR, KEYBIND_PASS,
KEYBIND_PEER, KEYBIND_QUIT_SAVE, KEYBIND_READY_WEAPON,
KEYBIND_SEARCH, KEYBIND_TALK,
KEYBIND_SEARCH, KEYBIND_TALK, KEYBIND_USE,
KEYBIND_NONE
};