mirror of https://github.com/OpenRCT2/OpenRCT2.git
implement window_track_list_select
This commit is contained in:
parent
a0bdde2525
commit
f246b97c69
|
@ -144,6 +144,8 @@
|
|||
<ClCompile Include="..\src\window_game_top_toolbar.c" />
|
||||
<ClCompile Include="..\src\window_tooltip.c" />
|
||||
<ClCompile Include="..\src\window_track_list.c" />
|
||||
<ClCompile Include="..\src\window_track_manage.c" />
|
||||
<ClCompile Include="..\src\window_track_place.c" />
|
||||
<ClCompile Include="..\src\window_water.c" />
|
||||
<ClCompile Include="..\src\staff.c" />
|
||||
<ClCompile Include="..\src\window_scenery.c" />
|
||||
|
|
|
@ -419,6 +419,12 @@
|
|||
<ClCompile Include="..\src\window_track_list.c">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\window_track_manage.c">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\window_track_place.c">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
|
|
@ -430,10 +430,10 @@ rct_map_element *ride_find_track_gap(rct_map_element *startTrackElement, int *ou
|
|||
*
|
||||
* rct2: 0x006B4800
|
||||
*/
|
||||
void ride_construct_new(int list_item)
|
||||
void ride_construct_new(ride_list_item listItem)
|
||||
{
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
edx = list_item;
|
||||
edx = *((uint16*)&listItem);
|
||||
eax = 0;
|
||||
ecx = 0;
|
||||
ebx = 1;
|
||||
|
|
|
@ -551,7 +551,7 @@ void ride_update_favourited_stat();
|
|||
void ride_check_all_reachable();
|
||||
rct_map_element *sub_6CAF80(int rideIndex, int *outX, int *outY);
|
||||
rct_map_element *ride_find_track_gap(rct_map_element *startTrackElement, int *outX, int *outY);
|
||||
void ride_construct_new(int list_item);
|
||||
void ride_construct_new(ride_list_item listItem);
|
||||
int ride_try_construct(rct_map_element *trackMapElement);
|
||||
void ride_get_status(int rideIndex, int *formatSecondary, int *argument);
|
||||
rct_peep *ride_get_assigned_mechanic(rct_ride *ride);
|
||||
|
|
|
@ -1197,7 +1197,7 @@ enum {
|
|||
|
||||
STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE = 3134,
|
||||
STR_VEHICLE_DESIGN_UNAVAILABLE = 3135,
|
||||
|
||||
STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE = 3136,
|
||||
STR_SELECT_NEARBY_SCENERY = 3137,
|
||||
STR_RESET_SELECTION = 3138,
|
||||
|
||||
|
|
|
@ -480,6 +480,7 @@ void window_finances_research_open();
|
|||
void window_new_campaign_open(sint16 campaignType);
|
||||
void window_ride_main_open(int rideIndex);
|
||||
void window_ride_list_open();
|
||||
void window_track_place_open();
|
||||
void window_new_ride_open();
|
||||
void window_banner_open();
|
||||
void window_cheats_open();
|
||||
|
@ -487,6 +488,7 @@ void window_research_open();
|
|||
void window_scenery_open();
|
||||
void window_music_credits_open();
|
||||
void window_publisher_credits_open();
|
||||
void window_track_manage_open();
|
||||
|
||||
void window_guest_list_init_vars_a();
|
||||
void window_guest_list_init_vars_b();
|
||||
|
|
|
@ -968,7 +968,5 @@ static void window_new_ride_select(rct_window *w)
|
|||
}
|
||||
}
|
||||
|
||||
// Show ride construction window
|
||||
//RCT2_CALLPROC_X(0x006B4800, *((sint16*)&item), 0, 0, 0, 0, 0, 0);
|
||||
ride_construct_new(*((sint16*)&item));
|
||||
ride_construct_new(item);
|
||||
}
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <memory.h>
|
||||
#include "addresses.h"
|
||||
#include "audio.h"
|
||||
#include "editor.h"
|
||||
#include "ride.h"
|
||||
#include "sprites.h"
|
||||
|
@ -95,6 +95,19 @@ static void* window_track_list_events[] = {
|
|||
|
||||
static ride_list_item _window_track_list_item;
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D1DEC
|
||||
*/
|
||||
static rct_track_design *track_get_info(int index, void** preview)
|
||||
{
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
eax = index;
|
||||
RCT2_CALLFUNC_X(0x006D1DEC, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
if (preview != NULL) *preview = (void*)esi;
|
||||
return (rct_track_design*)edi;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006CF1A2
|
||||
|
@ -140,9 +153,65 @@ void window_track_list_open(ride_list_item item)
|
|||
RCT2_GLOBAL(0x00F440AE, uint8) = 2;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006CFB82
|
||||
*/
|
||||
static void window_track_list_select(rct_window *w, int index)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006CFB82, 0, index, 0, 0, (int)w, 0, 0);
|
||||
uint8 *trackDesignItem, *trackDesignList = (uint8*)0x00F441EC;
|
||||
char *src, *dst;
|
||||
rct_track_design *trackDesign;
|
||||
|
||||
w->track_list.var_480 = index;
|
||||
|
||||
sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2), 0, 0, 0);
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER & 8) && index == 0) {
|
||||
window_close(w);
|
||||
ride_construct_new(_window_track_list_item);
|
||||
return;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(0x00F44153, uint8) != 0)
|
||||
RCT2_GLOBAL(0x00F44152, uint8) = 1;
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER & 8))
|
||||
index--;
|
||||
|
||||
trackDesignItem = trackDesignList + (index * 128);;
|
||||
RCT2_GLOBAL(0x00F4403C, uint8*) = trackDesignItem;
|
||||
dst = (char*)0x009BC313;
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER & 8))
|
||||
*dst++ = FORMAT_WHITE;
|
||||
*dst++ = FORMAT_OPENQUOTES;
|
||||
|
||||
while (*src != '.' && *src != 0) {
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
*dst++ = FORMAT_ENDQUOTES;
|
||||
*dst = 0;
|
||||
|
||||
subsitute_path((char*)0x0141EF68, (char*)RCT2_ADDRESS_TRACKS_PATH, trackDesignItem);
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_MANAGER & 8) {
|
||||
window_track_manage_open();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!RCT2_CALLPROC_X(0x0067726A, 0, 0, 0, 0, 0, 0, 0)) {
|
||||
w->track_list.var_480 = 0xFFFF;
|
||||
window_invalidate(w);
|
||||
return;
|
||||
}
|
||||
|
||||
trackDesign = track_get_info(index, NULL);
|
||||
if (trackDesign->var_06 & 4)
|
||||
window_error_open(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, -1);
|
||||
|
||||
window_close(w);
|
||||
window_track_place_open();
|
||||
}
|
||||
|
||||
static int window_track_list_get_list_item_index_from_position(int x, int y)
|
||||
|
@ -336,19 +405,6 @@ static void window_track_list_invalidate()
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D1DEC
|
||||
*/
|
||||
static rct_track_design *track_get_info(int index, void** preview)
|
||||
{
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
eax = index;
|
||||
RCT2_CALLFUNC_X(0x006D1DEC, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
if (preview != NULL) *preview = (void*)esi;
|
||||
return (rct_track_design*)edi;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006CF387
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "window.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D348F
|
||||
*/
|
||||
void window_track_manage_open()
|
||||
{
|
||||
RCT2_CALLPROC_EBPSAFE(0x006D348F);
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "viewport.h"
|
||||
#include "window.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006CFCA0
|
||||
*/
|
||||
void window_track_place_open()
|
||||
{
|
||||
rct_window *w;
|
||||
|
||||
window_close_construction_windows();
|
||||
RCT2_GLOBAL(0x00F44168, void*) = rct2_malloc(13104);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006D182E);
|
||||
|
||||
w = window_create(0, 29, 200, 124, (uint32*)0x0099405C, WC_TRACK_DESIGN_PLACE, 0);
|
||||
w->widgets = (rct_widget*)0x009D7F18;
|
||||
w->enabled_widgets = 4 | 8 | 0x10 | 0x20;
|
||||
window_init_scroll_widgets(w);
|
||||
w->colours[0] = 24;
|
||||
w->colours[1] = 24;
|
||||
w->colours[2] = 24;
|
||||
tool_set(w, 6, 12);
|
||||
RCT2_GLOBAL(0x009DE518, uint32) |= 6;
|
||||
window_push_others_right(w);
|
||||
show_gridlines();
|
||||
RCT2_GLOBAL(0x00F440D9, uint32) |= 0x80000000;
|
||||
RCT2_GLOBAL(0x00F440DD, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x00F440AE, uint8) = (-RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint8)) & 3;
|
||||
RCT2_CALLPROC_EBPSAFE(0x006D1845);
|
||||
}
|
Loading…
Reference in New Issue