@@ -32,6 +32,7 @@ command_result ktimer (Core * c, vector <string> & parameters);
3232command_result trackmenu (Core * c, vector <string> & parameters);
3333command_result trackpos (Core * c, vector <string> & parameters);
3434command_result colormods (Core * c, vector <string> & parameters);
35+ command_result zoom (Core * c, vector <string> & parameters);
3536
3637DFhackCExport const char * plugin_name ( void )
3738{
@@ -46,6 +47,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
4647 commands.push_back (PluginCommand (" trackmenu" ," Track menu ID changes (toggle)." ,trackmenu));
4748 commands.push_back (PluginCommand (" trackpos" ," Track mouse and designation coords (toggle)." ,trackpos));
4849 commands.push_back (PluginCommand (" colormods" ," Dump colormod vectors." ,colormods));
50+ commands.push_back (PluginCommand (" zoom" ," Zoom to x y z." ,zoom));
4951 return CR_OK ;
5052}
5153
@@ -152,6 +154,23 @@ command_result colormods (Core * c, vector <string> & parameters)
152154 return CR_OK ;
153155}
154156
157+ command_result zoom (Core * c, vector <string> & parameters)
158+ {
159+ if (parameters.size () < 3 )
160+ return CR_FAILURE ;
161+ int x = atoi ( parameters[0 ].c_str ());
162+ int y = atoi ( parameters[1 ].c_str ());
163+ int z = atoi ( parameters[2 ].c_str ());
164+ int xi, yi, zi;
165+ CoreSuspender cs (c);
166+ Gui * g = c->getGui ();
167+ if (g->getCursorCoords (xi, yi, zi))
168+ {
169+ g->setCursorCoords (x,y,z);
170+ }
171+ g->setViewCoords (x,y,z);
172+ }
173+
155174command_result ktimer (Core * c, vector <string> & parameters)
156175{
157176 if (timering)
0 commit comments