PDA

View Full Version : ZC: Open Quest Dialogue Improvement



ZoriaRPG
01-12-2017, 11:46 AM
At present, the behaviour when loading a quest in ZC, is that after selecting the file, the jwin dialogue that displays the quest header details, places the focus on the 'Load' button, not the 'OK' button. This means that if the user hits Enter/Return, it returns them to the file select dialogue. The natural instinct here, is to hit enter/return, not the K key, which continues to the name entry screen to run the quest.

I suggest changing this behaviour, so that 'OK' is the selected object, and that pressing enter/return works as if the user pressed the K key. This would be far less aggravating, and would have no ill effects.

This is what I did in title.cpp, and it works quite nicely:




int custom_game(int file)
{
zquestheader h;
char infostr[200];
char path[2048];
int ret=0;
int focus_obj = 1;

if(is_relative_filename(saves[file].qstpath))
{
sprintf(qstpath,"%s%s",qstdir,saves[file].qstpath);
}
else
{
sprintf(qstpath,"%s", saves[file].qstpath);
}

gamemode_dlg[0].dp2 = lfont;
gamemode_dlg[2].dp = get_filename(qstpath);

if(get_quest_info(&h,infostr)==0)
{
gamemode_dlg[4].dp = infostr;
gamemode_dlg[5].flags = D_DISABLED;
}
else
{
gamemode_dlg[4].dp = infostr;
gamemode_dlg[5].flags = D_EXIT;
}

gamemode_dlg[2].d1 = gamemode_dlg[4].d1 = 0;
gamemode_dlg[2].d2 = gamemode_dlg[4].d2 = 0;
system_pal();
show_mouse(screen);

clear_keybuf();

if(is_large)
large_dialog(gamemode_dlg);


while((ret=zc_popup_dialog(gamemode_dlg,focus_obj) )==1)
{
scare_mouse();
blit(screen,tmp_scr,scrx,scry,0,0,320,240);
unscare_mouse();

int sel=0;
static EXT_LIST list[] =
{
{ (char *)"ZC Quests (*.qst)", (char *)"qst" },
{ NULL, NULL }
};

strcpy(path, qstpath);

if(jwin_file_browse_ex("Load Quest", path, list, &sel, 2048, -1, -1, lfont))
{
// strcpy(qstpath, path);
replace_extension(qstpath,path,"qst",2047);
gamemode_dlg[2].dp = get_filename(qstpath);

if(get_quest_info(&h,infostr)==0)
{
gamemode_dlg[4].dp = infostr;
gamemode_dlg[5].flags = D_DISABLED;
focus_obj = 1;
}
else
{
gamemode_dlg[4].dp = infostr;
gamemode_dlg[5].flags = D_EXIT;
focus_obj = 5;
}

gamemode_dlg[2].d1 = gamemode_dlg[4].d1 = 0;
gamemode_dlg[2].d2 = gamemode_dlg[4].d2 = 0;
}

scare_mouse();
blit(tmp_scr,screen,0,0,scrx,scry,320,240);
unscare_mouse();
}

show_mouse(NULL);
game_pal();
key[KEY_ESC]=0;
chosecustomquest = (ret==5);
return (int)chosecustomquest;
}

Lüt
01-15-2017, 06:46 AM
I agree - I've "gone back" to load quests a number of times when I simply meant to start playing them.

I would easily welcome this update.