本文整理汇总了C++中dfhack::Gui::Start方法的典型用法代码示例。如果您正苦于以下问题:C++ Gui::Start方法的具体用法?C++ Gui::Start怎么用?C++ Gui::Start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dfhack::Gui
的用法示例。
在下文中一共展示了Gui::Start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plugin_onupdate
DFhackCExport command_result plugin_onupdate ( Core * c )
{
if(timering == true)
{
uint64_t time2 = GetTimeMs64();
// harmless potential data race here...
uint64_t delta = time2-timeLast;
// harmless potential data race here...
timeLast = time2;
c->con.print("Time delta = %d ms\n", delta);
}
if(trackmenu_flg)
{
DFHack::Gui * g =c->getGui();
if (last_menu != *g->df_menu_state)
{
last_menu = *g->df_menu_state;
c->con.print("Menu: %d\n",last_menu);
}
}
if(trackpos_flg)
{
DFHack::Gui * g =c->getGui();
g->Start();
int32_t desig_x, desig_y, desig_z;
g->getDesignationCoords(desig_x,desig_y,desig_z);
if(desig_x != last_designation[0] || desig_y != last_designation[1] || desig_z != last_designation[2])
{
last_designation[0] = desig_x;
last_designation[1] = desig_y;
last_designation[2] = desig_z;
c->con.print("Designation: %d %d %d\n",desig_x, desig_y, desig_z);
}
int mouse_x, mouse_y;
g->getMousePos(mouse_x,mouse_y);
if(mouse_x != last_mouse[0] || mouse_y != last_mouse[1])
{
last_mouse[0] = mouse_x;
last_mouse[1] = mouse_y;
c->con.print("Mouse: %d %d\n",mouse_x, mouse_y);
}
}
return CR_OK;
}