void menu () { wprintw(stdscr, "To return to editing, press 1.\nTo save, press 2.\nTo save under a different name, press 3.\nTo reload the file, press 3.\nTo exit, press 0.\n"); input [1] = bie(); if(input[1] == '1') return; if(input[1] == '2') savescript(filename); if(input[1] == '3') { stufffilename(); savescript(filename); } if(input[1] == '4') loadscript(filename); if(input[1] == '0') { exit(0); } };
int main(int argc, char* argv[]) { initscr(); scrollok(stdscr, TRUE); wprintw(stdscr, "Welcome to Scripted ver. %d.%d for the Brave Quest engine.\nCopyright 2012 Mad Science Inc.\nPlease do not redistrubute.\n",scriptedvernum,scriptedvernum2); stufffilename(); if(loadscript(filename) == 1) { wprintw(stdscr, "File not Found. Would you like to make a new file?\n"); if(bie() == 'y') { cleanfilebuff(); if(savescript(filename) == 1) { wprintw(stdscr, "Your disk sucks.\n"); bi(); return 1; } } else { wprintw(stdscr, "Goodbye.\n"); endwin(); return 1; } } currlinenum = linenum; menu(); wprintw(stdscr, "Press escape to go to the save menu\n"); for(;;) { wprintw(stdscr, "q= give, w= take, e= say, r= flag, t= move, y= battle, u= check flag, i= check item, o= party add, p= party remove, [ = check character\n"); wprintw(stdscr, "a= warp, s= check experience, d= give experience, f= make experience, g= exec script, h= screen effect, j= user input, k= goline, l= make health\n"); wprintw(stdscr, "b= check stat, n= make stat, m= blank, ,= show line, .= change line.\n"); input[0] = bie(); if(input[0] == 27) menu(); if(input[0] == 'q') give(); if(input[0] == 'w') take(); if(input[0] == 'e') say(); if(input[0] == 'r') flag(); if(input[0] == 't') mmove(); if(input[0] == 'y') battle(); if(input[0] == 'u') checkflag(); if(input[0] == 'i') checkitem(); if(input[0] == 'o') partyadd(); if(input[0] == 'p') partyrm(); if(input[0] == '[') checkparty(); if(input[0] == 'a') warp(); if(input[0] == 's') checkexp(); if(input[0] == 'd') giveexp(); if(input[0] == 'f') makeexp(); if(input[0] == 'g') execscript(); if(input[0] == 'h') screeneffect(); if(input[0] == 'j') userinput(); if(input[0] == 'k') goline(); if(input[0] == 'l') makehealth(); if(input[0] == 'z') teachspell(); if(input[0] == 'x') unlearnspell(); if(input[0] == 'b') checkstat(); if(input[0] == 'n') makestat(); if(input[0] == 'm') blank(); if(input[0] == ',') showline(); if(input[0] == '.') changeline(); if(currlinenum > linenum) linenum = currlinenum; } return 0; };
/*-----------------------------------------------------------------------------------*/ EK_EVENTHANDLER(configedit_eventhandler, ev, data) { EK_EVENTHANDLER_ARGS(ev, data); if(ev == EK_EVENT_INIT) { /* Create window. */ ctk_window_new(&window, 32, 18, "Config editor"); CTK_WIDGET_ADD(&window, &cfslabel); CTK_WIDGET_ADD(&window, &cfstextentry); CTK_TEXTENTRY_CLEAR(&cfstextentry); CTK_WIDGET_ADD(&window, &themelabel); CTK_WIDGET_ADD(&window, &themetextentry); CTK_TEXTENTRY_CLEAR(&themetextentry); CTK_WIDGET_ADD(&window, &driverlabel); CTK_WIDGET_ADD(&window, &drivertextentry); CTK_TEXTENTRY_CLEAR(&drivertextentry); CTK_WIDGET_ADD(&window, &screensaverlabel); CTK_WIDGET_ADD(&window, &screensavertextentry); CTK_TEXTENTRY_CLEAR(&screensavertextentry); CTK_WIDGET_ADD(&window, &ipaddrlabel); CTK_WIDGET_ADD(&window, &ipaddrtextentry); CTK_TEXTENTRY_CLEAR(&ipaddrtextentry); CTK_WIDGET_ADD(&window, &netmasklabel); CTK_WIDGET_ADD(&window, &netmasktextentry); CTK_TEXTENTRY_CLEAR(&netmasktextentry); CTK_WIDGET_ADD(&window, &gatewaylabel); CTK_WIDGET_ADD(&window, &gatewaytextentry); CTK_TEXTENTRY_CLEAR(&gatewaytextentry); CTK_WIDGET_ADD(&window, &dnsserverlabel); CTK_WIDGET_ADD(&window, &dnsservertextentry); CTK_TEXTENTRY_CLEAR(&dnsservertextentry); CTK_WIDGET_ADD(&window, &savebutton); CTK_WIDGET_ADD(&window, &cancelbutton); CTK_WIDGET_FOCUS(&window, &cfstextentry); /* Fill the configuration strings with values from the current configuration */ initscript(); ctk_window_open(&window); } else if(ev == ctk_signal_button_activate) { if(data == (ek_data_t)&savebutton) { savescript(); quit_services(); ctk_window_close(&window); configedit_quit(); program_handler_load("config.prg", NULL); } else if(data == (ek_data_t)&cancelbutton) { ctk_window_close(&window); configedit_quit(); } } else if(ev == ctk_signal_window_close || ev == EK_EVENT_REQUEST_EXIT) { ctk_window_close(&window); configedit_quit(); } }