Merge branch upstream/master while introducing compile errors and reverting parts of Android changes, video BPP options are gone
This commit is contained in:
@@ -65,7 +65,7 @@ StringID DropDownListParamStringItem::String() const
|
||||
|
||||
StringID DropDownListCharStringItem::String() const
|
||||
{
|
||||
SetDParamStr(0, this->raw_string.c_str());
|
||||
SetDParamStr(0, this->raw_string);
|
||||
return this->string;
|
||||
}
|
||||
|
||||
@@ -197,12 +197,11 @@ struct DropdownWindow : Window {
|
||||
this->left_button_state = _left_button_down;
|
||||
}
|
||||
|
||||
~DropdownWindow()
|
||||
void Close() override
|
||||
{
|
||||
/* Make the dropdown "invisible", so it doesn't affect new window placement.
|
||||
/* Finish closing the dropdown, so it doesn't affect new window placement.
|
||||
* Also mark it dirty in case the callback deals with the screen. (e.g. screenshots). */
|
||||
this->window_class = WC_INVALID;
|
||||
this->SetDirty();
|
||||
this->Window::Close();
|
||||
|
||||
Window *w2 = FindWindowById(this->parent_wnd_class, this->parent_wnd_num);
|
||||
if (w2 != nullptr) {
|
||||
@@ -213,7 +212,7 @@ struct DropdownWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
|
||||
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
|
||||
{
|
||||
return this->position;
|
||||
}
|
||||
@@ -250,7 +249,7 @@ struct DropdownWindow : Window {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void DrawWidget(const Rect &r, int widget) const
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
{
|
||||
if (widget != WID_DM_ITEMS) return;
|
||||
|
||||
@@ -278,7 +277,7 @@ struct DropdownWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnClick(Point pt, int widget, int click_count)
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
{
|
||||
if (this->left_button_scrolling) return;
|
||||
if (widget != WID_DM_ITEMS) return;
|
||||
@@ -290,7 +289,7 @@ struct DropdownWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnRealtimeTick(uint delta_ms)
|
||||
void OnRealtimeTick(uint delta_ms) override
|
||||
{
|
||||
if (!this->scrolling_timer.Elapsed(delta_ms)) return;
|
||||
this->scrolling_timer.SetInterval(MILLISECONDS_PER_TICK);
|
||||
@@ -307,22 +306,19 @@ struct DropdownWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void OnMouseLoop()
|
||||
void OnMouseLoop() override
|
||||
{
|
||||
Window *w2 = FindWindowById(this->parent_wnd_class, this->parent_wnd_num);
|
||||
if (w2 == nullptr) {
|
||||
delete this;
|
||||
this->Close();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->click_delay != 0 && --this->click_delay == 0) {
|
||||
/* Make the dropdown "invisible", so it doesn't affect new window placement.
|
||||
/* Close the dropdown, so it doesn't affect new window placement.
|
||||
* Also mark it dirty in case the callback deals with the screen. (e.g. screenshots). */
|
||||
this->window_class = WC_INVALID;
|
||||
this->SetDirty();
|
||||
|
||||
this->Close();
|
||||
w2->OnDropdownSelect(this->parent_button, this->selected_index);
|
||||
delete this;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -332,7 +328,7 @@ struct DropdownWindow : Window {
|
||||
if (!_left_button_clicked) {
|
||||
this->drag_mode = false;
|
||||
if (!this->GetDropDownItem(item)) {
|
||||
if (this->instant_close) delete this;
|
||||
if (this->instant_close) this->Close();
|
||||
return;
|
||||
}
|
||||
this->click_delay = 2;
|
||||
@@ -412,7 +408,7 @@ struct DropdownWindow : Window {
|
||||
*/
|
||||
void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width, bool instant_close)
|
||||
{
|
||||
DeleteWindowById(WC_DROPDOWN_MENU, 0);
|
||||
CloseWindowById(WC_DROPDOWN_MENU, 0);
|
||||
|
||||
/* The preferred position is just below the dropdown calling widget */
|
||||
int top = w->top + wi_rect.bottom + 1;
|
||||
@@ -501,12 +497,8 @@ void ShowDropDownList(Window *w, DropDownList &&list, int selected, int button,
|
||||
{
|
||||
/* Our parent's button widget is used to determine where to place the drop
|
||||
* down list window. */
|
||||
Rect wi_rect;
|
||||
NWidgetCore *nwi = w->GetWidget<NWidgetCore>(button);
|
||||
wi_rect.left = nwi->pos_x;
|
||||
wi_rect.right = nwi->pos_x + nwi->current_x - 1;
|
||||
wi_rect.top = nwi->pos_y;
|
||||
wi_rect.bottom = nwi->pos_y + nwi->current_y - 1;
|
||||
Rect wi_rect = nwi->GetCurrentRect();
|
||||
Colours wi_colour = nwi->colour;
|
||||
|
||||
if ((nwi->type & WWT_MASK) == NWID_BUTTON_DROPDOWN) {
|
||||
@@ -558,7 +550,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt
|
||||
*/
|
||||
int HideDropDownMenu(Window *pw)
|
||||
{
|
||||
for (Window *w : Window::IterateFromBack()) {
|
||||
for (Window *w : Window::Iterate()) {
|
||||
if (w->window_class != WC_DROPDOWN_MENU) continue;
|
||||
|
||||
DropdownWindow *dw = dynamic_cast<DropdownWindow*>(w);
|
||||
@@ -566,7 +558,7 @@ int HideDropDownMenu(Window *pw)
|
||||
if (pw->window_class == dw->parent_wnd_class &&
|
||||
pw->window_number == dw->parent_wnd_num) {
|
||||
int parent_button = dw->parent_button;
|
||||
delete dw;
|
||||
dw->Close();
|
||||
return parent_button;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,10 +66,6 @@ enum NetworkStartServerWidgets {
|
||||
WID_NSS_COMPANIES_BTND, ///< 'Max companies' downarrow.
|
||||
WID_NSS_COMPANIES_TXT, ///< 'Max companies' text.
|
||||
WID_NSS_COMPANIES_BTNU, ///< 'Max companies' uparrow.
|
||||
WID_NSS_SPECTATORS_LABEL, ///< Label for 'max spectators'.
|
||||
WID_NSS_SPECTATORS_BTND, ///< 'Max spectators' downarrow.
|
||||
WID_NSS_SPECTATORS_TXT, ///< 'Max spectators' text.
|
||||
WID_NSS_SPECTATORS_BTNU, ///< 'Max spectators' uparrow.
|
||||
|
||||
WID_NSS_GENERATE_GAME, ///< New game button.
|
||||
WID_NSS_LOAD_GAME, ///< Load game button.
|
||||
@@ -79,21 +75,6 @@ enum NetworkStartServerWidgets {
|
||||
WID_NSS_CANCEL, ///< 'Cancel' button.
|
||||
};
|
||||
|
||||
/** Widgets of the #NetworkLobbyWindow class. */
|
||||
enum NetworkLobbyWidgets {
|
||||
WID_NL_BACKGROUND, ///< Background of the window.
|
||||
WID_NL_TEXT, ///< Heading text.
|
||||
WID_NL_HEADER, ///< Header above list of companies.
|
||||
WID_NL_MATRIX, ///< List of companies.
|
||||
WID_NL_SCROLLBAR, ///< Scroll bar.
|
||||
WID_NL_DETAILS, ///< Company details.
|
||||
WID_NL_JOIN, ///< 'Join company' button.
|
||||
WID_NL_NEW, ///< 'New company' button.
|
||||
WID_NL_SPECTATE, ///< 'Spectate game' button.
|
||||
WID_NL_REFRESH, ///< 'Refresh server' button.
|
||||
WID_NL_CANCEL, ///< 'Cancel' button.
|
||||
};
|
||||
|
||||
/** Widgets of the #NetworkClientListWindow class. */
|
||||
enum ClientListWidgets {
|
||||
WID_CL_PANEL, ///< Panel of the window.
|
||||
@@ -101,11 +82,14 @@ enum ClientListWidgets {
|
||||
WID_CL_SERVER_NAME, ///< Server name.
|
||||
WID_CL_SERVER_NAME_EDIT, ///< Edit button for server name.
|
||||
WID_CL_SERVER_VISIBILITY, ///< Server visibility.
|
||||
WID_CL_SERVER_INVITE_CODE, ///< Invite code for this server.
|
||||
WID_CL_SERVER_CONNECTION_TYPE, ///< The type of connection the Game Coordinator detected for this server.
|
||||
WID_CL_CLIENT_NAME, ///< Client name.
|
||||
WID_CL_CLIENT_NAME_EDIT, ///< Edit button for client name.
|
||||
WID_CL_MATRIX, ///< Company/client list.
|
||||
WID_CL_SCROLLBAR, ///< Scrollbar for company/client list.
|
||||
WID_CL_COMPANY_JOIN, ///< Used for QueryWindow when a company has a password.
|
||||
WID_CL_CLIENT_COMPANY_COUNT, ///< Count of clients and companies.
|
||||
};
|
||||
|
||||
/** Widgets of the #NetworkJoinStatusWindow class. */
|
||||
@@ -125,4 +109,13 @@ enum NetworkCompanyPasswordWidgets {
|
||||
WID_NCP_OK, ///< Safe the password etc.
|
||||
};
|
||||
|
||||
/** Widgets of the #NetworkAskRelayWindow class. */
|
||||
enum NetworkAskRelayWidgets {
|
||||
WID_NAR_CAPTION, ///< Caption of the window.
|
||||
WID_NAR_TEXT, ///< Text in the window.
|
||||
WID_NAR_NO, ///< "No" button.
|
||||
WID_NAR_YES_ONCE, ///< "Yes, once" button.
|
||||
WID_NAR_YES_ALWAYS, ///< "Yes, always" button.
|
||||
};
|
||||
|
||||
#endif /* WIDGETS_NETWORK_WIDGET_H */
|
||||
|
||||
@@ -79,22 +79,31 @@ enum BuildRailStationWidgets {
|
||||
|
||||
/** Widgets of the #BuildSignalWindow class. */
|
||||
enum BuildSignalWidgets {
|
||||
WID_BS_SEMAPHORE_NORM, ///< Build a semaphore normal block signal
|
||||
WID_BS_SEMAPHORE_ENTRY, ///< Build a semaphore entry block signal
|
||||
WID_BS_SEMAPHORE_EXIT, ///< Build a semaphore exit block signal
|
||||
WID_BS_SEMAPHORE_COMBO, ///< Build a semaphore combo block signal
|
||||
WID_BS_CAPTION, ///< Caption for the Signal Selection window.
|
||||
WID_BS_SEMAPHORE_NORM, ///< Build a semaphore normal block signal.
|
||||
WID_BS_SEMAPHORE_ENTRY, ///< Build a semaphore entry block signal.
|
||||
WID_BS_SEMAPHORE_EXIT, ///< Build a semaphore exit block signal.
|
||||
WID_BS_SEMAPHORE_COMBO, ///< Build a semaphore combo block signal.
|
||||
WID_BS_SEMAPHORE_PBS, ///< Build a semaphore path signal.
|
||||
WID_BS_SEMAPHORE_PBS_OWAY, ///< Build a semaphore one way path signal.
|
||||
WID_BS_ELECTRIC_NORM, ///< Build an electric normal block signal
|
||||
WID_BS_ELECTRIC_ENTRY, ///< Build an electric entry block signal
|
||||
WID_BS_ELECTRIC_EXIT, ///< Build an electric exit block signal
|
||||
WID_BS_ELECTRIC_COMBO, ///< Build an electric combo block signal
|
||||
WID_BS_ELECTRIC_NORM, ///< Build an electric normal block signal.
|
||||
WID_BS_ELECTRIC_ENTRY, ///< Build an electric entry block signal.
|
||||
WID_BS_ELECTRIC_EXIT, ///< Build an electric exit block signal.
|
||||
WID_BS_ELECTRIC_COMBO, ///< Build an electric combo block signal.
|
||||
WID_BS_ELECTRIC_PBS, ///< Build an electric path signal.
|
||||
WID_BS_ELECTRIC_PBS_OWAY, ///< Build an electric one way path signal.
|
||||
WID_BS_CONVERT, ///< Convert the signal.
|
||||
WID_BS_DRAG_SIGNALS_DENSITY_LABEL, ///< The current signal density.
|
||||
WID_BS_DRAG_SIGNALS_DENSITY_DECREASE, ///< Decrease the signal density.
|
||||
WID_BS_DRAG_SIGNALS_DENSITY_INCREASE, ///< Increase the signal density.
|
||||
WID_BS_SEMAPHORE_NORM_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_NORM.
|
||||
WID_BS_ELECTRIC_NORM_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_NORM.
|
||||
WID_BS_SEMAPHORE_ENTRY_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_ENTRY.
|
||||
WID_BS_ELECTRIC_ENTRY_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_ENTRY.
|
||||
WID_BS_SEMAPHORE_EXIT_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_EXIT.
|
||||
WID_BS_ELECTRIC_EXIT_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_EXIT.
|
||||
WID_BS_SEMAPHORE_COMBO_SEL, ///< NWID_SELECTION for WID_BS_SEMAPHORE_COMBO.
|
||||
WID_BS_ELECTRIC_COMBO_SEL, ///< NWID_SELECTION for WID_BS_ELECTRIC_COMBO.
|
||||
};
|
||||
|
||||
/** Widgets of the #BuildRailDepotWindow class. */
|
||||
|
||||
@@ -19,9 +19,6 @@ enum GameOptionsWidgets {
|
||||
WID_GO_LANG_DROPDOWN, ///< Language dropdown.
|
||||
WID_GO_RESOLUTION_DROPDOWN, ///< Dropdown for the resolution.
|
||||
WID_GO_FULLSCREEN_BUTTON, ///< Toggle fullscreen.
|
||||
WID_GO_8BPP_BUTTON, ///< 8 bits per pixel video mode
|
||||
WID_GO_16BPP_BUTTON, ///< 16 bits per pixel video mode
|
||||
WID_GO_32BPP_BUTTON, ///< 32 bits per pixel video mode
|
||||
WID_GO_BUTTON_SIZE_DROPDOWN, ///< Size of in-game UI elements, such as buttons.
|
||||
WID_GO_TEXT_SIZE_DROPDOWN, ///< Size of medium font, sizes of other fonts are derived from it.
|
||||
WID_GO_VERTICAL_TOOLBAR, ///< Enable vertical toolbar.
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const int SLIDER_WIDTH = 3;
|
||||
|
||||
/**
|
||||
* Draw a volume slider widget with know at given value
|
||||
@@ -24,8 +25,6 @@
|
||||
*/
|
||||
void DrawVolumeSliderWidget(Rect r, byte value)
|
||||
{
|
||||
static const int slider_width = 3;
|
||||
|
||||
/* Draw a wedge indicating low to high volume level. */
|
||||
const int ha = (r.bottom - r.top) / 5;
|
||||
int wx1 = r.left, wx2 = r.right;
|
||||
@@ -40,7 +39,7 @@ void DrawVolumeSliderWidget(Rect r, byte value)
|
||||
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow);
|
||||
|
||||
/* Draw a slider handle indicating current volume level. */
|
||||
const int sw = ScaleGUITrad(slider_width);
|
||||
const int sw = ScaleGUITrad(SLIDER_WIDTH);
|
||||
if (_current_text_dir == TD_RTL) value = 127 - value;
|
||||
const int x = r.left + (value * (r.right - r.left - sw) / 127);
|
||||
DrawFrameRect(x, r.top, x + sw, r.bottom, COLOUR_GREY, FR_NONE);
|
||||
@@ -55,12 +54,10 @@ void DrawVolumeSliderWidget(Rect r, byte value)
|
||||
*/
|
||||
bool ClickVolumeSliderWidget(Rect r, Point pt, byte &value)
|
||||
{
|
||||
byte new_vol = Clamp((pt.x - r.left) * 127 / (r.right - r.left), 0, 127);
|
||||
const int sw = ScaleGUITrad(SLIDER_WIDTH);
|
||||
byte new_vol = Clamp((pt.x - r.left - sw / 2) * 127 / (r.right - r.left - sw), 0, 127);
|
||||
if (_current_text_dir == TD_RTL) new_vol = 127 - new_vol;
|
||||
|
||||
/* Clamp to make sure min and max are properly settable */
|
||||
if (new_vol > 124) new_vol = 127;
|
||||
if (new_vol < 3) new_vol = 0;
|
||||
if (new_vol != value) {
|
||||
value = new_vol;
|
||||
return true;
|
||||
|
||||
@@ -61,7 +61,10 @@ enum VehicleDetailsWidgets {
|
||||
|
||||
/** Widgets of the #VehicleListWindow class. */
|
||||
enum VehicleListWidgets {
|
||||
WID_VL_CAPTION, ///< Caption of window.
|
||||
WID_VL_CAPTION, ///< Caption of window (for non shared orders windows).
|
||||
WID_VL_CAPTION_SHARED_ORDERS, ///< Caption of window (for shared orders windows).
|
||||
WID_VL_CAPTION_SELECTION, ///< Selection for caption.
|
||||
WID_VL_ORDER_VIEW, ///< Button to open order window (for shared orders windows).
|
||||
WID_VL_GROUP_ORDER, ///< Group order.
|
||||
WID_VL_GROUP_BY_PULLDOWN, ///< Group by dropdown list.
|
||||
WID_VL_SORT_ORDER, ///< Sort order.
|
||||
|
||||
Reference in New Issue
Block a user