(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
This commit is contained in:
@@ -296,7 +296,7 @@ struct NetworkChatWindow : public Window {
|
||||
* @param type The type of destination.
|
||||
* @param dest The actual destination index.
|
||||
*/
|
||||
NetworkChatWindow(const WindowDesc *desc, DestType type, int dest) : message_editbox(NETWORK_CHAT_LENGTH)
|
||||
NetworkChatWindow(WindowDesc *desc, DestType type, int dest) : Window(desc), message_editbox(NETWORK_CHAT_LENGTH)
|
||||
{
|
||||
this->dtype = type;
|
||||
this->dest = dest;
|
||||
@@ -312,7 +312,7 @@ struct NetworkChatWindow : public Window {
|
||||
assert((uint)this->dtype < lengthof(chat_captions));
|
||||
this->dest_string = chat_captions[this->dtype];
|
||||
|
||||
this->InitNested(desc, type);
|
||||
this->InitNested(type);
|
||||
|
||||
this->SetFocusedWidget(WID_NC_TEXTBOX);
|
||||
InvalidateWindowData(WC_NEWS_WINDOW, 0, this->height);
|
||||
@@ -459,7 +459,7 @@ struct NetworkChatWindow : public Window {
|
||||
free(pre_buf);
|
||||
}
|
||||
|
||||
virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
|
||||
virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
|
||||
{
|
||||
Point pt = { 0, _screen.height - sm_height - FindWindowById(WC_STATUS_BAR, 0)->height };
|
||||
return pt;
|
||||
@@ -540,7 +540,7 @@ static const NWidgetPart _nested_chat_window_widgets[] = {
|
||||
};
|
||||
|
||||
/** The description of the chat window. */
|
||||
static const WindowDesc _chat_window_desc(
|
||||
static WindowDesc _chat_window_desc(
|
||||
WDP_MANUAL, 640, 14, // x, y, width, height
|
||||
WC_SEND_NETWORK_MSG, WC_NONE,
|
||||
0,
|
||||
|
Reference in New Issue
Block a user