* Scenario and character editors code tweaked so that it compiles with newer windres.exe version and Code::Blocks IDE. Code::Blocks project files included for both Editor and the sound DLL project (seems like speed optimization breaks the scenario editor : monster and item dialogs doesn't accept any entered value).
* Cleaned unused variable in Scenario and Character editors code. Chokboyz git-svn-id: http://openexile.googlecode.com/svn/trunk@139 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -108,7 +108,7 @@ char edit_spec_mess_mess[256] = {
|
||||
1,1,1,1,1,1,1,1,1,3,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0};
|
||||
0,0,0,0,0,0};
|
||||
char edit_pict_mess[256] = {
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -163,8 +163,8 @@ char edit_jumpto_mess[256] = {
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0};
|
||||
|
||||
|
||||
|
||||
|
||||
void fancy_choice_dialog_event_filter (short item_hit)
|
||||
{
|
||||
dialog_not_toast = FALSE;
|
||||
@@ -174,12 +174,11 @@ void fancy_choice_dialog_event_filter (short item_hit)
|
||||
short fancy_choice_dialog(short which_dlog,short parent)
|
||||
// ignore parent in Mac version
|
||||
{
|
||||
short item_hit,i,store_dialog_answer;
|
||||
char temp_str[256];
|
||||
|
||||
short i,store_dialog_answer;
|
||||
|
||||
store_dialog_answer = dialog_answer;
|
||||
//make_cursor_sword();
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(which_dlog,parent);
|
||||
|
||||
|
||||
@@ -191,19 +190,19 @@ short fancy_choice_dialog(short which_dlog,short parent)
|
||||
|
||||
i = dialog_answer;
|
||||
dialog_answer = store_dialog_answer;
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//cre = check range error
|
||||
Boolean cre(short val,short min,short max,char *text1, char *text2,short parent_num)
|
||||
Boolean cre(short val,short min,short max,char *text1, char *text2,short parent_num)
|
||||
{
|
||||
if ((val < min) || (val > max)) {
|
||||
give_error(text1,text2,parent_num);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -214,9 +213,6 @@ void give_error(char *text1, char *text2,short parent_num)
|
||||
|
||||
void display_strings_event_filter (short item_hit)
|
||||
{
|
||||
short i;
|
||||
Boolean had1 = FALSE, had2 = FALSE;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
dialog_not_toast = FALSE;
|
||||
@@ -229,13 +225,8 @@ void display_strings(char *text1, char *text2,
|
||||
char *title,short sound_num,short graphic_num,short parent_num)
|
||||
{
|
||||
|
||||
short item_hit;
|
||||
char sign_text[256];
|
||||
location view_loc;
|
||||
Boolean sound_done = FALSE;
|
||||
|
||||
//make_cursor_sword();
|
||||
|
||||
|
||||
if ((text1 == NULL) && (text2 == NULL))
|
||||
return;
|
||||
store_which_string_dlog = 970;
|
||||
@@ -244,9 +235,9 @@ void display_strings(char *text1, char *text2,
|
||||
if ((text2 != NULL) && (text2[0] != 0))
|
||||
store_which_string_dlog++;
|
||||
cd_create_dialog_parent_num(store_which_string_dlog,parent_num);
|
||||
|
||||
|
||||
csp(store_which_string_dlog,store_which_string_dlog,graphic_num);
|
||||
|
||||
|
||||
csit(store_which_string_dlog,4,(char *) text1);
|
||||
if (text2 != NULL) {
|
||||
csit(store_which_string_dlog,5,(char *) text2);
|
||||
@@ -256,16 +247,15 @@ void display_strings(char *text1, char *text2,
|
||||
csp(store_which_string_dlog,3,graphic_num);
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(store_which_string_dlog,0);
|
||||
}
|
||||
|
||||
void choose_graphic_event_filter (short item_hit)
|
||||
{
|
||||
short i;
|
||||
Boolean had1 = FALSE, had2 = FALSE;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
dialog_answer = store_cur_pic;
|
||||
@@ -285,12 +275,12 @@ void choose_graphic_event_filter (short item_hit)
|
||||
if (which_page == (store_last_g - store_first_g) / 36)
|
||||
which_page = 0;
|
||||
else which_page++;
|
||||
put_choice_pics();
|
||||
put_choice_pics();
|
||||
break;
|
||||
default:
|
||||
if ((item_hit >= 5) && (item_hit <= 40)) {
|
||||
store_cur_pic = 36 * which_page + item_hit - 5 + store_first_g;
|
||||
for (i = 5; i <= 40; i++)
|
||||
for (i = 5; i <= 40; i++)
|
||||
cd_set_led(819,i,(i == item_hit) ? 1 : 0);
|
||||
}
|
||||
break;
|
||||
@@ -300,7 +290,7 @@ void choose_graphic_event_filter (short item_hit)
|
||||
void put_choice_pics()
|
||||
{
|
||||
short i;
|
||||
|
||||
|
||||
for (i = 0; i < 36; i++) {
|
||||
if (store_first_g + which_page * 36 + i > store_last_g) {
|
||||
csp(819,41 + i,950);
|
||||
@@ -308,7 +298,7 @@ void put_choice_pics()
|
||||
}
|
||||
else {
|
||||
csp(819,41 + i,store_first_g + 36 * which_page + i);
|
||||
cd_activate_item(819,5 + i,1);
|
||||
cd_activate_item(819,5 + i,1);
|
||||
}
|
||||
if (which_page * 36 + i == store_cur_pic - store_first_g)
|
||||
cd_set_led(819,5 + i,1);
|
||||
@@ -320,12 +310,8 @@ void put_choice_pics()
|
||||
short choose_graphic(short first_g,short last_g,short cur_choice,short parent_num)
|
||||
{
|
||||
|
||||
short item_hit;
|
||||
location view_loc;
|
||||
Boolean sound_done = FALSE;
|
||||
|
||||
//make_cursor_sword();
|
||||
|
||||
|
||||
store_first_g = first_g;
|
||||
store_last_g = last_g;
|
||||
if ((cur_choice >= first_g) && (cur_choice <= last_g))
|
||||
@@ -340,22 +326,21 @@ short choose_graphic(short first_g,short last_g,short cur_choice,short parent_nu
|
||||
cd_activate_item(819,78,0);
|
||||
}
|
||||
put_choice_pics();
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(819,0);
|
||||
|
||||
do_choose_anim = FALSE;
|
||||
|
||||
|
||||
return dialog_answer;
|
||||
}
|
||||
|
||||
void choose_text_res_event_filter (short item_hit)
|
||||
{
|
||||
short i;
|
||||
Boolean had1 = FALSE, had2 = FALSE;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 2:
|
||||
dialog_answer = store_cur_t;
|
||||
@@ -375,12 +360,12 @@ void choose_text_res_event_filter (short item_hit)
|
||||
if (which_page == (store_last_t - store_first_t) / 40)
|
||||
which_page = 0;
|
||||
else which_page++;
|
||||
put_text_res();
|
||||
put_text_res();
|
||||
break;
|
||||
default:
|
||||
if ((item_hit >= 9) && (item_hit <= 87)) {
|
||||
store_cur_t = 40 * which_page + (item_hit - 9) / 2 + store_first_t;
|
||||
for (i = 9; i <= 87; i += 2)
|
||||
for (i = 9; i <= 87; i += 2)
|
||||
cd_set_led(820,i,(i == item_hit) ? 1 : 0);
|
||||
}
|
||||
break;
|
||||
@@ -389,9 +374,9 @@ void choose_text_res_event_filter (short item_hit)
|
||||
|
||||
void put_text_res()
|
||||
{
|
||||
short item_hit,i;
|
||||
short i;
|
||||
char str[256];
|
||||
|
||||
|
||||
for (i = 0; i < 40; i++) {
|
||||
if (store_first_t + which_page * 40 + i > store_last_t) {
|
||||
csit(820,8 + i * 2,"");
|
||||
@@ -412,11 +397,6 @@ void put_text_res()
|
||||
short choose_text_res(short res_list,short first_t,short last_t,short cur_choice,short parent_num,char *title)
|
||||
{
|
||||
|
||||
short item_hit;
|
||||
char sign_text[256];
|
||||
location view_loc;
|
||||
Boolean sound_done = FALSE;
|
||||
|
||||
//make_cursor_sword();
|
||||
store_res_list = res_list;
|
||||
store_first_t = first_t;
|
||||
@@ -434,23 +414,21 @@ short choose_text_res(short res_list,short first_t,short last_t,short cur_choice
|
||||
cd_activate_item(820,6,0);
|
||||
}
|
||||
put_text_res();
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(820,0);
|
||||
|
||||
|
||||
return dialog_answer;
|
||||
}
|
||||
|
||||
void edit_text_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
short num_strs[3] = {260,108,140};
|
||||
|
||||
|
||||
if (store_str_mode == 0)
|
||||
CDGT(816,2,(store_which_str >= 160) ?
|
||||
CDGT(816,2,(store_which_str >= 160) ?
|
||||
scen_strs2[store_which_str - 160] : scen_strs[store_which_str]);
|
||||
if (store_str_mode == 1)
|
||||
CDGT(816,2,data_store->out_strs[store_which_str]);
|
||||
@@ -458,7 +436,7 @@ void edit_text_event_filter (short item_hit)
|
||||
CDGT(816,2,town_strs[store_which_str]);
|
||||
switch (item_hit) {
|
||||
case 9:
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@@ -472,7 +450,7 @@ void edit_text_event_filter (short item_hit)
|
||||
}
|
||||
cdsin(816,5,store_which_str);
|
||||
if (store_str_mode == 0)
|
||||
CDST(816,2,(store_which_str >= 160) ?
|
||||
CDST(816,2,(store_which_str >= 160) ?
|
||||
scen_strs2[store_which_str - 160] : scen_strs[store_which_str]);
|
||||
if (store_str_mode)
|
||||
CDST(816,2,data_store->out_strs[store_which_str]);
|
||||
@@ -484,17 +462,14 @@ void edit_text_event_filter (short item_hit)
|
||||
void edit_text_str(short which_str,short mode)
|
||||
// ignore parent in Mac version
|
||||
{
|
||||
short text_hit,i,store_dialog_answer,item_hit;
|
||||
char temp_str[256];
|
||||
|
||||
store_which_str = which_str;
|
||||
store_str_mode = mode;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(816,0);
|
||||
|
||||
|
||||
cdsin(816,5,store_which_str);
|
||||
if (mode == 0)
|
||||
CDST(816,2,(which_str >= 160) ?
|
||||
CDST(816,2,(which_str >= 160) ?
|
||||
scen_strs2[which_str - 160] : scen_strs[which_str]);
|
||||
if (mode == 1)
|
||||
CDST(816,2,data_store->out_strs[which_str]);
|
||||
@@ -503,7 +478,7 @@ void edit_text_str(short which_str,short mode)
|
||||
cd_attach_key(816,3,0);
|
||||
cd_attach_key(816,4,0);
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(816,0);
|
||||
}
|
||||
@@ -511,12 +486,11 @@ void edit_text_str(short which_str,short mode)
|
||||
void edit_area_rect_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 6:
|
||||
dialog_answer = TRUE;
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
CDGT(840,2,(char *) str);
|
||||
if (store_str_mode == 0)
|
||||
sprintf(data_store->out_strs[store_which_str + 1],"%-29.29s",(char *) str);
|
||||
@@ -525,7 +499,7 @@ void edit_area_rect_event_filter (short item_hit)
|
||||
|
||||
case 3:
|
||||
dialog_answer = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -534,31 +508,25 @@ void edit_area_rect_event_filter (short item_hit)
|
||||
Boolean edit_area_rect_str(short which_str,short mode)
|
||||
// ignore parent in Mac version
|
||||
{
|
||||
short area_rect_hit,i,store_dialog_answer,item_hit;
|
||||
char temp_str[256];
|
||||
|
||||
store_which_str = which_str;
|
||||
store_str_mode = mode;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(840,0);
|
||||
|
||||
|
||||
if (store_str_mode == 0)
|
||||
CDST(840,2,data_store->out_strs[store_which_str + 1]);
|
||||
else CDST(840,2,town_strs[store_which_str + 1]);
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(840,0);
|
||||
|
||||
|
||||
return dialog_answer;
|
||||
}
|
||||
|
||||
Boolean save_spec_enc()
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
|
||||
store_spec_node.sd1 = CDGN(822,2);
|
||||
store_spec_node.sd2 = CDGN(822,3);
|
||||
store_spec_node.m1 = CDGN(822,4);
|
||||
@@ -578,7 +546,7 @@ Boolean save_spec_enc()
|
||||
if (cre(store_spec_node.sd2,-1,9,"The second part of a Stuff Done flag must be from 0 to 9 (or -1 if the Stuff Done flag is ignored.",
|
||||
"",822) > 0) return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (store_which_mode == 0)
|
||||
scenario.scen_specials[store_which_node] = store_spec_node;
|
||||
if (store_which_mode == 1)
|
||||
@@ -596,11 +564,11 @@ void put_spec_enc_in_dlog()
|
||||
cdsin(822,15,store_which_node);
|
||||
get_str(str,22,store_spec_node.type + 1);
|
||||
csit(822,27,(char *) str);
|
||||
|
||||
|
||||
if (last_node[0] == -1)
|
||||
cd_activate_item(822,14,0);
|
||||
else cd_activate_item(822,14,1);
|
||||
|
||||
|
||||
CDSN(822,2,store_spec_node.sd1);
|
||||
CDSN(822,3,store_spec_node.sd2);
|
||||
switch (edit_spec_stuff_done_mess[store_spec_node.type]) {
|
||||
@@ -613,23 +581,23 @@ void put_spec_enc_in_dlog()
|
||||
case 6: csit(822,20,"Switch this ter. type"); csit(822,21,"with this ter. type"); break;
|
||||
case 7: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"What to place (see docs.)"); break;
|
||||
case 8: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"0 - web, 1 - barrel, 2 - crate"); break;
|
||||
}
|
||||
}
|
||||
|
||||
CDSN(822,4,store_spec_node.m1);
|
||||
CDSN(822,5,store_spec_node.m2);
|
||||
switch (edit_spec_mess_mess[store_spec_node.type]) {
|
||||
case 0: csit(822,22,"Unused."); csit(822,23,"Unused."); cd_activate_item(822,49,0); break;
|
||||
case 1: csit(822,22,"First part of message"); csit(822,23,"Second part of message");
|
||||
case 1: csit(822,22,"First part of message"); csit(822,23,"Second part of message");
|
||||
cd_activate_item(822,49,1); break;
|
||||
case 2: csit(822,22,"Number of first message in dialog"); csit(822,23,"Unused");
|
||||
case 2: csit(822,22,"Number of first message in dialog"); csit(822,23,"Unused");
|
||||
cd_activate_item(822,49,1); break;
|
||||
case 3: csit(822,22,"Name of Store"); csit(822,23,"Unused");
|
||||
case 3: csit(822,22,"Name of Store"); csit(822,23,"Unused");
|
||||
cd_activate_item(822,49,1); break;
|
||||
case 4: csit(822,22,"Number of first message in dialog");
|
||||
csit(822,23,"1 - add 'Leave'/'OK' button, else no");
|
||||
case 4: csit(822,22,"Number of first message in dialog");
|
||||
csit(822,23,"1 - add 'Leave'/'OK' button, else no");
|
||||
cd_activate_item(822,49,1); break;
|
||||
case 5: csit(822,22,"Number of first message in dialog");
|
||||
csit(822,23,"Num. of spec. item to give (-1 none)");
|
||||
case 5: csit(822,22,"Number of first message in dialog");
|
||||
csit(822,23,"Num. of spec. item to give (-1 none)");
|
||||
cd_activate_item(822,49,1); break;
|
||||
}
|
||||
|
||||
@@ -652,7 +620,7 @@ void put_spec_enc_in_dlog()
|
||||
for (i = 0 ; i < 12; i++)
|
||||
if (store_spec_node.type == ex1a_choose[i])
|
||||
cd_activate_item(822,47,1);
|
||||
|
||||
|
||||
CDSN(822,8,store_spec_node.ex1b);
|
||||
get_str(str,31,store_spec_node.type + 1);
|
||||
csit(822,26,(char *) str);
|
||||
@@ -668,7 +636,7 @@ void put_spec_enc_in_dlog()
|
||||
for (i = 0 ; i < 18; i++)
|
||||
if (store_spec_node.type == ex2a_choose[i])
|
||||
cd_activate_item(822,48,1);
|
||||
|
||||
|
||||
CDSN(822,10,store_spec_node.ex2b);
|
||||
get_str(str,33,store_spec_node.type + 1);
|
||||
csit(822,29,(char *) str);
|
||||
@@ -689,18 +657,17 @@ void put_spec_enc_in_dlog()
|
||||
|
||||
void edit_spec_enc_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i,node_to_change_to = -1,spec;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 12:
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
case 14: //go_back
|
||||
if (save_spec_enc() == FALSE)
|
||||
break;
|
||||
for (i = 0; i < 256; i++)
|
||||
break;
|
||||
for (i = 0; i < 256; i++)
|
||||
if (last_node[i] < 0) {
|
||||
node_to_change_to = last_node[i - 1];
|
||||
if (i > 0)
|
||||
@@ -708,7 +675,7 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
i = 256;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
case 13:
|
||||
if (last_node[0] != -1) {
|
||||
give_error("You can't cancel out of making a special until you're back at the beginning of the special chain.",
|
||||
"Press the Go Back button until it disappears.",822);
|
||||
@@ -717,7 +684,7 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
dialog_not_toast = FALSE; break;
|
||||
case 43: case 44: case 45: // 1b, 2b, jump to spec
|
||||
if (save_spec_enc() == FALSE)
|
||||
break;
|
||||
break;
|
||||
if (item_hit == 43)
|
||||
spec = CDGN(822,8);
|
||||
if (item_hit == 44)
|
||||
@@ -745,27 +712,27 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
CDSN(822,11,spec);
|
||||
}
|
||||
if (save_spec_enc() == FALSE)
|
||||
break;
|
||||
break;
|
||||
if ((item_hit == 43) && (store_spec_node.type == 13))
|
||||
node_to_change_to = spec;
|
||||
else if ((item_hit == 45) && (store_spec_node.type == 21))
|
||||
node_to_change_to = spec;
|
||||
else node_to_change_to = store_which_mode * 1000 + spec;
|
||||
for (i = 0; i < 256; i++)
|
||||
for (i = 0; i < 256; i++)
|
||||
if (last_node[i] < 0) {
|
||||
last_node[i] = store_which_mode * 1000 + store_which_node;
|
||||
i = 256;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 47: // 1a choose
|
||||
switch (store_spec_node.type) {
|
||||
case 19: case 50: case 58: case 59: case 60:
|
||||
case 19: case 50: case 58: case 59: case 60:
|
||||
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"Give which item?"); break;
|
||||
case 229:
|
||||
case 229:
|
||||
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"First item in store?"); break;
|
||||
case 55: case 56: case 57:
|
||||
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex1a,822,"Which button label?"); break;
|
||||
case 182:
|
||||
case 182:
|
||||
i = choose_text_res(-1,1,255,store_spec_node.ex1a,822,"Choose Which Monster:"); break;
|
||||
}
|
||||
store_spec_node.ex1a = i;
|
||||
@@ -773,11 +740,11 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
break;
|
||||
case 48: // 2a choose
|
||||
switch (store_spec_node.type) {
|
||||
case 19: case 50: case 192: case 229:
|
||||
case 19: case 50: case 192: case 229:
|
||||
i = choose_text_res(-2,0,399,store_spec_node.ex2a,822,"Give which item?"); break;
|
||||
case 55: case 56: case 57: case 58: case 59: case 60:
|
||||
case 55: case 56: case 57: case 58: case 59: case 60:
|
||||
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex2a,822,"Which button label?"); break;
|
||||
case 181:
|
||||
case 181:
|
||||
i = choose_text_res(-1,1,255,store_spec_node.ex2a,822,"Choose Which Monster:"); break;
|
||||
case 135: case 136: case 171: case 172: case 226:
|
||||
i = choose_text_res(-4,0,255,store_spec_node.ex2a,822,"Which Terrain?"); break;
|
||||
@@ -787,23 +754,23 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
break;
|
||||
case 49: // message
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
if ((edit_spec_mess_mess[store_spec_node.type] == 2) ||
|
||||
(edit_spec_mess_mess[store_spec_node.type] == 4) ||
|
||||
(edit_spec_mess_mess[store_spec_node.type] == 5)) {
|
||||
edit_dialog_text(store_which_mode,&store_spec_node.m1,822);
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
}
|
||||
else if ((edit_spec_mess_mess[store_spec_node.type] == 1) ||
|
||||
(edit_spec_mess_mess[store_spec_node.type] == 3)) {
|
||||
edit_spec_text(store_which_mode,&store_spec_node.m1,
|
||||
&store_spec_node.m2,822);
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
}
|
||||
break;
|
||||
case 46: // pict
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = -1;
|
||||
switch (edit_pict_mess[store_spec_node.type]) {
|
||||
case 1: i = choose_graphic(700,731,store_spec_node.pic,822); break;
|
||||
@@ -812,61 +779,61 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
}
|
||||
if (i >= 0) {
|
||||
store_spec_node.pic = i;
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 37: // 1st spec type
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = choose_text_res(22,1,29,store_spec_node.type + 1,822,"Choose General Use Special:");
|
||||
if (i >= 0) {
|
||||
store_spec_node.type = i - 1;
|
||||
}
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
break;
|
||||
case 38: // 2 spec type
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = choose_text_res(22,51,64,store_spec_node.type + 1,822,"Choose One-Shot Special:");
|
||||
if (i >= 0) {
|
||||
store_spec_node.type = i - 1;
|
||||
store_spec_node.sd1 = -1;
|
||||
store_spec_node.sd2 = -1;
|
||||
store_spec_node.sd1 = -1;
|
||||
store_spec_node.sd2 = -1;
|
||||
if ((store_spec_node.type >= 55) && (store_spec_node.type <= 57))
|
||||
store_spec_node.m2 = 1;
|
||||
}
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
break;
|
||||
case 39: // 3 spec type
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = choose_text_res(22,81,107,store_spec_node.type + 1,822,"Choose Affect Party Special:");
|
||||
if (i >= 0) store_spec_node.type = i - 1;
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
break;
|
||||
case 40: // 4 spec type
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = choose_text_res(22,131,157,store_spec_node.type + 1,822,"Choose If-Then Special:");
|
||||
if (i >= 0) {
|
||||
store_spec_node.type = i - 1;
|
||||
}
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
break;
|
||||
case 41: // 5 spec type
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = choose_text_res(22,171,219,store_spec_node.type + 1,822,"Choose Town Special:");
|
||||
if (i >= 0) store_spec_node.type = i - 1;
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
break;
|
||||
case 42: // 6 spec type
|
||||
if (save_spec_enc() == TRUE)
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
i = choose_text_res(22,226,230,store_spec_node.type + 1,822,"Choose Outdoor Special:");
|
||||
if (i >= 0) store_spec_node.type = i - 1;
|
||||
put_spec_enc_in_dlog();
|
||||
put_spec_enc_in_dlog();
|
||||
break;
|
||||
}
|
||||
/*if ((item_hit >= 37) && (item_hit <= 42)) {
|
||||
@@ -887,16 +854,15 @@ void edit_spec_enc_event_filter (short item_hit)
|
||||
if (store_spec_node.pic < 0)
|
||||
store_spec_node.pic = 0;
|
||||
put_spec_enc_in_dlog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mode - 0 scen 1 - out 2 - town
|
||||
void edit_spec_enc(short which_node,short mode,short parent_num)
|
||||
// ignore parent in Mac version
|
||||
{
|
||||
short spec_enc_hit,i,store_dialog_answer;
|
||||
char temp_str[256];
|
||||
|
||||
short i;
|
||||
|
||||
store_which_mode = mode;
|
||||
store_which_node = which_node;
|
||||
for (i = 0; i < 256; i++)
|
||||
@@ -910,12 +876,12 @@ void edit_spec_enc(short which_node,short mode,short parent_num)
|
||||
store_spec_node = town.specials[store_which_node];
|
||||
if (store_spec_node.pic < 0)
|
||||
store_spec_node.pic = 0;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(822,parent_num);
|
||||
|
||||
|
||||
cd_activate_item(822,14,0);
|
||||
put_spec_enc_in_dlog();
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
cd_kill_dialog(822,0);
|
||||
@@ -925,7 +891,7 @@ short get_fresh_spec(short which_mode)
|
||||
{
|
||||
short i;
|
||||
special_node_type store_node;
|
||||
|
||||
|
||||
for (i = 0; i < num_specs[which_mode]; i++) {
|
||||
if (which_mode == 0)
|
||||
store_node = scenario.scen_specials[i];
|
||||
@@ -936,7 +902,7 @@ short get_fresh_spec(short which_mode)
|
||||
if ((store_node.type == 0) && (store_node.jumpto == -1) && (store_node.pic == -1))
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -944,10 +910,10 @@ void edit_spec_text_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 7:
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
@@ -976,7 +942,7 @@ void edit_spec_text_event_filter (short item_hit)
|
||||
i = 500;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
if (i < 500) {
|
||||
give_error("There are no more free message slots.",
|
||||
@@ -988,13 +954,13 @@ void edit_spec_text_event_filter (short item_hit)
|
||||
switch (store_spec_str_mode) {
|
||||
case 0:
|
||||
strcpy(scen_strs2[*store_str1],(char *) str);
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
strcpy(data_store->out_strs[*store_str1 + 10],(char *) str);
|
||||
break;
|
||||
break;
|
||||
case 2:
|
||||
strcpy(town_strs[*store_str1 + 20],(char *) str);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1023,7 +989,7 @@ void edit_spec_text_event_filter (short item_hit)
|
||||
i = 500;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
if (i < 500) {
|
||||
give_error("There are no more free message slots.",
|
||||
@@ -1035,13 +1001,13 @@ void edit_spec_text_event_filter (short item_hit)
|
||||
switch (store_spec_str_mode) {
|
||||
case 0:
|
||||
strcpy(scen_strs2[*store_str2],(char *) str);
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
strcpy(data_store->out_strs[*store_str2 + 10],(char *) str);
|
||||
break;
|
||||
break;
|
||||
case 2:
|
||||
strcpy(town_strs[*store_str2 + 20],(char *) str);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1053,16 +1019,14 @@ void edit_spec_text_event_filter (short item_hit)
|
||||
// mode 0 - scen 1 - out 2 - town
|
||||
void edit_spec_text(short mode,short *str1,short *str2,short parent)
|
||||
{
|
||||
short text_hit,i,store_dialog_answer,item_hit;
|
||||
char temp_str[256];
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
|
||||
store_str1 = str1;
|
||||
store_str2 = str2;
|
||||
store_spec_str_mode = mode;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(826,parent);
|
||||
|
||||
|
||||
if (*str1 >= num_s_strs[mode])
|
||||
*str1 = -1;
|
||||
if (*str1 >= 0){
|
||||
@@ -1083,9 +1047,9 @@ void edit_spec_text(short mode,short *str1,short *str2,short parent)
|
||||
if (mode == 2)
|
||||
CDST(826,3,town_strs[*str2 + 20]);
|
||||
}
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(826,0);
|
||||
}
|
||||
@@ -1094,10 +1058,10 @@ void edit_dialog_text_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 9:
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
@@ -1106,13 +1070,13 @@ void edit_dialog_text_event_filter (short item_hit)
|
||||
switch (store_spec_str_mode) {
|
||||
case 0:
|
||||
strcpy(scen_strs2[*store_str1 + i],(char *) str);
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
strcpy(data_store->out_strs[*store_str1 + 10 + i],(char *) str);
|
||||
break;
|
||||
break;
|
||||
case 2:
|
||||
strcpy(town_strs[*store_str1 + 20 + i],(char *) str);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
dialog_not_toast = FALSE;
|
||||
@@ -1123,13 +1087,12 @@ void edit_dialog_text_event_filter (short item_hit)
|
||||
// mode 0 - scen 1 - out 2 - town
|
||||
void edit_dialog_text(short mode,short *str1,short parent)
|
||||
{
|
||||
short text_hit,i,j,store_dialog_answer,item_hit;
|
||||
char temp_str[256];
|
||||
short i,j;
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
|
||||
store_str1 = str1;
|
||||
store_spec_str_mode = mode;
|
||||
|
||||
|
||||
if (*str1 >= num_s_strs[mode] - 6)
|
||||
*str1 = -1;
|
||||
// first, assign the 6 strs for the dialog.
|
||||
@@ -1171,30 +1134,30 @@ void edit_dialog_text(short mode,short *str1,short parent)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
if (*str1 >= 0)
|
||||
for (i = *str1; i < *str1 + 6; i++) {
|
||||
switch (store_spec_str_mode) {
|
||||
case 0:
|
||||
sprintf(scen_strs2[i],"");
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
sprintf(data_store->out_strs[10 + i],"");
|
||||
break;
|
||||
break;
|
||||
case 2:
|
||||
sprintf(town_strs[20 + i],"");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*str1 < 0) {
|
||||
give_error("To create a dialog, you need 6 consecutive unused messages. To free up 6 messages, select Edit Out/Town/Scenario Text from the menus.","",parent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(842,parent);
|
||||
|
||||
|
||||
if (*str1 >= 0){
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (mode == 0)
|
||||
@@ -1205,22 +1168,21 @@ void edit_dialog_text(short mode,short *str1,short parent)
|
||||
CDST(842,2 + i,town_strs[*str1 + 20 + i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(842,0);
|
||||
}
|
||||
|
||||
void edit_special_num_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 8:
|
||||
dialog_answer = -1;
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@@ -1237,28 +1199,24 @@ void edit_special_num_event_filter (short item_hit)
|
||||
|
||||
short edit_special_num(short mode,short what_start)
|
||||
{
|
||||
short text_hit,i,j,store_dialog_answer,item_hit;
|
||||
char temp_str[256];
|
||||
|
||||
store_spec_mode = mode;
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(825,0);
|
||||
|
||||
|
||||
CDSN(825,2,what_start);
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(825,0);
|
||||
|
||||
|
||||
return dialog_answer;
|
||||
}
|
||||
|
||||
void edit_scen_intro_event_filter (short item_hit)
|
||||
{
|
||||
char str[256];
|
||||
short i;
|
||||
|
||||
|
||||
switch (item_hit) {
|
||||
case 9:
|
||||
scenario.intro_pic = CDGN(804,8);
|
||||
@@ -1268,10 +1226,10 @@ void edit_scen_intro_event_filter (short item_hit)
|
||||
}
|
||||
for (i = 0; i < 6; i++)
|
||||
CDGT(804, 2 + i,scen_strs[4 + i]);
|
||||
dialog_not_toast = FALSE;
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
case 10:
|
||||
dialog_not_toast = FALSE;
|
||||
case 10:
|
||||
dialog_not_toast = FALSE;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
@@ -1287,25 +1245,22 @@ void edit_scen_intro_event_filter (short item_hit)
|
||||
|
||||
void edit_scen_intro()
|
||||
{
|
||||
short text_hit,i,j,store_dialog_answer,item_hit;
|
||||
char temp_str[256];
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
|
||||
short i;
|
||||
|
||||
cd_create_dialog_parent_num(804,0);
|
||||
|
||||
|
||||
CDSN(804,8,scenario.intro_pic);
|
||||
for (i = 0; i < 6; i++)
|
||||
CDST(804, 2 + i,scen_strs[4 + i]);
|
||||
csp(804,11,scenario.intro_pic + 1600);
|
||||
|
||||
|
||||
while (dialog_not_toast)
|
||||
ModalDialog();
|
||||
ModalDialog();
|
||||
|
||||
cd_kill_dialog(804,0);
|
||||
}
|
||||
|
||||
void set_cursor(short which_c)
|
||||
void set_cursor(short which_c)
|
||||
{
|
||||
short i;
|
||||
|
||||
|
Reference in New Issue
Block a user