|
|
@ -43,8 +43,25 @@ void printWeather(DFHack::WeatherType current)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
using namespace DFHack;
|
|
|
|
using namespace DFHack;
|
|
|
|
int main (int numargs, const char ** args)
|
|
|
|
int main (int argc, char** argv)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
string command = "";
|
|
|
|
|
|
|
|
bool quiet = false;
|
|
|
|
|
|
|
|
bool cmdarg = false;
|
|
|
|
|
|
|
|
for(int i = 1; i < argc; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string test = argv[i];
|
|
|
|
|
|
|
|
if(test == "-q")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
quiet = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
command = test;
|
|
|
|
|
|
|
|
cmdarg = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::ContextManager DFMgr("Memory.xml");
|
|
|
|
DFHack::Context *DF = DFMgr.getSingleContext();
|
|
|
|
DFHack::Context *DF = DFMgr.getSingleContext();
|
|
|
|
|
|
|
|
|
|
|
@ -68,9 +85,8 @@ int main (int numargs, const char ** args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
WeatherType current = (WeatherType) W->ReadCurrentWeather();
|
|
|
|
WeatherType current = (WeatherType) W->ReadCurrentWeather();
|
|
|
|
DF->Resume();
|
|
|
|
DF->Resume();
|
|
|
|
string command = "";
|
|
|
|
|
|
|
|
printWeather(current);
|
|
|
|
printWeather(current);
|
|
|
|
getline(cin, command);
|
|
|
|
if (command == "") getline(cin, command); // only read from stdin if command hasn't been passed on the console
|
|
|
|
DF->Suspend();
|
|
|
|
DF->Suspend();
|
|
|
|
if(command == "c")
|
|
|
|
if(command == "c")
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -88,10 +104,15 @@ int main (int numargs, const char ** args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
end = true;
|
|
|
|
end = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
command = "";
|
|
|
|
|
|
|
|
if(cmdarg) end = true; // exit the loop when a cmd line arg has been passed.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
|
|
|
|
if (!quiet)
|
|
|
|
|
|
|
|
{
|
|
|
|
std::cout << "Done. Press any key to continue" << std::endl;
|
|
|
|
std::cout << "Done. Press any key to continue" << std::endl;
|
|
|
|
cin.ignore();
|
|
|
|
cin.ignore();
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
DF->Detach();
|
|
|
|
DF->Detach();
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|