ULTIMA4: Locate Position to keybinder

This commit is contained in:
Paul Gilbert 2020-04-12 19:52:51 -07:00
parent 2920a76611
commit 6bc1ef85b7
5 changed files with 23 additions and 13 deletions

View File

@ -397,6 +397,22 @@ bool Debugger::cmdJimmy(int argc, const char **argv) {
return isDebuggerActive();
}
bool Debugger::cmdLocate(int argc, const char **argv) {
// can't use sextant in dungeon or in combat
if (g_context->_location->_context & ~(CTX_DUNGEON | CTX_COMBAT)) {
if (g_ultima->_saveGame->_sextants >= 1)
print("Locate position\nwith sextant\n Latitude: %c'%c\"\nLongitude: %c'%c\"",
g_context->_location->_coords.y / 16 + 'A', g_context->_location->_coords.y % 16 + 'A',
g_context->_location->_coords.x / 16 + 'A', g_context->_location->_coords.x % 16 + 'A');
else
print("%cLocate position with what?%c", FG_GREY, FG_WHITE);
} else {
screenMessage("%cNot here!%c", FG_GREY, FG_WHITE);
}
return isDebuggerActive();
}
bool Debugger::cmdPass(int argc, const char **argv) {
print("Pass");
return isDebuggerActive();

View File

@ -128,6 +128,11 @@ private:
*/
bool cmdJimmy(int argc, const char **argv);
/**
* Locate position
*/
bool cmdLocate(int argc, const char **argv);
/**
* Pass turn
*/

View File

@ -725,18 +725,6 @@ bool GameController::keyPressed(int key) {
}
break;
case 'l':
/* can't use sextant in dungeon or in combat */
if (g_context->_location->_context & ~(CTX_DUNGEON | CTX_COMBAT)) {
if (g_ultima->_saveGame->_sextants >= 1)
screenMessage("Locate position\nwith sextant\n Latitude: %c'%c\"\nLongitude: %c'%c\"\n",
g_context->_location->_coords.y / 16 + 'A', g_context->_location->_coords.y % 16 + 'A',
g_context->_location->_coords.x / 16 + 'A', g_context->_location->_coords.x % 16 + 'A');
else
screenMessage("%cLocate position with what?%c\n", FG_GREY, FG_WHITE);
} else screenMessage("%cNot here!%c\n", FG_GREY, FG_WHITE);
break;
case 'm':
mixReagents();
#ifdef IOS

View File

@ -52,6 +52,7 @@ static const KeybindingRecord KEYS[] = {
{ KEYBIND_HOLE_UP, "HOLE-UP", "Hole Up", "hole", "h", nullptr },
{ KEYBIND_JIMMY, "JIMMY", "Jimmy", "jimmy", "j", nullptr },
{ KEYBIND_IGNITE, "IGNITE", "Ignite", "ignite", "i", nullptr },
{ KEYBIND_LOCATE, "LOCATE", "Locate Position", "locate", "l", nullptr },
{ KEYBIND_PASS, "PASS", "Pass", "pass", "SPACE", nullptr },

View File

@ -32,7 +32,7 @@ enum KeybindingAction {
KEYBIND_UP, KEYBIND_DOWN, KEYBIND_LEFT, KEYBIND_RIGHT,
KEYBIND_ATTACK, KEYBIND_BOARD, KEYBIND_CAST, KEYBIND_ENTER,
KEYBIND_FIRE, KEYBIND_GET, KEYBIND_HOLE_UP, KEYBIND_IGNITE,
KEYBIND_JIMMY,
KEYBIND_JIMMY, KEYBIND_LOCATE,
KEYBIND_PASS,
KEYBIND_NONE