void showInputDialog(std::string title, std::string content) { SETVF(input_title, title.c_str()); SETVF(input_content, content.c_str()); SETVF(input_data, ""); showgui("input_dialog"); }
int cleargui(int n = 0) { int clear = guistack.length(); if(n>0) clear = min(clear, n); loopi(clear) delete[] guistack.pop(); if(!guistack.empty()) showgui(guistack.last()); return clear; };
bool canQuit() { if ( !EditingSystem::madeChanges ) return true; // Changes were made, show a warning dialog showgui("can_quit"); return false; }
// Get instance data and create a GUI for it void show_instances() { REFLECT_PYTHON( get_possible_instances ); boost::python::object instances = get_possible_instances(); REFLECT_PYTHON( None ); if (instances == None) { setsvar("error_message", "Could not get the list of instances"); showgui("error"); return; } std::string command = "newgui instances [\n" " guitext \"Pick an instance to enter:\"\n" " guibar\n"; int numInstances = boost::python::extract<int>(instances.attr("__len__")()); for (int i = 0; i < numInstances; i++) { boost::python::object instance = instances[i]; std::string instance_id = boost::python::extract<std::string>(instance.attr("__getitem__")("instance_id")); std::string event_name = boost::python::extract<std::string>(instance.attr("__getitem__")("event_name")); assert( Utility::validateAlphaNumeric(instance_id) ); assert( Utility::validateAlphaNumeric(event_name, " (),.;") ); // XXX: Allow more than alphanumeric+spaces: ()s, .s, etc. command += " guibutton \"" + event_name + "\" \"connect_to_instance " + instance_id + "\"\n"; } command += "]\n"; command += "showgui instances\n"; Logging::log(Logging::DEBUG, "Instances GUI: %s\r\n", command.c_str()); execute(command.c_str()); }
void showCubeGuiMessage(std::string title, std::string content) { SETVF(message_title, title.c_str()); SETVF(message_content, content.c_str()); showgui("message"); }