Add functions to get and set the pause state in DF

develop
Japa 2016-11-08 13:40:08 +05:30
parent 99051f176b
commit ebc1a6d85e
1 changed files with 16 additions and 0 deletions

@ -145,6 +145,8 @@ static command_result GetPlantRaws(color_ostream &stream, const EmptyMessage *in
static command_result CopyScreen(color_ostream &stream, const EmptyMessage *in, ScreenCapture *out);
static command_result PassKeyboardEvent(color_ostream &stream, const KeyboardEvent *in);
static command_result SendDigCommand(color_ostream &stream, const DigCommand *in);
static command_result SetPauseState(color_ostream & stream, const SingleBool * in);
static command_result GetPauseState(color_ostream & stream, const EmptyMessage * in, SingleBool * out);
void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem);
@ -250,6 +252,8 @@ DFhackCExport RPCService *plugin_rpcconnect(color_ostream &)
svc->addFunction("CopyScreen", CopyScreen);
svc->addFunction("PassKeyboardEvent", PassKeyboardEvent);
svc->addFunction("SendDigCommand", SendDigCommand);
svc->addFunction("SetPauseState", SetPauseState);
svc->addFunction("GetPauseState", GetPauseState);
return svc;
}
@ -3008,3 +3012,15 @@ static command_result SendDigCommand(color_ostream &stream, const DigCommand *in
mc.WriteAll();
return CR_OK;
}
static command_result SetPauseState(color_ostream &stream, const SingleBool *in)
{
DFHack::World::SetPauseState(in->value());
return CR_OK;
}
static command_result GetPauseState(color_ostream &stream, const EmptyMessage *in, SingleBool *out)
{
out->set_value(World::ReadPauseState());
return CR_OK;
}