MCPcopy Create free account
hub / github.com/DFHack/dfhack / getCursorCoords

Method getCursorCoords

library/modules/Gui.cpp:2916–2935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2914}
2915
2916bool Gui::getCursorCoords(int32_t &x, int32_t &y, int32_t &z)
2917{
2918 using df::global::cursor;
2919 bool is_adv = World::isAdventureMode();
2920 if (is_adv || !cursor)
2921 {
2922 df::coord p;
2923 if (is_adv && game)
2924 {
2925 auto &look = game->main_interface.adventure.look;
2926 if (look.open)
2927 p = look.cursor;
2928 }
2929 x = p.x; y = p.y; z = p.z;
2930 return p.isValid();
2931 }
2932
2933 x = cursor->x; y = cursor->y; z = cursor->z;
2934 return has_cursor();
2935}
2936
2937bool Gui::getCursorCoords(df::coord &pos)
2938{

Callers 1

df_tilesFunction · 0.80

Calls 2

has_cursorFunction · 0.85
isValidMethod · 0.45

Tested by

no test coverage detected