mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #2642 from OpenRCT2/remove-tutorial
Remove all tutorial code
This commit is contained in:
commit
e323397574
|
@ -91,7 +91,6 @@
|
||||||
D4EC48281C26342F0024B507 /* scenario_list.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC476D1C26342F0024B507 /* scenario_list.c */; };
|
D4EC48281C26342F0024B507 /* scenario_list.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC476D1C26342F0024B507 /* scenario_list.c */; };
|
||||||
D4EC48291C26342F0024B507 /* scenario.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC476E1C26342F0024B507 /* scenario.c */; };
|
D4EC48291C26342F0024B507 /* scenario.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC476E1C26342F0024B507 /* scenario.c */; };
|
||||||
D4EC482A1C26342F0024B507 /* title.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47711C26342F0024B507 /* title.c */; };
|
D4EC482A1C26342F0024B507 /* title.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47711C26342F0024B507 /* title.c */; };
|
||||||
D4EC482B1C26342F0024B507 /* tutorial.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47731C26342F0024B507 /* tutorial.c */; };
|
|
||||||
D4EC482C1C26342F0024B507 /* sawyercoding.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47761C26342F0024B507 /* sawyercoding.c */; };
|
D4EC482C1C26342F0024B507 /* sawyercoding.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47761C26342F0024B507 /* sawyercoding.c */; };
|
||||||
D4EC482D1C26342F0024B507 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47781C26342F0024B507 /* util.c */; };
|
D4EC482D1C26342F0024B507 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC47781C26342F0024B507 /* util.c */; };
|
||||||
D4EC482E1C26342F0024B507 /* about.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC477B1C26342F0024B507 /* about.c */; };
|
D4EC482E1C26342F0024B507 /* about.c in Sources */ = {isa = PBXBuildFile; fileRef = D4EC477B1C26342F0024B507 /* about.c */; };
|
||||||
|
@ -372,8 +371,6 @@
|
||||||
D4EC47701C26342F0024B507 /* sprites.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sprites.h; path = src/sprites.h; sourceTree = "<group>"; };
|
D4EC47701C26342F0024B507 /* sprites.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sprites.h; path = src/sprites.h; sourceTree = "<group>"; };
|
||||||
D4EC47711C26342F0024B507 /* title.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = title.c; path = src/title.c; sourceTree = "<group>"; };
|
D4EC47711C26342F0024B507 /* title.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = title.c; path = src/title.c; sourceTree = "<group>"; };
|
||||||
D4EC47721C26342F0024B507 /* title.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = title.h; path = src/title.h; sourceTree = "<group>"; };
|
D4EC47721C26342F0024B507 /* title.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = title.h; path = src/title.h; sourceTree = "<group>"; };
|
||||||
D4EC47731C26342F0024B507 /* tutorial.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tutorial.c; path = src/tutorial.c; sourceTree = "<group>"; };
|
|
||||||
D4EC47741C26342F0024B507 /* tutorial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tutorial.h; path = src/tutorial.h; sourceTree = "<group>"; };
|
|
||||||
D4EC47761C26342F0024B507 /* sawyercoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sawyercoding.c; sourceTree = "<group>"; };
|
D4EC47761C26342F0024B507 /* sawyercoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sawyercoding.c; sourceTree = "<group>"; };
|
||||||
D4EC47771C26342F0024B507 /* sawyercoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sawyercoding.h; sourceTree = "<group>"; };
|
D4EC47771C26342F0024B507 /* sawyercoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sawyercoding.h; sourceTree = "<group>"; };
|
||||||
D4EC47781C26342F0024B507 /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = util.c; sourceTree = "<group>"; };
|
D4EC47781C26342F0024B507 /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = util.c; sourceTree = "<group>"; };
|
||||||
|
@ -634,8 +631,6 @@
|
||||||
D4EC47701C26342F0024B507 /* sprites.h */,
|
D4EC47701C26342F0024B507 /* sprites.h */,
|
||||||
D4EC47711C26342F0024B507 /* title.c */,
|
D4EC47711C26342F0024B507 /* title.c */,
|
||||||
D4EC47721C26342F0024B507 /* title.h */,
|
D4EC47721C26342F0024B507 /* title.h */,
|
||||||
D4EC47731C26342F0024B507 /* tutorial.c */,
|
|
||||||
D4EC47741C26342F0024B507 /* tutorial.h */,
|
|
||||||
D4163F671C2A044D00B83136 /* version.h */,
|
D4163F671C2A044D00B83136 /* version.h */,
|
||||||
);
|
);
|
||||||
name = Sources;
|
name = Sources;
|
||||||
|
@ -1385,7 +1380,6 @@
|
||||||
D4EC48231C26342F0024B507 /* station.c in Sources */,
|
D4EC48231C26342F0024B507 /* station.c in Sources */,
|
||||||
D4EC484D1C26342F0024B507 /* new_ride.c in Sources */,
|
D4EC484D1C26342F0024B507 /* new_ride.c in Sources */,
|
||||||
D4EC484A1C26342F0024B507 /* music_credits.c in Sources */,
|
D4EC484A1C26342F0024B507 /* music_credits.c in Sources */,
|
||||||
D4EC482B1C26342F0024B507 /* tutorial.c in Sources */,
|
|
||||||
D4EC48241C26342F0024B507 /* track.c in Sources */,
|
D4EC48241C26342F0024B507 /* track.c in Sources */,
|
||||||
D4EC47DF1C26342F0024B507 /* addresses.c in Sources */,
|
D4EC47DF1C26342F0024B507 /* addresses.c in Sources */,
|
||||||
D4EC484B1C26342F0024B507 /* network_status.c in Sources */,
|
D4EC484B1C26342F0024B507 /* network_status.c in Sources */,
|
||||||
|
|
|
@ -119,7 +119,6 @@
|
||||||
<ClCompile Include="test\ride\ride_ratings_test.c" />
|
<ClCompile Include="test\ride\ride_ratings_test.c" />
|
||||||
<ClCompile Include="test\tests.c" />
|
<ClCompile Include="test\tests.c" />
|
||||||
<ClCompile Include="src\title.c" />
|
<ClCompile Include="src\title.c" />
|
||||||
<ClCompile Include="src\tutorial.c" />
|
|
||||||
<ClCompile Include="src\util\sawyercoding.c" />
|
<ClCompile Include="src\util\sawyercoding.c" />
|
||||||
<ClCompile Include="src\util\util.c" />
|
<ClCompile Include="src\util\util.c" />
|
||||||
<ClCompile Include="src\windows\about.c" />
|
<ClCompile Include="src\windows\about.c" />
|
||||||
|
@ -271,7 +270,6 @@
|
||||||
<ClInclude Include="test\ride\ride_ratings_test.h" />
|
<ClInclude Include="test\ride\ride_ratings_test.h" />
|
||||||
<ClInclude Include="test\tests.h" />
|
<ClInclude Include="test\tests.h" />
|
||||||
<ClInclude Include="src\title.h" />
|
<ClInclude Include="src\title.h" />
|
||||||
<ClInclude Include="src\tutorial.h" />
|
|
||||||
<ClInclude Include="src\util\sawyercoding.h" />
|
<ClInclude Include="src\util\sawyercoding.h" />
|
||||||
<ClInclude Include="src\util\util.h" />
|
<ClInclude Include="src\util\util.h" />
|
||||||
<ClInclude Include="src\windows\dropdown.h" />
|
<ClInclude Include="src\windows\dropdown.h" />
|
||||||
|
|
|
@ -270,9 +270,6 @@
|
||||||
<ClCompile Include="src\title.c">
|
<ClCompile Include="src\title.c">
|
||||||
<Filter>Source</Filter>
|
<Filter>Source</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="src\tutorial.c">
|
|
||||||
<Filter>Source</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="src\localisation\date.c">
|
<ClCompile Include="src\localisation\date.c">
|
||||||
<Filter>Source\Localisation</Filter>
|
<Filter>Source\Localisation</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -692,9 +689,6 @@
|
||||||
<ClInclude Include="src\title.h">
|
<ClInclude Include="src\title.h">
|
||||||
<Filter>Source</Filter>
|
<Filter>Source</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="src\tutorial.h">
|
|
||||||
<Filter>Source</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="src\localisation\date.h">
|
<ClInclude Include="src\localisation\date.h">
|
||||||
<Filter>Source\Localisation</Filter>
|
<Filter>Source\Localisation</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
#include "ride/track.h"
|
#include "ride/track.h"
|
||||||
#include "scenario.h"
|
#include "scenario.h"
|
||||||
#include "title.h"
|
#include "title.h"
|
||||||
#include "tutorial.h"
|
|
||||||
#include "util/sawyercoding.h"
|
#include "util/sawyercoding.h"
|
||||||
#include "util/util.h"
|
#include "util/util.h"
|
||||||
#include "windows/error.h"
|
#include "windows/error.h"
|
||||||
|
|
43
src/input.c
43
src/input.c
|
@ -35,7 +35,6 @@
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include "ride/ride_data.h"
|
#include "ride/ride_data.h"
|
||||||
#include "scenario.h"
|
#include "scenario.h"
|
||||||
#include "tutorial.h"
|
|
||||||
#include "windows/tooltip.h"
|
#include "windows/tooltip.h"
|
||||||
#include "windows/dropdown.h"
|
#include "windows/dropdown.h"
|
||||||
#include "world/banner.h"
|
#include "world/banner.h"
|
||||||
|
@ -95,7 +94,6 @@ static void input_scroll_part_update_vthumb(rct_window *w, int widgetIndex, int
|
||||||
static void input_scroll_part_update_vtop(rct_window *w, int widgetIndex, int scroll_id);
|
static void input_scroll_part_update_vtop(rct_window *w, int widgetIndex, int scroll_id);
|
||||||
static void input_scroll_part_update_vbottom(rct_window *w, int widgetIndex, int scroll_id);
|
static void input_scroll_part_update_vbottom(rct_window *w, int widgetIndex, int scroll_id);
|
||||||
static void input_update_tooltip(rct_window *w, int widgetIndex, int x, int y);
|
static void input_update_tooltip(rct_window *w, int widgetIndex, int x, int y);
|
||||||
static void update_cursor_position();
|
|
||||||
|
|
||||||
#pragma region Mouse input
|
#pragma region Mouse input
|
||||||
|
|
||||||
|
@ -118,7 +116,6 @@ void game_handle_input()
|
||||||
window_event_unknown_07_call(w);
|
window_event_unknown_07_call(w);
|
||||||
|
|
||||||
sub_6EA73F();
|
sub_6EA73F();
|
||||||
update_cursor_position();
|
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
game_get_next_input(&x, &y, &state);
|
game_get_next_input(&x, &y, &state);
|
||||||
|
@ -162,8 +159,6 @@ static void game_get_next_input(int *x, int *y, int *state)
|
||||||
*x = eax->x;
|
*x = eax->x;
|
||||||
*y = eax->y;
|
*y = eax->y;
|
||||||
*state = eax->state;
|
*state = eax->state;
|
||||||
|
|
||||||
// NOTE this function lacks tutorial logic
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1435,11 +1430,10 @@ void game_handle_keyboard_input()
|
||||||
|
|
||||||
if (!gConsoleOpen) {
|
if (!gConsoleOpen) {
|
||||||
// Handle mouse scrolling
|
// Handle mouse scrolling
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 0)
|
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, uint8) != 0)
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, uint8) != 0)
|
if (gInputState == INPUT_STATE_NORMAL)
|
||||||
if (gInputState == INPUT_STATE_NORMAL)
|
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 3))
|
||||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 3))
|
game_handle_edge_scroll();
|
||||||
game_handle_edge_scroll();
|
|
||||||
|
|
||||||
// Handle modifier keys and key scrolling
|
// Handle modifier keys and key scrolling
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) = 0;
|
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) = 0;
|
||||||
|
@ -1450,8 +1444,7 @@ void game_handle_keyboard_input()
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) |= 2;
|
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) |= 2;
|
||||||
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT])
|
if (gKeysState[SDL_SCANCODE_LALT] || gKeysState[SDL_SCANCODE_RALT])
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) |= 4;
|
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) |= 4;
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 0)
|
game_handle_key_scroll();
|
||||||
game_handle_key_scroll();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1481,8 +1474,6 @@ void game_handle_keyboard_input()
|
||||||
w = window_find_by_class(WC_CHANGE_KEYBOARD_SHORTCUT);
|
w = window_find_by_class(WC_CHANGE_KEYBOARD_SHORTCUT);
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
keyboard_shortcut_set(key);
|
keyboard_shortcut_set(key);
|
||||||
} else if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 1) {
|
|
||||||
tutorial_stop();
|
|
||||||
} else {
|
} else {
|
||||||
w = window_find_by_class(WC_TEXTINPUT);
|
w = window_find_by_class(WC_TEXTINPUT);
|
||||||
if (w != NULL) {
|
if (w != NULL) {
|
||||||
|
@ -1492,10 +1483,6 @@ void game_handle_keyboard_input()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0) {
|
|
||||||
game_handle_keyboard_input_for_tutorial();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1692,23 +1679,3 @@ void game_handle_key_scroll()
|
||||||
gInputFlags |= INPUT_FLAG_VIEWPORT_SCROLLING;
|
gInputFlags |= INPUT_FLAG_VIEWPORT_SCROLLING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* rct2: 0x006E8346
|
|
||||||
*/
|
|
||||||
static void update_cursor_position()
|
|
||||||
{
|
|
||||||
switch (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8)) {
|
|
||||||
case 0:
|
|
||||||
// RCT2_GLOBAL(0x0142004C, sint32) = RCT2_GLOBAL(0x0142406C, sint32);
|
|
||||||
// RCT2_GLOBAL(0x01420050, sint32) = RCT2_GLOBAL(0x01424070, sint32);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
// read tutorial cursor position
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
// write tutorial cursor position
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -66,7 +66,6 @@ extern uint8 gInputFlags;
|
||||||
void title_handle_keyboard_input();
|
void title_handle_keyboard_input();
|
||||||
void game_handle_input();
|
void game_handle_input();
|
||||||
void game_handle_keyboard_input();
|
void game_handle_keyboard_input();
|
||||||
void game_handle_keyboard_input_for_tutorial();
|
|
||||||
|
|
||||||
void store_mouse_input(int state);
|
void store_mouse_input(int state);
|
||||||
|
|
||||||
|
|
|
@ -1527,8 +1527,6 @@ enum {
|
||||||
STR_ENTRANCE_NOT_CONNECTED = 2854,
|
STR_ENTRANCE_NOT_CONNECTED = 2854,
|
||||||
STR_EXIT_NOT_CONNECTED = 2855,
|
STR_EXIT_NOT_CONNECTED = 2855,
|
||||||
|
|
||||||
STR_TUTORIAL = 2856,
|
|
||||||
STR_PRESS_KEY_OR_MOUSE_BUTTON_FOR_CONTROL = 2857,
|
|
||||||
STR_CANT_START_MARKETING_CAMPAIGN = 2858,
|
STR_CANT_START_MARKETING_CAMPAIGN = 2858,
|
||||||
|
|
||||||
STR_INFOGRAMES_INTERACTIVE_CREDITS = 2860,
|
STR_INFOGRAMES_INTERACTIVE_CREDITS = 2860,
|
||||||
|
@ -1878,10 +1876,6 @@ enum {
|
||||||
STR_INSTALL_NEW_TRACK_DESIGN = 3376,
|
STR_INSTALL_NEW_TRACK_DESIGN = 3376,
|
||||||
STR_INSTALL_NEW_TRACK_DESIGN_TIP = 3377,
|
STR_INSTALL_NEW_TRACK_DESIGN_TIP = 3377,
|
||||||
|
|
||||||
STR_TUTORIAL_BEGINNERS = 3385,
|
|
||||||
STR_TUTORIAL_CUSTOM_RIDES = 3386,
|
|
||||||
STR_TUTORIAL_ROLLER_COASTER = 3387,
|
|
||||||
|
|
||||||
STR_SAVE_TRACK_SCENERY_UNABLE_TO_SELECT_ADDITIONAL_ITEM_OF_SCENERY = 3389,
|
STR_SAVE_TRACK_SCENERY_UNABLE_TO_SELECT_ADDITIONAL_ITEM_OF_SCENERY = 3389,
|
||||||
STR_SAVE_TRACK_SCENERY_TOO_MANY_ITEMS_SELECTED = 3390,
|
STR_SAVE_TRACK_SCENERY_TOO_MANY_ITEMS_SELECTED = 3390,
|
||||||
|
|
||||||
|
|
|
@ -438,9 +438,6 @@ void rct2_update_2()
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0)
|
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0)
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_PALETTE_EFFECT_FRAME_NO, sint32) += tick2;
|
RCT2_GLOBAL(RCT2_ADDRESS_PALETTE_EFFECT_FRAME_NO, sint32) += tick2;
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0)
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TICKS_SINCE_LAST_UPDATE, sint16) = 31;
|
|
||||||
|
|
||||||
// TODO: screenshot countdown process
|
// TODO: screenshot countdown process
|
||||||
|
|
||||||
network_update();
|
network_update();
|
||||||
|
|
132
src/tutorial.c
132
src/tutorial.c
|
@ -1,132 +0,0 @@
|
||||||
/*****************************************************************************
|
|
||||||
* 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 "interface/window.h"
|
|
||||||
#include "localisation/localisation.h"
|
|
||||||
#include "tutorial.h"
|
|
||||||
#include "windows/error.h"
|
|
||||||
#include "windows/tooltip.h"
|
|
||||||
|
|
||||||
static void sub_6EA2AA(rct_window *w, int widgetIndex, int x, int y, int edi);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* rct2: 0x0066ECC1
|
|
||||||
*/
|
|
||||||
void tutorial_start(int type)
|
|
||||||
{
|
|
||||||
strcpy((char*)0x009BC677, "Tutorial not implemented.");
|
|
||||||
window_error_open(3165, STR_NONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* rct2: 0x0066EE25
|
|
||||||
*/
|
|
||||||
void tutorial_stop()
|
|
||||||
{
|
|
||||||
// RCT2_CALLPROC_EBPSAFE(0x0066EE25);
|
|
||||||
}
|
|
||||||
|
|
||||||
void game_handle_keyboard_input_for_tutorial()
|
|
||||||
{
|
|
||||||
#ifdef ENABLE_TUTORIAL
|
|
||||||
rct_window *w;
|
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) == 1) {
|
|
||||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
|
||||||
RCT2_CALLFUNC_X(0x0066EEB4, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
|
||||||
eax &= 0xFF;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) = eax;
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 4) {
|
|
||||||
window_tooltip_close();
|
|
||||||
if ((w = window_get_main()) != NULL) {
|
|
||||||
RCT2_CALLPROC_X(0x006EA2AA, 0, 0, 0, 0, (int)w, RCT2_GLOBAL(0x009DEA72, uint16), 0);
|
|
||||||
RCT2_GLOBAL(0x009DEA72, uint16)++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8) & 4)) {
|
|
||||||
window_tooltip_close();
|
|
||||||
if ((w = window_get_main()) != NULL) {
|
|
||||||
sub_6EA2AA(w, 0, 0, 0, RCT2_GLOBAL(0x009DEA72, uint16));
|
|
||||||
RCT2_GLOBAL(0x009DEA72, uint16)++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write tutorial input
|
|
||||||
RCT2_CALLPROC_X(0x0066EEE1, RCT2_GLOBAL(RCT2_ADDRESS_PLACE_OBJECT_MODIFIER, uint8), 0, 0, 0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sub_6EA2AA(rct_window *w, int widgetIndex, int x, int y, int edi)
|
|
||||||
{
|
|
||||||
#ifdef ENABLE_TUTORIAL
|
|
||||||
RCT2_CALLPROC_X(0x006EA2AA, 0, 0, 0, 0, (int)w, RCT2_GLOBAL(0x009DEA72, uint16), 0);
|
|
||||||
return;
|
|
||||||
|
|
||||||
rct_window *tooltipWindow;
|
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_CLASS, rct_windowclass) = w->classification;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WINDOW_NUMBER, rct_windownumber) = w->number;
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_WIDGET_INDEX, uint16) = widgetIndex;
|
|
||||||
|
|
||||||
rct_string_id stringId = window_event_tooltip_call(w, widgetIndex);
|
|
||||||
if (stringId == (rct_string_id)STR_NONE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
tooltipWindow = window_find_by_class(WC_TOOLTIP);
|
|
||||||
if (tooltipWindow == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
char *buffer = (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER;
|
|
||||||
|
|
||||||
RCT2_GLOBAL(0x0142006C, uint32) = edi;
|
|
||||||
format_string(buffer, edi, (void*)RCT2_ADDRESS_COMMON_FORMAT_ARGS);
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
|
|
||||||
int width = gfx_get_string_width_new_lined(buffer);
|
|
||||||
width = min(width, 196);
|
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_FONT_SPRITE_BASE, uint16) = 224;
|
|
||||||
|
|
||||||
int numLines, fontHeight;
|
|
||||||
gfx_wrap_string(buffer, width + 1, &numLines, &fontHeight);
|
|
||||||
|
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_TEXT_HEIGHT, uint16) = numLines;
|
|
||||||
tooltipWindow->widgets[0].right = width + 3;
|
|
||||||
tooltipWindow->widgets[0].bottom = ((numLines + 1) * 10) + 4;
|
|
||||||
|
|
||||||
char *tooltipBuffer = (char*)RCT2_ADDRESS_TOOLTIP_TEXT_BUFFER;
|
|
||||||
memcpy(tooltipBuffer, buffer, 512);
|
|
||||||
|
|
||||||
window_tooltip_open(w, widgetIndex, x, y);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* rct2: 0x0066EE54
|
|
||||||
*/
|
|
||||||
void sub_66EE54()
|
|
||||||
{
|
|
||||||
// RCT2_CALLPROC_EBPSAFE(0x0066EE54);
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*****************************************************************************
|
|
||||||
* 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/>.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _TUTORIAL_H_
|
|
||||||
#define _TUTORIAL_H_
|
|
||||||
|
|
||||||
void tutorial_start(int type);
|
|
||||||
void tutorial_stop();
|
|
||||||
void sub_66EE54();
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -85,7 +85,6 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
||||||
static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, rct_window *w, int colour, int x, int y, uint8 factor);
|
static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi, rct_window *w, int colour, int x, int y, uint8 factor);
|
||||||
static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, rct_window *w);
|
static void window_game_bottom_toolbar_draw_right_panel(rct_drawpixelinfo *dpi, rct_window *w);
|
||||||
static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rct_window *w);
|
static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rct_window *w);
|
||||||
static void window_game_bottom_toolbar_draw_tutorial_text(rct_drawpixelinfo *dpi, rct_window *w);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -358,8 +357,6 @@ static void window_game_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *d
|
||||||
|
|
||||||
if (!news_item_is_queue_empty())
|
if (!news_item_is_queue_empty())
|
||||||
window_game_bottom_toolbar_draw_news_item(dpi, w);
|
window_game_bottom_toolbar_draw_news_item(dpi, w);
|
||||||
else if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8))
|
|
||||||
window_game_bottom_toolbar_draw_tutorial_text(dpi, w);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, rct_window *w)
|
static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, rct_window *w)
|
||||||
|
@ -599,16 +596,6 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo *dpi, rc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_game_bottom_toolbar_draw_tutorial_text(rct_drawpixelinfo *dpi, rct_window *w)
|
|
||||||
{
|
|
||||||
int x, y;
|
|
||||||
|
|
||||||
x = (window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].left + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right) / 2 + w->x;
|
|
||||||
y = window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].top + w->y + 2;
|
|
||||||
gfx_draw_string_centred(dpi, STR_TUTORIAL, x, y, 32, 0);
|
|
||||||
gfx_draw_string_centred(dpi, STR_PRESS_KEY_OR_MOUSE_BUTTON_FOR_CONTROL, x, y + 10, 32, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x0066C6D8
|
* rct2: 0x0066C6D8
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include "../interface/window.h"
|
#include "../interface/window.h"
|
||||||
#include "../openrct2.h"
|
#include "../openrct2.h"
|
||||||
#include "../sprites.h"
|
#include "../sprites.h"
|
||||||
#include "../tutorial.h"
|
|
||||||
|
|
||||||
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
|
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
|
||||||
WIDX_BACKGROUND,
|
WIDX_BACKGROUND,
|
||||||
|
@ -134,19 +133,6 @@ void window_save_prompt_open()
|
||||||
* and game_load_or_quit() are not called by the original binary anymore.
|
* and game_load_or_quit() are not called by the original binary anymore.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0) {
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 1) {
|
|
||||||
sub_66EE54();
|
|
||||||
game_load_or_quit_no_save_prompt();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
tutorial_stop();
|
|
||||||
game_load_or_quit_no_save_prompt();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) < 3840) {
|
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) < 3840) {
|
||||||
game_load_or_quit_no_save_prompt();
|
game_load_or_quit_no_save_prompt();
|
||||||
return;
|
return;
|
||||||
|
@ -249,18 +235,6 @@ static void window_save_prompt_mouseup(rct_window *w, int widgetIndex)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 0) {
|
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_ON_TUTORIAL, uint8) != 1) {
|
|
||||||
sub_66EE54();
|
|
||||||
game_load_or_quit_no_save_prompt();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
tutorial_stop();
|
|
||||||
game_load_or_quit_no_save_prompt();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void window_save_prompt_invalidate(rct_window *w)
|
static void window_save_prompt_invalidate(rct_window *w)
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "../interface/window.h"
|
#include "../interface/window.h"
|
||||||
#include "../localisation/localisation.h"
|
#include "../localisation/localisation.h"
|
||||||
#include "../sprites.h"
|
#include "../sprites.h"
|
||||||
#include "../tutorial.h"
|
|
||||||
#include "dropdown.h"
|
#include "dropdown.h"
|
||||||
#include "../interface/themes.h"
|
#include "../interface/themes.h"
|
||||||
|
|
||||||
|
@ -148,19 +147,7 @@ static void window_title_menu_mouseup(rct_window *w, int widgetIndex)
|
||||||
|
|
||||||
static void window_title_menu_mousedown(int widgetIndex, rct_window*w, rct_widget* widget)
|
static void window_title_menu_mousedown(int widgetIndex, rct_window*w, rct_widget* widget)
|
||||||
{
|
{
|
||||||
if (widgetIndex == WIDX_SHOW_TUTORIAL) {
|
if (widgetIndex == WIDX_GAME_TOOLS) {
|
||||||
gDropdownItemsFormat[0] = STR_TUTORIAL_BEGINNERS;
|
|
||||||
gDropdownItemsFormat[1] = STR_TUTORIAL_CUSTOM_RIDES;
|
|
||||||
gDropdownItemsFormat[2] = STR_TUTORIAL_ROLLER_COASTER;
|
|
||||||
window_dropdown_show_text(
|
|
||||||
w->x + widget->left,
|
|
||||||
w->y + widget->top,
|
|
||||||
widget->bottom - widget->top + 1,
|
|
||||||
w->colours[0] | 0x80,
|
|
||||||
DROPDOWN_FLAG_STAY_OPEN,
|
|
||||||
3
|
|
||||||
);
|
|
||||||
} else if (widgetIndex == WIDX_GAME_TOOLS) {
|
|
||||||
gDropdownItemsFormat[0] = STR_SCENARIO_EDITOR;
|
gDropdownItemsFormat[0] = STR_SCENARIO_EDITOR;
|
||||||
gDropdownItemsFormat[1] = STR_CONVERT_SAVED_GAME_TO_SCENARIO;
|
gDropdownItemsFormat[1] = STR_CONVERT_SAVED_GAME_TO_SCENARIO;
|
||||||
gDropdownItemsFormat[2] = STR_ROLLER_COASTER_DESIGNER;
|
gDropdownItemsFormat[2] = STR_ROLLER_COASTER_DESIGNER;
|
||||||
|
@ -178,9 +165,7 @@ static void window_title_menu_mousedown(int widgetIndex, rct_window*w, rct_widge
|
||||||
|
|
||||||
static void window_title_menu_dropdown(rct_window *w, int widgetIndex, int dropdownIndex)
|
static void window_title_menu_dropdown(rct_window *w, int widgetIndex, int dropdownIndex)
|
||||||
{
|
{
|
||||||
if (widgetIndex == WIDX_SHOW_TUTORIAL) {
|
if (widgetIndex == WIDX_GAME_TOOLS) {
|
||||||
tutorial_start(dropdownIndex);
|
|
||||||
} else if (widgetIndex == WIDX_GAME_TOOLS) {
|
|
||||||
switch (dropdownIndex) {
|
switch (dropdownIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
editor_load();
|
editor_load();
|
||||||
|
|
Loading…
Reference in New Issue