Merge branch 'master' into jgrpp
# Conflicts: # Makefile.src.in # findversion.sh # projects/determineversion.vbs # src/aircraft_cmd.cpp # src/lang/dutch.txt # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraph_gui.h # src/order_cmd.cpp # src/settings_gui.cpp # src/smallmap_gui.cpp # src/town_cmd.cpp # src/viewport.cpp # src/water_map.h
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "textfile_gui.h"
|
||||
#include "stringfilter_type.h"
|
||||
#include "querystring_gui.h"
|
||||
#include "fontcache.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -64,6 +65,13 @@ static const StringID _gui_zoom_dropdown[] = {
|
||||
INVALID_STRING_ID,
|
||||
};
|
||||
|
||||
static const StringID _font_zoom_dropdown[] = {
|
||||
STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL,
|
||||
STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM,
|
||||
STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM,
|
||||
INVALID_STRING_ID,
|
||||
};
|
||||
|
||||
int _nb_orig_names = SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START + 1; ///< Number of original town names.
|
||||
static StringID *_grf_names = NULL; ///< Pointer to town names defined by NewGRFs.
|
||||
static int _nb_grf_names = 0; ///< Number of town names defined by NewGRFs.
|
||||
@@ -302,6 +310,16 @@ struct GameOptionsWindow : Window {
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_GO_FONT_ZOOM_DROPDOWN: {
|
||||
list = new DropDownList();
|
||||
*selected_index = ZOOM_LVL_OUT_4X - _font_zoom;
|
||||
const StringID *items = _font_zoom_dropdown;
|
||||
for (int i = 0; *items != INVALID_STRING_ID; items++, i++) {
|
||||
*list->Append() = new DropDownListStringItem(*items, i, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_GO_BASE_GRF_DROPDOWN:
|
||||
list = BuildSetDropDownList<BaseGraphics>(selected_index, (_game_mode == GM_MENU));
|
||||
break;
|
||||
@@ -331,6 +349,7 @@ struct GameOptionsWindow : Window {
|
||||
case WID_GO_LANG_DROPDOWN: SetDParamStr(0, _current_language->own_name); break;
|
||||
case WID_GO_RESOLUTION_DROPDOWN: SetDParam(0, GetCurRes() == _num_resolutions ? STR_GAME_OPTIONS_RESOLUTION_OTHER : SPECSTR_RESOLUTION_START + GetCurRes()); break;
|
||||
case WID_GO_GUI_ZOOM_DROPDOWN: SetDParam(0, _gui_zoom_dropdown[ZOOM_LVL_OUT_4X - _gui_zoom]); break;
|
||||
case WID_GO_FONT_ZOOM_DROPDOWN: SetDParam(0, _font_zoom_dropdown[ZOOM_LVL_OUT_4X - _font_zoom]); break;
|
||||
case WID_GO_BASE_GRF_DROPDOWN: SetDParamStr(0, BaseGraphics::GetUsedSet()->name); break;
|
||||
case WID_GO_BASE_GRF_STATUS: SetDParam(0, BaseGraphics::GetUsedSet()->GetNumInvalid()); break;
|
||||
case WID_GO_BASE_SFX_DROPDOWN: SetDParamStr(0, BaseSounds::GetUsedSet()->name); break;
|
||||
@@ -534,10 +553,18 @@ struct GameOptionsWindow : Window {
|
||||
break;
|
||||
|
||||
case WID_GO_GUI_ZOOM_DROPDOWN:
|
||||
extern void UpdateFontHeightCache();
|
||||
GfxClearSpriteCache();
|
||||
_gui_zoom = (ZoomLevel)(ZOOM_LVL_OUT_4X - index);
|
||||
UpdateCursorSize();
|
||||
UpdateAllVirtCoords();
|
||||
ReInitAllWindows();
|
||||
break;
|
||||
|
||||
case WID_GO_FONT_ZOOM_DROPDOWN:
|
||||
extern void UpdateFontHeightCache();
|
||||
GfxClearSpriteCache();
|
||||
_font_zoom = (ZoomLevel)(ZOOM_LVL_OUT_4X - index);
|
||||
ClearFontCache();
|
||||
UpdateFontHeightCache();
|
||||
LoadStringWidthTable();
|
||||
UpdateAllVirtCoords();
|
||||
@@ -618,6 +645,9 @@ static const NWidgetPart _nested_game_options_widgets[] = {
|
||||
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_CURRENCY_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(NWID_SPACER), SetMinimalSize(0, 0), SetFill(0, 1),
|
||||
NWidget(WWT_FRAME, COLOUR_GREY), SetDataTip(STR_GAME_OPTIONS_FONT_ZOOM, STR_NULL),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_GO_FONT_ZOOM_DROPDOWN), SetMinimalSize(150, 12), SetDataTip(STR_BLACK_STRING, STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
EndContainer(),
|
||||
|
||||
|
Reference in New Issue
Block a user