Data Structures | Functions | Variables

# bootstrap_gui.cpp File Reference

Barely used user interface for bootstrapping OpenTTD, i.e. More...

`#include "stdafx.h"`
`#include "base_media_base.h"`
`#include "blitter/factory.hpp"`
`#include "core/geometry_func.hpp"`
`#include "fontcache.h"`
`#include "gfx_func.h"`
`#include "network/network.h"`
`#include "network/network_content_gui.h"`
`#include "openttd.h"`
`#include "strings_func.h"`
`#include "video/video_driver.hpp"`
`#include "window_func.h"`
`#include "widgets/bootstrap_widget.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Data Structures
class | BootstrapBackground
| The background for the game. More...
struct | BootstrapContentDownloadStatusWindow
| Window for showing the download status of content. More...
class | BootstrapAskForDownloadWindow
| The window for the query. More...
## Functions
bool | HandleBootstrap ()
| Handle all procedures for bootstrapping OpenTTD without a base graphics set.
## Variables
static struct NWidgetPart | _background_widgets []
| Widgets for the background window to prevent smearing.
static WindowDesc | _background_desc (WDP_MANUAL, NULL, 0, 0, WC_BOOTSTRAP, WC_NONE, 0, _background_widgets, lengthof(_background_widgets))
| Window description for the background window to prevent smearing.
static const NWidgetPart | _nested_boostrap_download_status_window_widgets []
| Nested widgets for the download window.
static WindowDesc | _bootstrap_download_status_window_desc (WDP_CENTER, NULL, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_boostrap_download_status_window_widgets, lengthof(_nested_boostrap_download_status_window_widgets))
| Window description for the download window.
static const NWidgetPart | _bootstrap_query_widgets []
| The widgets for the query.
static WindowDesc | _bootstrap_query_desc (WDP_CENTER, NULL, 0, 0, WC_CONFIRM_POPUP_QUERY, WC_NONE, 0, _bootstrap_query_widgets, lengthof(_bootstrap_query_widgets))
| The window description for the query.

## Detailed Description

Barely used user interface for bootstrapping OpenTTD, i.e.

downloading the required content.

Definition in file bootstrap_gui.cpp.

## Function Documentation

bool HandleBootstrap | ( |  | ) |

Handle all procedures for bootstrapping OpenTTD without a base graphics set.

This requires all kinds of trickery that is needed to avoid the use of sprites from the base graphics set which are pretty interwoven.

Returns:
  True if a base set exists, otherwise false.

Definition at line 213 of file bootstrap_gui.cpp.

References _colour_gradient, _network_available, _video_driver, CheckForMissingGlyphs(), BlitterFactory::GetCurrentBlitter(), BaseMedia< GraphicsSet >::GetUsedSet(), InitializeUnicodeGlyphMap(), VideoDriver::MainLoop(), BaseMedia< GraphicsSet >::SetSet(), and usererror().

Referenced by openttd_main().

## Variable Documentation

struct NWidgetPart _background_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_PANEL, COLOUR_DARK_BLUE, WID_BB_BACKGROUND), SetResize(1, 1),
    }

Widgets for the background window to prevent smearing.

Definition at line 33 of file bootstrap_gui.cpp.

WindowDesc _bootstrap_query_desc(WDP_CENTER, NULL, 0, 0, WC_CONFIRM_POPUP_QUERY, WC_NONE, 0, _bootstrap_query_widgets, lengthof(_bootstrap_query_widgets))`[static]`

The window description for the query.

const NWidgetPart _bootstrap_query_widgets[]`[static]`

Initial value:

     {
      NWidget(NWID_HORIZONTAL),
        NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_MISSING_GRAPHICS_SET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
      EndContainer(),
      NWidget(WWT_PANEL, COLOUR_GREY),
        NWidget(WWT_PANEL, COLOUR_GREY, WID_BAFD_QUESTION), EndContainer(),
        NWidget(NWID_HORIZONTAL),
          NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_YES), SetDataTip(STR_MISSING_GRAPHICS_YES_DOWNLOAD, STR_NULL),
          NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_NO), SetDataTip(STR_MISSING_GRAPHICS_NO_QUIT, STR_NULL),
        EndContainer(),
      EndContainer(),
    }

The widgets for the query.

It has no close box as that sprite does not exist yet.

Definition at line 104 of file bootstrap_gui.cpp.

const NWidgetPart _nested_boostrap_download_status_window_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
      NWidget(WWT_PANEL, COLOUR_GREY, WID_NCDS_BACKGROUND),
        NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30),
      EndContainer(),
    }

Nested widgets for the download window.

Definition at line 65 of file bootstrap_gui.cpp.