33 #include "table/strings.h" 54 if (!gui_scope)
return;
91 str = STR_INTRO_BASESET;
96 str = STR_INTRO_TRANSLATION;
106 textdim.width -= textdim.width / 2;
107 *size =
maxdim(*size, textdim);
109 size->height = height + padding.height;
116 #ifdef ENABLE_NETWORK 140 ShowNetworkGameWindow();
166 static const NWidgetPart _nested_select_game_widgets[] = {
205 SetDataTip(SPR_SELECT_TEMPERATE, STR_INTRO_TOOLTIP_TEMPERATE),
208 SetDataTip(SPR_SELECT_SUB_ARCTIC, STR_INTRO_TOOLTIP_SUB_ARCTIC_LANDSCAPE),
211 SetDataTip(SPR_SELECT_SUB_TROPICAL, STR_INTRO_TOOLTIP_SUB_TROPICAL_LANDSCAPE),
214 SetDataTip(SPR_SELECT_TOYLAND, STR_INTRO_TOOLTIP_TOYLAND_LANDSCAPE),
221 NWidget(
WWT_EMPTY, COLOUR_ORANGE,
WID_SGI_BASESET),
SetMinimalSize(316, 12),
SetFill(1, 0),
SetPadding(0, 10, 7, 10),
226 NWidget(
WWT_EMPTY, COLOUR_ORANGE,
WID_SGI_TRANSLATION),
SetMinimalSize(316, 12),
SetFill(1, 0),
SetPadding(0, 10, 7, 10),
264 SetDataTip(STR_INTRO_QUIT, STR_INTRO_TOOLTIP_QUIT),
277 _nested_select_game_widgets,
lengthof(_nested_select_game_widgets)
280 void ShowSelectGameWindow()
285 static void AskExitGameCallback(
Window *w,
bool confirmed)
287 if (confirmed) _exit_game =
true;
294 #elif defined(__APPLE__) 296 #elif defined(__BEOS__) 298 #elif defined(__HAIKU__) 300 #elif defined(__MORPHOS__) 302 #elif defined(__AMIGA__) 304 #elif defined(__OS2__) 315 STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD,
322 static void AskExitToGameMenuCallback(
Window *w,
bool confirmed)
330 void AskExitToGameMenu()
333 STR_ABANDON_GAME_CAPTION,
334 (_game_mode != GM_EDITOR) ? STR_ABANDON_GAME_QUERY : STR_ABANDON_SCENARIO_QUERY,
336 AskExitToGameMenuCallback
Functions related to OTTD's strings.
ResizeInfo resize
Resize information.
Window(WindowDesc *desc)
Empty constructor, initialization has been moved to InitNested() called from the constructor of the d...
byte landscape
the landscape we're currently in
void SetWidgetLoweredState(byte widget_index, bool lowered_stat)
Sets the lowered/raised status of a widget.
High level window description.
GRFConfig * _grfconfig_newgame
First item in list of default GRF set up.
Switch to game intro menu.
static bool IsInsideMM(const T x, const uint min, const uint max)
Checks if a value is in an interval.
void StartNewGameWithoutGUI(uint seed)
Start a normal game without the GUI.
GUIs related to networking.
Window for configuring the AIs
virtual void DrawWidget(const Rect &r, int widget) const
Draw the contents of a nested widget.
uint _missing_extra_graphics
Number of sprites provided by the fallback extra GRF, i.e. missing in the baseset.
virtual void OnClick(Point pt, int widget, int click_count)
A click with the left mouse button has been made on the window.
const LanguageMetadata * _current_language
The currently loaded language.
void ShowNetworkContentListWindow(ContentVector *cv=NULL, ContentType type1=CONTENT_TYPE_END, ContentType type2=CONTENT_TYPE_END)
Show the content list window with a given set of content.
static const uint GENERATE_NEW_SEED
Create a new random seed.
int GetStringHeight(const char *str, int maxw, FontSize fontsize)
Calculates height of string (in pixels).
void ShowAIConfigWindow()
Open the AI config window.
Functions related to world/map generation.
Stuff related to the text buffer GUI.
void CreateNestedTree(bool fill_nested=true)
Perform the first part of the initialization of a nested widget tree.
Functions, definitions and such used only by the GUI.
bool _network_available
is network mode available?
Data structure for an opened window.
bool _ctrl_pressed
Is Ctrl pressed?
void FinishInitNested(WindowNumber window_number=0)
Perform the second part of the initialization of a nested widget tree.
void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel wl, int x=0, int y=0, const GRFFile *textref_stack_grffile=NULL, uint textref_stack_size=0, const uint32 *textref_stack=NULL)
Display an error message in a window.
bool _is_network_server
Does this client wants to be a network-server?
Functions related to errors.
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
Show a modal confirmation window with standard 'yes' and 'no' buttons The window is aligned to the ce...
#define FONT_HEIGHT_NORMAL
Height of characters in the normal (FS_NORMAL) font.
Functions related to the gfx engine.
ClientSettings _settings_client
The current settings for this game.
Definition of base types and functions in a cross-platform compatible way.
Center both horizontally and vertically.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_newgame
Game settings for new games (updated from the intro screen).
Information about languages and their files.
void ShowGenerateLandscape()
Start with a normal game.
Basic functions/variables used all over the place.
Part of the network protocol handling content distribution.
void StartScenarioEditor()
Start with a scenario editor.
#define lengthof(x)
Return the length of an fixed size array.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
Update size and resize step of a widget in the window.
void ShowHighscoreTable(int difficulty=SP_CUSTOM, int8 rank=-1)
Show the highscore table for a given difficulty.
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
Return the string dimension in pixels.
Select game window; Window numbers:
virtual void OnInit()
Notification that the nested widget tree gets initialized.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
No window, redirects to WC_MAIN_WINDOW.
void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config)
Setup the NewGRF gui.
Declaration of functions and types defined in highscore.h and highscore_gui.h.
GUISettings gui
settings related to the GUI
byte missing_strings_threshold
the number of missing strings before showing the warning
void ClearErrorMessages()
Clear all errors from the queue.
Declarations for savegames operations.
Types related to the landscape.
void ShowSaveLoadDialog(AbstractFileType abstract_filetype, SaveLoadOperation fop)
Launch save/load dialog in the given mode.
virtual void OnInvalidateData(int data=0, bool gui_scope=true)
Some data on this window has become invalid.
SwitchMode _switch_mode
The next mainloop command.
Coordinates of a point in 2D.
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
void ShowGameSettings()
Open advanced settings window.
declaration of OTTD revision dependent variables
GameCreationSettings game_creation
settings used during the creation of a game (map)
Specification of a rectangle with absolute coordinates of all edges.
void ShowGameOptions()
Open the game options window.
void SetNewLandscapeType(byte landscape)
Changes landscape type and sets genworld window dirty.
GUI functions that shouldn't be here.
Errors (eg. saving/loading failed)
Dimensions (a width and height) of a rectangle in 2D.
This file contains all sprite-related enums and defines.
int height
Height of the window (number of pixels down in y direction)
int DrawStringMultiLine(int left, int right, int top, int bottom, const char *str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly over multiple lines.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.