Merge branch 'master' of https://github.com/ZedThree/OpenRCT2 into ZedThree-master

This commit is contained in:
IntelOrca 2014-04-27 20:09:35 +01:00
commit cdd65dbcee
3 changed files with 16 additions and 13 deletions

View File

@ -165,7 +165,9 @@ static int news_item_get_new_history_slot()
}
/**
*
* Get the (x,y,z) coordinates of the subject of a news item.
* If the new item is no longer valid, return 0x8000 in the x-coordinate
*
* rct2: 0x0066BA74
*/
void news_item_get_subject_location(int type, int subject, int *x, int *y, int *z)

View File

@ -56,5 +56,5 @@ typedef struct {
void news_item_init_queue();
void news_item_update_current();
void news_item_close_current();
void news_item_get_subject_location(int type, int subject, int *x, int *y, int *z);
#endif

View File

@ -179,15 +179,16 @@ static void window_game_bottom_toolbar_mouseup()
break;
{
uint32 eax, ebx, ecx, edx, esi, edi, ebp;
ecx = newsItem->assoc;
edx = newsItem->type;
RCT2_CALLFUNC_X(0x0066BA74, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
if ((eax & 0xFFFF) == 0x8000)
int x, y, z;
int subject = newsItem->assoc;
news_item_get_subject_location(newsItem->type, subject, &x, &y, &z);
if (x == 0x8000)
break;
if ((mainWindow = window_get_main()) != NULL)
window_scroll_to_location(mainWindow, eax & 0xFFFF, ecx & 0xFFFF, edx & 0xFFFF);
window_scroll_to_location(mainWindow, x, y, z);
}
break;
case WIDX_RIGHT_OUTSET:
@ -278,12 +279,12 @@ static void window_game_bottom_toolbar_invalidate()
w->disabled_widgets &= ~(1 << WIDX_NEWS_SUBJECT);
w->disabled_widgets &= ~(1 << WIDX_NEWS_LOCATE);
int eax, ebx, ecx, edx, esi, edi, ebp;
ecx = newsItem->assoc;
edx = newsItem->type;
RCT2_CALLFUNC_X(0x0066BA74, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
// Find out if the news item is no longer valid
int x, y, z;
int subject = newsItem->assoc;
news_item_get_subject_location(newsItem->type, subject, &x, &y, &z);
if ((eax & 0xFFFF) == 0x8000)
if (x == 0x8000)
w->disabled_widgets |= (1 << WIDX_NEWS_LOCATE);
if (!(((char*)0x0097BE7C)[newsItem->type] & 2)) {