Merge branch 'master' into enhanced_viewport_overlay
Notes on conflict resolution: * MarkTileDirtyByTile gained an extra param on both sides of the merge Move bridge level offset to be after zoom level param, as it's used less. * Add zoom level params to MarkBridgeDirty functions * Fix undefined behaviour in colour_index cycling in ViewportMapDraw Conflicts: src/clear_cmd.cpp src/pbs.cpp src/rail_cmd.cpp src/toolbar_gui.cpp src/train_cmd.cpp src/vehicle.cpp src/viewport.cpp src/viewport_func.h
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "../querystring_gui.h"
|
||||
#include "../town.h"
|
||||
#include "../window_func.h"
|
||||
#include "../toolbar_gui.h"
|
||||
#include "../core/geometry_func.hpp"
|
||||
#include "network.h"
|
||||
#include "network_client.h"
|
||||
@@ -120,7 +121,7 @@ void NetworkInitChatMessage()
|
||||
|
||||
_chatmsg_list = ReallocT(_chatmsg_list, _settings_client.gui.network_chat_box_height);
|
||||
_chatmsg_box.x = 10;
|
||||
_chatmsg_box.width = _settings_client.gui.network_chat_box_width;
|
||||
_chatmsg_box.width = _settings_client.gui.network_chat_box_width_pct * _screen.width / 100;
|
||||
NetworkReInitChatBoxSize();
|
||||
_chatmessage_visible = false;
|
||||
|
||||
@@ -321,6 +322,11 @@ struct NetworkChatWindow : public Window {
|
||||
InvalidateWindowData(WC_NEWS_WINDOW, 0, 0);
|
||||
}
|
||||
|
||||
virtual void FindWindowPlacementAndResize(int def_width, int def_height)
|
||||
{
|
||||
Window::FindWindowPlacementAndResize(_toolbar_width, def_height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the next item of the list of things that can be auto-completed.
|
||||
* @param item The current indexed item to return. This function can, and most
|
||||
@@ -536,7 +542,7 @@ static const NWidgetPart _nested_chat_window_widgets[] = {
|
||||
|
||||
/** The description of the chat window. */
|
||||
static WindowDesc _chat_window_desc(
|
||||
WDP_MANUAL, NULL, 640, 14, // x, y, width, height
|
||||
WDP_MANUAL, NULL, 0, 0,
|
||||
WC_SEND_NETWORK_MSG, WC_NONE,
|
||||
0,
|
||||
_nested_chat_window_widgets, lengthof(_nested_chat_window_widgets)
|
||||
|
||||
@@ -304,6 +304,8 @@ class NetworkContentListWindow : public Window, ContentCallback {
|
||||
uint filesize_sum; ///< The sum of all selected file sizes
|
||||
Scrollbar *vscroll; ///< Cache of the vertical scrollbar
|
||||
|
||||
static char content_type_strs[CONTENT_TYPE_END][64]; ///< Cached strings for all content types.
|
||||
|
||||
/** Search external websites for content */
|
||||
void OpenExternalSearch()
|
||||
{
|
||||
@@ -401,11 +403,7 @@ class NetworkContentListWindow : public Window, ContentCallback {
|
||||
{
|
||||
int r = 0;
|
||||
if ((*a)->type != (*b)->type) {
|
||||
char a_str[64];
|
||||
char b_str[64];
|
||||
GetString(a_str, STR_CONTENT_TYPE_BASE_GRAPHICS + (*a)->type - CONTENT_TYPE_BASE_GRAPHICS, lastof(a_str));
|
||||
GetString(b_str, STR_CONTENT_TYPE_BASE_GRAPHICS + (*b)->type - CONTENT_TYPE_BASE_GRAPHICS, lastof(b_str));
|
||||
r = strnatcmp(a_str, b_str);
|
||||
r = strnatcmp(content_type_strs[(*a)->type], content_type_strs[(*b)->type]);
|
||||
}
|
||||
if (r == 0) r = NameSorter(a, b);
|
||||
return r;
|
||||
@@ -469,6 +467,7 @@ class NetworkContentListWindow : public Window, ContentCallback {
|
||||
this->vscroll->ScrollTowards(this->list_pos);
|
||||
}
|
||||
|
||||
friend void BuildContentTypeStringList();
|
||||
public:
|
||||
/**
|
||||
* Create the content list window.
|
||||
@@ -968,6 +967,18 @@ NetworkContentListWindow::GUIContentList::FilterFunction * const NetworkContentL
|
||||
&TagNameFilter,
|
||||
};
|
||||
|
||||
char NetworkContentListWindow::content_type_strs[CONTENT_TYPE_END][64];
|
||||
|
||||
/**
|
||||
* Build array of all strings corresponding to the content types.
|
||||
*/
|
||||
void BuildContentTypeStringList()
|
||||
{
|
||||
for (int i = CONTENT_TYPE_BEGIN; i < CONTENT_TYPE_END; i++) {
|
||||
GetString(NetworkContentListWindow::content_type_strs[i], STR_CONTENT_TYPE_BASE_GRAPHICS + i - CONTENT_TYPE_BASE_GRAPHICS, lastof(NetworkContentListWindow::content_type_strs[i]));
|
||||
}
|
||||
}
|
||||
|
||||
/** The widgets for the content list. */
|
||||
static const NWidgetPart _nested_network_content_list_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
|
||||
@@ -43,4 +43,6 @@ public:
|
||||
virtual void OnDownloadProgress(const ContentInfo *ci, int bytes);
|
||||
};
|
||||
|
||||
void BuildContentTypeStringList();
|
||||
|
||||
#endif /* NETWORK_CONTENT_GUI_H */
|
||||
|
||||
@@ -2200,7 +2200,7 @@ static const NWidgetPart _nested_network_company_password_window_widgets[] = {
|
||||
NWidget(NWID_VERTICAL), SetPIP(5, 5, 5),
|
||||
NWidget(NWID_HORIZONTAL), SetPIP(5, 5, 5),
|
||||
NWidget(WWT_TEXT, COLOUR_GREY, WID_NCP_LABEL), SetDataTip(STR_COMPANY_VIEW_PASSWORD, STR_NULL),
|
||||
NWidget(WWT_EDITBOX, COLOUR_GREY, WID_NCP_PASSWORD), SetMinimalSize(194, 12), SetDataTip(STR_COMPANY_VIEW_SET_PASSWORD, STR_NULL),
|
||||
NWidget(WWT_EDITBOX, COLOUR_GREY, WID_NCP_PASSWORD), SetFill(1, 0), SetMinimalSize(194, 12), SetDataTip(STR_COMPANY_VIEW_SET_PASSWORD, STR_NULL),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL), SetPIP(5, 0, 5),
|
||||
NWidget(NWID_SPACER), SetFill(1, 0),
|
||||
|
||||
Reference in New Issue
Block a user