- Fixed some bugs introduced by the last revision.
- Added a dialog graphic and a few animated terrain graphics from Exiles 1-3. - The four-parts of death dialog graphic may now be used in a scenario as a dialog graphic. - Added more constants for clarity - A few more bladbase fixes git-svn-id: http://openexile.googlecode.com/svn/trunk@17 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 MiB After Width: | Height: | Size: 3.7 MiB |
@@ -337,7 +337,15 @@ void process_new_window (WindowPtr hDlg) {
|
|||||||
free_item = -1;
|
free_item = -1;
|
||||||
// find free item
|
// find free item
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: case 1: case 2: case 5: case 6:
|
case DLG_BUTTON_TYPE: case DLG_DEFAULT_BTN_TYPE: case DLG_LED_BUTTON:
|
||||||
|
case DLG_OLD_PICTURE: case 6:
|
||||||
|
case DLG_NEW_PICTURE + PICT_TER_TYPE:
|
||||||
|
case DLG_NEW_PICTURE + PICT_TER_ANIM_TYPE:
|
||||||
|
case DLG_NEW_PICTURE + PICT_MONST_TYPE:
|
||||||
|
case DLG_NEW_PICTURE + PICT_DLG_TYPE:
|
||||||
|
case DLG_NEW_PICTURE + PICT_TALK_TYPE:
|
||||||
|
case DLG_NEW_PICTURE + PICT_SCEN_TYPE:
|
||||||
|
case DLG_NEW_PICTURE + PICT_ITEM_TYPE:
|
||||||
for (j = 150; j < NI; j++)
|
for (j = 150; j < NI; j++)
|
||||||
if (item_dlg[j] < 0) {
|
if (item_dlg[j] < 0) {
|
||||||
free_item = j;
|
free_item = j;
|
||||||
@@ -371,12 +379,13 @@ void process_new_window (WindowPtr hDlg) {
|
|||||||
item_rect[free_item] = get_item_rect(hDlg,i + 1);
|
item_rect[free_item] = get_item_rect(hDlg,i + 1);
|
||||||
|
|
||||||
item_flag[free_item] = flag;
|
item_flag[free_item] = flag;
|
||||||
|
|
||||||
item_active[free_item] = 1;
|
item_active[free_item] = 1;
|
||||||
item_label[free_item] = 0;
|
item_label[free_item] = 0;
|
||||||
item_label_loc[free_item] = -1;
|
item_label_loc[free_item] = -1;
|
||||||
item_key[free_item] = 0;
|
item_key[free_item] = 0;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 0: case 1:
|
case DLG_BUTTON_TYPE: case DLG_DEFAULT_BTN_TYPE:
|
||||||
GetPortBounds(dlg_buttons_gworld[button_type[flag]][0], &store_rect);
|
GetPortBounds(dlg_buttons_gworld[button_type[flag]][0], &store_rect);
|
||||||
item_rect[free_item].right = item_rect[free_item].left + store_rect.right;
|
item_rect[free_item].right = item_rect[free_item].left + store_rect.right;
|
||||||
item_rect[free_item].bottom = item_rect[free_item].top + store_rect.bottom;
|
item_rect[free_item].bottom = item_rect[free_item].top + store_rect.bottom;
|
||||||
@@ -384,17 +393,17 @@ void process_new_window (WindowPtr hDlg) {
|
|||||||
if (type == 1)
|
if (type == 1)
|
||||||
item_key[free_item] = 31;
|
item_key[free_item] = 31;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case DLG_LED_BUTTON:
|
||||||
item_rect[free_item].right = item_rect[free_item].left + 14;
|
item_rect[free_item].right = item_rect[free_item].left + 14;
|
||||||
item_rect[free_item].bottom = item_rect[free_item].top + 10;
|
item_rect[free_item].bottom = item_rect[free_item].top + 10;
|
||||||
item_key[free_item] = 255;
|
item_key[free_item] = 255;
|
||||||
break;
|
break;
|
||||||
case 3: case 4: case 7: case 8: case 9: case 10: case 11:
|
case DLG_TEXT_BOLD: case DLG_TEXT_PLAIN: case DLG_TEXT_LARGE:
|
||||||
|
case 8: case 9: case 10: case 11:
|
||||||
sprintf(((free_item < 10) ? text_long_str[free_item] : text_short_str[free_item - 10]),"");
|
sprintf(((free_item < 10) ? text_long_str[free_item] : text_short_str[free_item - 10]),"");
|
||||||
if (str_stored == TRUE) {
|
if (str_stored == TRUE) {
|
||||||
if (free_item < 10)
|
if (free_item < 10)
|
||||||
sprintf(text_long_str[free_item],"%s",
|
sprintf(text_long_str[free_item],"%s",(char *) (item_str + str_offset));
|
||||||
(char *) (item_str + str_offset));
|
|
||||||
else
|
else
|
||||||
sprintf(text_short_str[free_item - 10],"%-39.39s",
|
sprintf(text_short_str[free_item - 10],"%-39.39s",
|
||||||
(char *) (item_str + str_offset));
|
(char *) (item_str + str_offset));
|
||||||
@@ -408,18 +417,40 @@ void process_new_window (WindowPtr hDlg) {
|
|||||||
item_key[free_item] = 31;
|
item_key[free_item] = 31;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DLG_OLD_PICTURE:
|
||||||
|
item_flag2[free_item] = PICT_OLD_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_TER_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_TER_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_TER_ANIM_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_TER_ANIM_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_MONST_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_MONST_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_DLG_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_DLG_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_TALK_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_TALK_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_SCEN_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_SCEN_TYPE;
|
||||||
|
break;
|
||||||
|
case DLG_NEW_PICTURE + PICT_ITEM_TYPE:
|
||||||
|
item_flag2[free_item] = PICT_ITEM_TYPE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
win_height = max(win_height, item_rect[free_item].bottom + 5);
|
win_height = max(win_height, item_rect[free_item].bottom + 5);
|
||||||
win_width = max(win_width, item_rect[free_item].right + 6);
|
win_width = max(win_width, item_rect[free_item].right + 6);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ShortenDITL(GetDialogFromWindow(hDlg),dlg_highest_item[free_slot]);
|
ShortenDITL(GetDialogFromWindow(hDlg),dlg_highest_item[free_slot]);
|
||||||
SizeWindow(hDlg,win_width,win_height,FALSE);
|
SizeWindow(hDlg,win_width,win_height,FALSE);
|
||||||
dlg_highest_item[free_slot] = num_items;
|
dlg_highest_item[free_slot] = num_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
short cd_kill_dialog(short dlog_num,short parent_message)
|
short cd_kill_dialog(short dlog_num,short parent_message)
|
||||||
@@ -911,7 +942,7 @@ void cd_draw_item(short dlog_num,short item_num)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (item_type[item_index]) {
|
switch (item_type[item_index]) {
|
||||||
case 0: case 1: case 10: case 11:
|
case DLG_BUTTON_TYPE: case DLG_DEFAULT_BTN_TYPE: case 10: case 11:
|
||||||
GetPortBounds(dlg_buttons_gworld[button_type[item_flag[item_index]]][0], &from_rect);
|
GetPortBounds(dlg_buttons_gworld[button_type[item_flag[item_index]]][0], &from_rect);
|
||||||
rect_draw_some_item(dlg_buttons_gworld[button_type[item_flag[item_index]]][0],from_rect,
|
rect_draw_some_item(dlg_buttons_gworld[button_type[item_flag[item_index]]][0],from_rect,
|
||||||
dlg_buttons_gworld[button_type[item_flag[item_index]]][0],item_rect[item_index],0,2);
|
dlg_buttons_gworld[button_type[item_flag[item_index]]][0],item_rect[item_index],0,2);
|
||||||
@@ -934,7 +965,7 @@ void cd_draw_item(short dlog_num,short item_num)
|
|||||||
ForeColor(blackColor);
|
ForeColor(blackColor);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case DLG_LED_BUTTON:
|
||||||
GetPortBounds(dlg_buttons_gworld[9][0], &from_rect);
|
GetPortBounds(dlg_buttons_gworld[9][0], &from_rect);
|
||||||
switch (item_flag[item_index]) {
|
switch (item_flag[item_index]) {
|
||||||
case 0: rect_draw_some_item( dlg_buttons_gworld[10][0],from_rect, dlg_buttons_gworld[10][0],item_rect[item_index],0,2); break;
|
case 0: rect_draw_some_item( dlg_buttons_gworld[10][0],from_rect, dlg_buttons_gworld[10][0],item_rect[item_index],0,2); break;
|
||||||
@@ -943,9 +974,14 @@ void cd_draw_item(short dlog_num,short item_num)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: case 4: case 7: case 8: case 9:
|
case DLG_TEXT_BOLD: case DLG_TEXT_PLAIN: case DLG_TEXT_LARGE: case 8: case 9:
|
||||||
cd_erase_item(dlog_num,item_num);
|
cd_erase_item(dlog_num,item_num);
|
||||||
if (item_type[item_index] == 4)
|
TextFont(geneva_font_num);
|
||||||
|
TextFace(0);
|
||||||
|
TextFace(bold);
|
||||||
|
TextSize(10);
|
||||||
|
ForeColor(blackColor);
|
||||||
|
if (item_type[item_index] == DLG_TEXT_PLAIN)
|
||||||
TextFace(0);
|
TextFace(0);
|
||||||
if (item_type[item_index] == 7)
|
if (item_type[item_index] == 7)
|
||||||
TextSize(12);
|
TextSize(12);
|
||||||
@@ -974,19 +1010,21 @@ void cd_draw_item(short dlog_num,short item_num)
|
|||||||
item_rect[item_index].bottom -= 12;
|
item_rect[item_index].bottom -= 12;
|
||||||
undo_clip();
|
undo_clip();
|
||||||
}
|
}
|
||||||
TextFont(geneva_font_num);
|
|
||||||
TextFace(0);
|
|
||||||
TextFace(bold);
|
|
||||||
TextSize(10);
|
|
||||||
ForeColor(blackColor);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case DLG_OLD_PICTURE:
|
||||||
if (item_flag[item_index] == -1)
|
if (item_flag[item_index] == -1)
|
||||||
cd_erase_item(dlog_num,item_num);
|
cd_erase_item(dlog_num,item_num);
|
||||||
else draw_dialog_graphic(GetWindowPort(dlgs[dlg_index]), item_rect[item_index], item_flag[item_index],
|
else draw_dialog_graphic(GetWindowPort(dlgs[dlg_index]), item_rect[item_index], item_flag[item_index],
|
||||||
item_flag2[item_index], (item_flag[item_index] >= 2000) ? FALSE : TRUE,0);
|
item_flag2[item_index], (item_flag[item_index] >= 2000) ? FALSE : TRUE,0);
|
||||||
break;
|
break;
|
||||||
|
default: // DLG_NEW_PICTURE
|
||||||
|
if(item_type[item_index] < 20) break;
|
||||||
|
if (item_flag[item_index] == -1)
|
||||||
|
cd_erase_item(dlog_num,item_num);
|
||||||
|
else draw_dialog_graphic(GetWindowPort(dlgs[dlg_index]), item_rect[item_index], item_flag[item_index],
|
||||||
|
item_type[item_index] - DLG_NEW_PICTURE, (item_flag[item_index] >= 2000) ? FALSE : TRUE,0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1343,22 +1381,23 @@ void frame_dlog_rect(GrafPtr hDlg, Rect rect, short val)
|
|||||||
|
|
||||||
void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, Boolean do_frame,short win_or_gworld)
|
void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, Boolean do_frame,short win_or_gworld)
|
||||||
// win_or_gworld: 0 - window 1 - gworld
|
// win_or_gworld: 0 - window 1 - gworld
|
||||||
// 0 - 300 number of terrain graphic -> DLG_TER_TYPE (1), DLG_TER_ANIM_TYPE (2)
|
// 0 - 300 number of terrain graphic -> PICT_TER_TYPE (1), PICT_TER_ANIM_TYPE (2)
|
||||||
// 400 + x - monster graphic num (uses index from scenario) -> DLG_MONST_TYPE
|
// 400 + x - monster graphic num (uses index from scenario) -> PICT_MONST_TYPE
|
||||||
// 400 is 1st monster from monster index, 401 is 2nd from m. index, and so on
|
// 400 is 1st monster from monster index, 401 is 2nd from m. index, and so on
|
||||||
// 700 + x dlog graphic -> DLG_DLG_TYPE
|
// 700 + x dlog graphic -> PICT_DLG_TYPE
|
||||||
// 800 + x pc graphic -> DLG_PC_TYPE
|
// 800 + x pc graphic -> PICT_PC_TYPE
|
||||||
// 900 + x B&W graphic -> DLG_BW_TYPE
|
// 900 + x B&W graphic -> PICT_BW_TYPE
|
||||||
// 950 null item -> 0, DLG_BLANK_TYPE (0)
|
// 950 null item -> 0, PICT_BLANK_TYPE (0)
|
||||||
// 1000 + x Talking face -> DLG_TALK_TYPE
|
// 1000 + x Talking face -> PICT_TALK_TYPE
|
||||||
// 1100 - item info help -> DLG_INFO_TYPE
|
// 1100 - item info help -> PICT_INFO_TYPE
|
||||||
// 1200 - pc screen help -> DLG_PC_HELP_TYPE
|
// 1200 - pc screen help -> PICT_PC_HELP_TYPE
|
||||||
// 1300 - combat ap -> DLG_COMBAT_AP_TYPE
|
// 1300 - combat ap -> PICT_COMBAT_AP_TYPE
|
||||||
// 1400-1402 - button help -> DLG_HELP_TYPE
|
// 1400-1402 - button help -> PICT_HELP_TYPE
|
||||||
// 1500 - stat symbols help -> DLG_STAT_TYPE
|
// 1500 - stat symbols help -> PICT_STAT_TYPE
|
||||||
// 1600 + x - scen graphics -> DLG_SCEN_TYPE
|
// 1600 + x - scen graphics -> PICT_SCEN_TYPE
|
||||||
// 1700 + x - anim graphic -> DLG_ANIM_TYPE
|
// 1700 + x - anim graphic -> PICT_ANIM_TYPE
|
||||||
// 1800 + x item graphic -> DLG_ITEM_TYPE
|
// 1800 + x item graphic -> PICT_ITEM_TYPE
|
||||||
|
// PICT_OLD_TYPE (-1) to revert to the old behaviour
|
||||||
{
|
{
|
||||||
short picnum;
|
short picnum;
|
||||||
Rect from1 = {0,0,36,28},from2 = {0,0,36,36},from3 = {0,0,72,72},tiny_obj_rect = {0,0,18,18};
|
Rect from1 = {0,0,36,28},from2 = {0,0,36,36},from3 = {0,0,72,72},tiny_obj_rect = {0,0,18,18};
|
||||||
@@ -1391,7 +1430,36 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
do_frame = FALSE;
|
do_frame = FALSE;
|
||||||
which_g = which_g % 2000;
|
which_g = which_g % 2000;
|
||||||
|
|
||||||
if (type_g == DLG_BLANK_TYPE) { // Empty. Maybe clear space.
|
if (type_g == PICT_OLD_TYPE) {
|
||||||
|
unsigned short r = which_g / 100;
|
||||||
|
//printf("Parsing old-style graphic %i.",which_g);
|
||||||
|
if (r < 3){
|
||||||
|
type_g = PICT_TER_TYPE;
|
||||||
|
}else if(r == 4){
|
||||||
|
type_g = PICT_TER_ANIM_TYPE;
|
||||||
|
which_g -= 400;
|
||||||
|
}else if(r < 7){
|
||||||
|
type_g = PICT_MONST_TYPE;
|
||||||
|
which_g -= 700;
|
||||||
|
}else if(r == 7){
|
||||||
|
type_g = PICT_DLG_TYPE;
|
||||||
|
which_g -= 700;
|
||||||
|
}else if(r == 10){
|
||||||
|
type_g = PICT_TALK_TYPE;
|
||||||
|
which_g -= 1000;
|
||||||
|
}else if(r == 16){
|
||||||
|
type_g = PICT_SCEN_TYPE;
|
||||||
|
which_g -= 1600;
|
||||||
|
}else if(r == 18 || r == 19){
|
||||||
|
type_g = PICT_ITEM_TYPE;
|
||||||
|
which_g -= 1800;
|
||||||
|
}else if(which_g == 950){
|
||||||
|
type_g = PICT_BLANK_TYPE;
|
||||||
|
}
|
||||||
|
//printf(" Result: type = %i, reduced graphic = %u.\n",type_g,which_g);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type_g == PICT_BLANK_TYPE) { // Empty. Maybe clear space.
|
||||||
if (win_or_gworld == 0) {
|
if (win_or_gworld == 0) {
|
||||||
rect.top -= 3;
|
rect.top -= 3;
|
||||||
rect.left -= 3;
|
rect.left -= 3;
|
||||||
@@ -1406,7 +1474,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
BackColor(whiteColor);
|
BackColor(whiteColor);
|
||||||
|
|
||||||
switch (type_g) {
|
switch (type_g) {
|
||||||
case DLG_TER_TYPE: // terrain
|
case PICT_TER_TYPE: // terrain
|
||||||
from_gworld = terrain_gworld[which_g / 50];
|
from_gworld = terrain_gworld[which_g / 50];
|
||||||
which_g = which_g % 50;
|
which_g = which_g % 50;
|
||||||
from_rect = calc_rect(which_g % 10, which_g / 10);
|
from_rect = calc_rect(which_g % 10, which_g / 10);
|
||||||
@@ -1416,10 +1484,13 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
,rect,0,draw_dest);
|
,rect,0,draw_dest);
|
||||||
//DisposeGWorld(from_gworld);
|
//DisposeGWorld(from_gworld);
|
||||||
break;
|
break;
|
||||||
case DLG_TER_ANIM_TYPE: // animated terrain
|
case PICT_TER_ANIM_TYPE: // animated terrain
|
||||||
//which_g -= 300;
|
//which_g -= 300;
|
||||||
//from_gworld = load_pict(820);
|
//from_gworld = load_pict(820);
|
||||||
from_rect = calc_rect(4 * (which_g / 5), which_g % 5);
|
Rect from_rect = calc_rect(4 * (which_g / 5), which_g % 5);
|
||||||
|
//printf("Getting animated terrain graphic %i from sheet 20", which_g);
|
||||||
|
//printf(" at {%i,%i,%i,%i}",from_rect.top,from_rect.left,from_rect.bottom,from_rect.right);
|
||||||
|
//printf(" – column %i, row %i.\n",from_rect.left/28,from_rect.top/36);
|
||||||
if (rect.right - rect.left > 28) {
|
if (rect.right - rect.left > 28) {
|
||||||
InsetRect(&rect,4,0);
|
InsetRect(&rect,4,0);
|
||||||
rect.right = rect.left + 28;
|
rect.right = rect.left + 28;
|
||||||
@@ -1428,7 +1499,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
,rect,0,draw_dest);
|
,rect,0,draw_dest);
|
||||||
//DisposeGWorld(from_gworld);
|
//DisposeGWorld(from_gworld);
|
||||||
break;
|
break;
|
||||||
case DLG_MONST_TYPE: // monster ... needs use index small_monst_rect
|
case PICT_MONST_TYPE: // monster ... needs use index small_monst_rect
|
||||||
// There are 4 different ways to draw, depending on size of monster
|
// There are 4 different ways to draw, depending on size of monster
|
||||||
//which_g -= 400;
|
//which_g -= 400;
|
||||||
m_start_pic = m_pic_index[which_g];
|
m_start_pic = m_pic_index[which_g];
|
||||||
@@ -1545,7 +1616,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
//DisposeGWorld(from_gworld);
|
//DisposeGWorld(from_gworld);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DLG_ITEM_TYPE: // item
|
case PICT_ITEM_TYPE: // item
|
||||||
//which_g -= 1800;
|
//which_g -= 1800;
|
||||||
rect.right = rect.left + 28; rect.bottom = rect.top + 36;
|
rect.right = rect.left + 28; rect.bottom = rect.top + 36;
|
||||||
to_rect = rect;
|
to_rect = rect;
|
||||||
@@ -1565,7 +1636,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
rect_draw_some_item(from_gworld,from_rect,(GWorldPtr) ((win_or_gworld == 1) ? (GWorldPtr)hDlg: from_gworld)
|
rect_draw_some_item(from_gworld,from_rect,(GWorldPtr) ((win_or_gworld == 1) ? (GWorldPtr)hDlg: from_gworld)
|
||||||
,to_rect,1,draw_dest);
|
,to_rect,1,draw_dest);
|
||||||
break;
|
break;
|
||||||
case DLG_DLG_TYPE: // dialog
|
case PICT_DLG_TYPE: // dialog
|
||||||
//which_g -= 700;
|
//which_g -= 700;
|
||||||
from_gworld = dlogpics_gworld;
|
from_gworld = dlogpics_gworld;
|
||||||
OffsetRect(&from2,36 * (which_g % 4),36 * (which_g / 4));
|
OffsetRect(&from2,36 * (which_g % 4),36 * (which_g / 4));
|
||||||
@@ -1573,7 +1644,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
,rect,0,draw_dest);
|
,rect,0,draw_dest);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DLG_TALK_TYPE: // talk face
|
case PICT_TALK_TYPE: // talk face
|
||||||
rect.right = rect.left + 32; rect.bottom = rect.top + 32;
|
rect.right = rect.left + 32; rect.bottom = rect.top + 32;
|
||||||
//which_g -= 1000;
|
//which_g -= 1000;
|
||||||
from_gworld = talkfaces_gworld;
|
from_gworld = talkfaces_gworld;
|
||||||
@@ -1583,7 +1654,7 @@ void draw_dialog_graphic(GrafPtr hDlg, Rect rect, short which_g, short type_g, B
|
|||||||
rect_draw_some_item(from_gworld,from_rect,(GWorldPtr) hDlg,rect,0,0);
|
rect_draw_some_item(from_gworld,from_rect,(GWorldPtr) hDlg,rect,0,0);
|
||||||
else rect_draw_some_item(from_gworld,from_rect,from_gworld,rect,0,draw_dest);
|
else rect_draw_some_item(from_gworld,from_rect,from_gworld,rect,0,draw_dest);
|
||||||
break;
|
break;
|
||||||
case DLG_SCEN_TYPE:
|
case PICT_SCEN_TYPE:
|
||||||
//which_g -= 1600;
|
//which_g -= 1600;
|
||||||
from_gworld = load_pict(851);
|
from_gworld = load_pict(851);
|
||||||
from_rect.right = 32;
|
from_rect.right = 32;
|
||||||
|
|||||||
@@ -32,22 +32,35 @@
|
|||||||
#define CDST cd_set_text_edit_str
|
#define CDST cd_set_text_edit_str
|
||||||
#define CDSN cd_set_text_edit_num
|
#define CDSN cd_set_text_edit_num
|
||||||
|
|
||||||
#define DLG_BLANK_TYPE 0
|
#define PICT_OLD_TYPE -1
|
||||||
#define DLG_TER_TYPE 1
|
#define PICT_BLANK_TYPE 0
|
||||||
#define DLG_TER_ANIM_TYPE 2
|
#define PICT_TER_TYPE 1
|
||||||
#define DLG_MONST_TYPE 3
|
#define PICT_TER_ANIM_TYPE 2
|
||||||
#define DLG_DLG_TYPE 4
|
#define PICT_MONST_TYPE 3
|
||||||
#define DLG_TALK_TYPE 5
|
#define PICT_DLG_TYPE 4
|
||||||
#define DLG_SCEN_TYPE 6
|
#define PICT_TALK_TYPE 5
|
||||||
#define DLG_ITEM_TYPE 7
|
#define PICT_SCEN_TYPE 6
|
||||||
#define DLG_CUSTOM_TYPE 100 // This is added to various of the above constants
|
#define PICT_ITEM_TYPE 7
|
||||||
#define DLG_N_TER 336
|
#define DLG_NEW_PICTURE 20 // This is added to various of the above constants
|
||||||
#define DLG_N_TER_ANIM 13
|
#define PICT_CUSTOM_TYPE 100 // This is added to various of the above constants
|
||||||
#define DLG_N_MONST 172
|
#define PICT_N_TER 336
|
||||||
#define DLG_N_DLG 31
|
#define PICT_N_TER_ANIM 18
|
||||||
#define DLG_N_TALK 83
|
#define PICT_N_MONST 172
|
||||||
#define DLG_N_SCEN 29
|
#define PICT_N_DLG 36
|
||||||
#define DLG_N_ITEM 122
|
#define PICT_N_TALK 83
|
||||||
|
#define PICT_N_SCEN 29
|
||||||
|
#define PICT_N_ITEM 122
|
||||||
|
|
||||||
|
#define DLG_BUTTON_TYPE 0
|
||||||
|
#define DLG_DEFAULT_BTN_TYPE 1
|
||||||
|
// Not sure what 10 and 11 do, but they're similar to above two
|
||||||
|
#define DLG_LED_BUTTON 2
|
||||||
|
// 3, 4, 7, 8, 9 are various text objects; not completely sure which is which
|
||||||
|
#define DLG_TEXT_BOLD 3
|
||||||
|
#define DLG_TEXT_PLAIN 4
|
||||||
|
#define DLG_TEXT_LARGE 7
|
||||||
|
#define DLG_OLD_PICTURE 5
|
||||||
|
// And I don't know what 6 is for either
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char x,y;
|
char x,y;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ Boolean cre(short val,short min,short max,char *text1, char *text2,short parent_
|
|||||||
|
|
||||||
void give_error(char *text1, char *text2,short parent_num)
|
void give_error(char *text1, char *text2,short parent_num)
|
||||||
{
|
{
|
||||||
display_strings(text1,text2,"Error!",57,/*7*/16,DLG_DLG_TYPE,parent_num);
|
display_strings(text1,text2,"Error!",57,/*7*/16,PICT_DLG_TYPE,parent_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_strings_event_filter (short item_hit)
|
void display_strings_event_filter (short item_hit)
|
||||||
@@ -299,7 +299,7 @@ void put_choice_pics(short g_type)
|
|||||||
|
|
||||||
for (i = 0; i < 36; i++) {
|
for (i = 0; i < 36; i++) {
|
||||||
if (store_first_g + which_page * 36 + i > store_last_g) {
|
if (store_first_g + which_page * 36 + i > store_last_g) {
|
||||||
csp(819,41 + i,0,DLG_BLANK_TYPE);
|
csp(819,41 + i,0,PICT_BLANK_TYPE);
|
||||||
cd_activate_item(819,5 + i,0);
|
cd_activate_item(819,5 + i,0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -806,9 +806,9 @@ void edit_spec_enc_event_filter (short item_hit)
|
|||||||
dialog_not_toast = FALSE;
|
dialog_not_toast = FALSE;
|
||||||
i = -1;
|
i = -1;
|
||||||
switch (edit_pict_mess[store_spec_node.type]) {
|
switch (edit_pict_mess[store_spec_node.type]) {
|
||||||
case 1: i = choose_graphic(/*700,731*/0,DLG_N_DLG,store_spec_node.pic,DLG_DLG_TYPE,822); break;
|
case 1: i = choose_graphic(/*700,731*/0,PICT_N_DLG,store_spec_node.pic,PICT_DLG_TYPE,822); break;
|
||||||
case 2: i = choose_graphic(0,DLG_N_TER,store_spec_node.pic,DLG_TER_TYPE,822); break;
|
case 2: i = choose_graphic(0,PICT_N_TER,store_spec_node.pic,PICT_TER_TYPE,822); break;
|
||||||
case 3: i = choose_graphic(/*400,572*/0,DLG_N_MONST,store_spec_node.pic,DLG_MONST_TYPE,822); break;
|
case 3: i = choose_graphic(/*400,572*/0,PICT_N_MONST,store_spec_node.pic,PICT_MONST_TYPE,822); break;
|
||||||
}
|
}
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
store_spec_node.pic = i;
|
store_spec_node.pic = i;
|
||||||
@@ -1276,10 +1276,10 @@ void edit_scen_intro_event_filter (short item_hit)
|
|||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
i = CDGN(804,8);
|
i = CDGN(804,8);
|
||||||
i = choose_graphic(/*1600,1629,1600 + i,804*/0,DLG_N_SCEN,i,DLG_SCEN_TYPE,804);
|
i = choose_graphic(/*1600,1629,1600 + i,804*/0,PICT_N_SCEN,i,PICT_SCEN_TYPE,804);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
CDSN(804,8,i/* - 1600*/);
|
CDSN(804,8,i/* - 1600*/);
|
||||||
csp(804,11,i,DLG_SCEN_TYPE );
|
csp(804,11,i,PICT_SCEN_TYPE );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1297,7 +1297,7 @@ void edit_scen_intro()
|
|||||||
CDSN(804,8,scenario.intro_pic);
|
CDSN(804,8,scenario.intro_pic);
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
CDST(804, 2 + i,data_store->scen_strs[4 + i]);
|
CDST(804, 2 + i,data_store->scen_strs[4 + i]);
|
||||||
csp(804,11,scenario.intro_pic/* + 1600*/,DLG_SCEN_TYPE);
|
csp(804,11,scenario.intro_pic/* + 1600*/,PICT_SCEN_TYPE);
|
||||||
|
|
||||||
while (dialog_not_toast)
|
while (dialog_not_toast)
|
||||||
ModalDialog((ModalFilterProcPtr) cd_event_filter, &item_hit);
|
ModalDialog((ModalFilterProcPtr) cd_event_filter, &item_hit);
|
||||||
|
|||||||
@@ -972,10 +972,10 @@ void put_ter_info_in_dlog()
|
|||||||
get_str(str,21,80 + store_ter.special);
|
get_str(str,21,80 + store_ter.special);
|
||||||
csit(813,68,(char *) str);
|
csit(813,68,(char *) str);
|
||||||
if (store_ter.picture >= 1000)
|
if (store_ter.picture >= 1000)
|
||||||
csp(813,14,0,DLG_BLANK_TYPE);
|
csp(813,14,0,PICT_BLANK_TYPE);
|
||||||
else if (store_ter.picture >= 400)
|
else if (store_ter.picture >= 400)
|
||||||
csp(813,14,store_ter.picture/* - 100*/,DLG_TER_ANIM_TYPE);
|
csp(813,14,store_ter.picture - 400,PICT_TER_ANIM_TYPE);
|
||||||
else csp(813,14,store_ter.picture,DLG_TER_TYPE);
|
else csp(813,14,store_ter.picture,PICT_TER_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean save_ter_info()
|
Boolean save_ter_info()
|
||||||
@@ -1065,19 +1065,19 @@ void edit_ter_type_event_filter (short item_hit)
|
|||||||
|
|
||||||
case 13: case 70:
|
case 13: case 70:
|
||||||
if (item_hit == 13)
|
if (item_hit == 13)
|
||||||
i = choose_graphic(0,DLG_N_TER,store_ter.picture,DLG_TER_TYPE,813);
|
i = choose_graphic(0,PICT_N_TER,store_ter.picture,PICT_TER_TYPE,813);
|
||||||
else i = choose_graphic(/*300,313*/0,DLG_N_TER_ANIM,store_ter.picture,DLG_TER_ANIM_TYPE,813);
|
else i = 400 + choose_graphic(/*300,313*/0,PICT_N_TER_ANIM,store_ter.picture,PICT_TER_ANIM_TYPE,813);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
if (i >= 300) i += 100;
|
//if (i >= 300) i += 100;
|
||||||
store_ter.picture = i;
|
store_ter.picture = i;
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
CDSN(813,5,store_ter.picture);
|
CDSN(813,5,store_ter.picture);
|
||||||
if (store_ter.picture >= 1000)
|
if (store_ter.picture >= 1000)
|
||||||
csp(813,14,0,DLG_BLANK_TYPE);
|
csp(813,14,0,PICT_BLANK_TYPE);
|
||||||
else if (store_ter.picture >= 400)
|
else if (store_ter.picture >= 400)
|
||||||
csp(813,14,store_ter.picture/* - 100*/,DLG_TER_ANIM_TYPE);
|
csp(813,14,store_ter.picture - 400,PICT_TER_ANIM_TYPE);
|
||||||
else csp(813,14,store_ter.picture,DLG_TER_TYPE);
|
else csp(813,14,store_ter.picture,PICT_TER_TYPE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cd_hit_led_range(813,32,55,item_hit);
|
cd_hit_led_range(813,32,55,item_hit);
|
||||||
@@ -1135,8 +1135,8 @@ void put_monst_info_in_dlog()
|
|||||||
Str255 str;
|
Str255 str;
|
||||||
|
|
||||||
if (store_monst.picture_num < 1000)
|
if (store_monst.picture_num < 1000)
|
||||||
csp(814,34,/*400 + */store_monst.picture_num,DLG_MONST_TYPE);
|
csp(814,34,/*400 + */store_monst.picture_num,PICT_MONST_TYPE);
|
||||||
else csp(814,34,0,DLG_BLANK_TYPE);
|
else csp(814,34,0,PICT_BLANK_TYPE);
|
||||||
cdsin(814,33,store_which_monst);
|
cdsin(814,33,store_which_monst);
|
||||||
CDST(814,2,data_store->scen_item_list.monst_names[store_which_monst]);
|
CDST(814,2,data_store->scen_item_list.monst_names[store_which_monst]);
|
||||||
CDSN(814,3,store_monst.picture_num);
|
CDSN(814,3,store_monst.picture_num);
|
||||||
@@ -1279,7 +1279,7 @@ void edit_monst_type_event_filter (short item_hit)
|
|||||||
break;
|
break;
|
||||||
case 24: // picture
|
case 24: // picture
|
||||||
if (save_monst_info() == FALSE) break;
|
if (save_monst_info() == FALSE) break;
|
||||||
i = choose_graphic(/*400,572*/0,DLG_N_MONST,store_monst.picture_num/* + 400*/,DLG_MONST_TYPE,814);
|
i = choose_graphic(/*400,572*/0,PICT_N_MONST,store_monst.picture_num/* + 400*/,PICT_MONST_TYPE,814);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
store_monst.picture_num = i - 400;
|
store_monst.picture_num = i - 400;
|
||||||
}
|
}
|
||||||
@@ -1314,7 +1314,7 @@ void edit_monst_type_event_filter (short item_hit)
|
|||||||
break;
|
break;
|
||||||
case 28: // talk pic
|
case 28: // talk pic
|
||||||
if (save_monst_info() == FALSE) break;
|
if (save_monst_info() == FALSE) break;
|
||||||
i = choose_graphic(/*1001,1084*/1,1+DLG_N_TALK,store_monst.default_facial_pic/* + 1000*/,DLG_TALK_TYPE,814);
|
i = choose_graphic(/*1001,1084*/1,1+PICT_N_TALK,store_monst.default_facial_pic/* + 1000*/,PICT_TALK_TYPE,814);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
store_monst.default_facial_pic = i - 1000;
|
store_monst.default_facial_pic = i - 1000;
|
||||||
}
|
}
|
||||||
@@ -1507,8 +1507,8 @@ void put_item_info_in_dlog()
|
|||||||
CDST(818,2,store_item.full_name);
|
CDST(818,2,store_item.full_name);
|
||||||
CDST(818,3,store_item.name);
|
CDST(818,3,store_item.name);
|
||||||
if (store_item.graphic_num >= 150)
|
if (store_item.graphic_num >= 150)
|
||||||
csp(818,49,0,DLG_BLANK_TYPE);
|
csp(818,49,0,PICT_BLANK_TYPE);
|
||||||
else csp(818,49,/*1800 + */store_item.graphic_num,DLG_ITEM_TYPE);
|
else csp(818,49,/*1800 + */store_item.graphic_num,PICT_ITEM_TYPE);
|
||||||
CDSN(818,4,store_item.graphic_num);
|
CDSN(818,4,store_item.graphic_num);
|
||||||
cd_set_led_range(818,18,45,store_item.variety);
|
cd_set_led_range(818,18,45,store_item.variety);
|
||||||
CDSN(818,5,store_item.item_level);
|
CDSN(818,5,store_item.item_level);
|
||||||
@@ -1609,7 +1609,7 @@ void edit_item_type_event_filter (short item_hit)
|
|||||||
break;
|
break;
|
||||||
case 56:
|
case 56:
|
||||||
if (save_item_info() == FALSE) break;
|
if (save_item_info() == FALSE) break;
|
||||||
i = choose_graphic(/*1800,1922*/0,DLG_N_ITEM,store_item.graphic_num/* + 1800*/,DLG_ITEM_TYPE,818);
|
i = choose_graphic(/*1800,1922*/0,PICT_N_ITEM,store_item.graphic_num/* + 1800*/,PICT_ITEM_TYPE,818);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
store_item.graphic_num = i - 1800;
|
store_item.graphic_num = i - 1800;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,8 +213,8 @@ void put_placed_monst_in_dlog()
|
|||||||
CDSN(837,2,store_placed_monst.personality);
|
CDSN(837,2,store_placed_monst.personality);
|
||||||
CDSN(837,3,store_placed_monst.facial_pic);
|
CDSN(837,3,store_placed_monst.facial_pic);
|
||||||
if ((store_placed_monst.facial_pic < 1) || (store_placed_monst.facial_pic >= 1000))
|
if ((store_placed_monst.facial_pic < 1) || (store_placed_monst.facial_pic >= 1000))
|
||||||
csp(837,11,0,DLG_BLANK_TYPE);
|
csp(837,11,0,PICT_BLANK_TYPE);
|
||||||
else csp(837,11,store_placed_monst.facial_pic/* + 1000*/,DLG_TALK_TYPE);
|
else csp(837,11,store_placed_monst.facial_pic/* + 1000*/,PICT_TALK_TYPE);
|
||||||
}
|
}
|
||||||
Boolean get_placed_monst_in_dlog()
|
Boolean get_placed_monst_in_dlog()
|
||||||
{
|
{
|
||||||
@@ -257,7 +257,7 @@ void edit_placed_monst_event_filter (short item_hit)
|
|||||||
case 12: // facial pic
|
case 12: // facial pic
|
||||||
if (get_placed_monst_in_dlog() == FALSE)
|
if (get_placed_monst_in_dlog() == FALSE)
|
||||||
break;
|
break;
|
||||||
i = choose_graphic(/*1001,1084*/1,1+DLG_N_TALK,store_placed_monst.facial_pic/* + 1000*/,DLG_TALK_TYPE,837);
|
i = choose_graphic(/*1001,1084*/1,1+PICT_N_TALK,store_placed_monst.facial_pic/* + 1000*/,PICT_TALK_TYPE,837);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
store_placed_monst.facial_pic = i - 1000;
|
store_placed_monst.facial_pic = i - 1000;
|
||||||
}
|
}
|
||||||
@@ -426,8 +426,8 @@ void put_placed_item_in_dlog()
|
|||||||
|
|
||||||
i = data_store->scen_item_list.scen_items[store_placed_item.item_code].graphic_num;
|
i = data_store->scen_item_list.scen_items[store_placed_item.item_code].graphic_num;
|
||||||
if (i >= 1000)
|
if (i >= 1000)
|
||||||
csp(836,4,0,DLG_BLANK_TYPE);
|
csp(836,4,0,PICT_BLANK_TYPE);
|
||||||
else csp(836,4,/*1800 + */i,DLG_ITEM_TYPE);
|
else csp(836,4,/*1800 + */i,PICT_ITEM_TYPE);
|
||||||
}
|
}
|
||||||
Boolean get_placed_item_in_dlog()
|
Boolean get_placed_item_in_dlog()
|
||||||
{
|
{
|
||||||
@@ -549,10 +549,10 @@ void edit_sign(short which_sign,short picture)
|
|||||||
cd_create_dialog_parent_num(831,0);
|
cd_create_dialog_parent_num(831,0);
|
||||||
|
|
||||||
if (picture >= 1000)
|
if (picture >= 1000)
|
||||||
csp(831,6,0,DLG_BLANK_TYPE);
|
csp(831,6,0,PICT_BLANK_TYPE);
|
||||||
else if (picture >= 400)
|
else if (picture >= 400)
|
||||||
csp(831,6,picture/* - 100*/,DLG_TER_ANIM_TYPE);
|
csp(831,6,picture - 400,PICT_TER_ANIM_TYPE);
|
||||||
else csp(831,6,picture,DLG_TER_TYPE);
|
else csp(831,6,picture,PICT_TER_TYPE);
|
||||||
|
|
||||||
cdsin(831,5,store_which_sign);
|
cdsin(831,5,store_which_sign);
|
||||||
if (editing_town == FALSE)
|
if (editing_town == FALSE)
|
||||||
|
|||||||
Reference in New Issue
Block a user