|
@@ -76,30 +76,30 @@ enum DynamicPlaceIndustriesWidgets {
|
|
|
static const Widget _build_industry_widgets[] = {
|
|
|
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_DARK_GREEN, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // DPIW_CLOSEBOX
|
|
|
{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_DARK_GREEN, 11, 169, 0, 13, STR_0314_FUND_NEW_INDUSTRY, STR_018C_WINDOW_TITLE_DRAG_THIS}, // DPIW_CAPTION
|
|
|
{ WWT_MATRIX, RESIZE_RB, COLOUR_DARK_GREEN, 0, 157, 14, 118, 0x801, STR_INDUSTRY_SELECTION_HINT}, // DPIW_MATRIX_WIDGET
|
|
|
{ WWT_SCROLLBAR, RESIZE_LRB, COLOUR_DARK_GREEN, 158, 169, 14, 118, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // DPIW_SCROLLBAR
|
|
|
{ WWT_PANEL, RESIZE_RTB, COLOUR_DARK_GREEN, 0, 169, 119, 199, 0x0, STR_NULL}, // DPIW_INFOPANEL
|
|
|
{ WWT_TEXTBTN, RESIZE_RTB, COLOUR_DARK_GREEN, 0, 157, 200, 211, STR_FUND_NEW_INDUSTRY, STR_NULL}, // DPIW_FUND_WIDGET
|
|
|
{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_DARK_GREEN, 158, 169, 200, 211, 0x0, STR_RESIZE_BUTTON}, // DPIW_RESIZE_WIDGET
|
|
|
{ WIDGETS_END},
|
|
|
};
|
|
|
|
|
|
/** Window definition of the dynamic place industries gui */
|
|
|
static const WindowDesc _build_industry_desc = {
|
|
|
static const WindowDesc _build_industry_desc(
|
|
|
WDP_AUTO, WDP_AUTO, 170, 212, 170, 212,
|
|
|
WC_BUILD_INDUSTRY, WC_NONE,
|
|
|
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE | WDF_CONSTRUCTION,
|
|
|
_build_industry_widgets,
|
|
|
};
|
|
|
_build_industry_widgets
|
|
|
);
|
|
|
|
|
|
class BuildIndustryWindow : public Window {
|
|
|
int selected_index; ///< index of the element in the matrix
|
|
|
IndustryType selected_type; ///< industry corresponding to the above index
|
|
|
uint16 callback_timer; ///< timer counter for callback eventual verification
|
|
|
bool timer_enabled; ///< timer can be used
|
|
|
uint16 count; ///< How many industries are loaded
|
|
|
IndustryType index[NUM_INDUSTRYTYPES + 1]; ///< Type of industry, in the order it was loaded
|
|
|
StringID text[NUM_INDUSTRYTYPES + 1]; ///< Text coming from CBM_IND_FUND_MORE_TEXT (if ever)
|
|
|
bool enabled[NUM_INDUSTRYTYPES + 1]; ///< availability state, coming from CBID_INDUSTRY_AVAILABLE (if ever)
|
|
|
|
|
|
void SetupArrays()
|
|
@@ -664,30 +664,30 @@ static const Widget _industry_view_widge
|
|
|
{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_CREAM, 11, 247, 0, 13, STR_4801, STR_018C_WINDOW_TITLE_DRAG_THIS}, // IVW_CAPTION
|
|
|
{ WWT_STICKYBOX, RESIZE_LR, COLOUR_CREAM, 248, 259, 0, 13, 0x0, STR_STICKY_BUTTON}, // IVW_STICKY
|
|
|
{ WWT_PANEL, RESIZE_RB, COLOUR_CREAM, 0, 259, 14, 105, 0x0, STR_NULL}, // IVW_BACKGROUND
|
|
|
{ WWT_INSET, RESIZE_RB, COLOUR_CREAM, 2, 257, 16, 103, 0x0, STR_NULL}, // IVW_VIEWPORT
|
|
|
{ WWT_PANEL, RESIZE_RTB, COLOUR_CREAM, 0, 259, 106, 107, 0x0, STR_NULL}, // IVW_INFO
|
|
|
{ WWT_PUSHTXTBTN, RESIZE_TB, COLOUR_CREAM, 0, 129, 108, 119, STR_00E4_LOCATION, STR_482C_CENTER_THE_MAIN_VIEW_ON}, // IVW_GOTO
|
|
|
{ WWT_PANEL, RESIZE_RTB, COLOUR_CREAM, 130, 247, 108, 119, 0x0, STR_NULL}, // IVW_SPACER
|
|
|
{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_CREAM, 248, 259, 108, 119, 0x0, STR_RESIZE_BUTTON}, // IVW_RESIZE
|
|
|
{ WIDGETS_END},
|
|
|
};
|
|
|
|
|
|
/** Window definition of the view industy gui */
|
|
|
static const WindowDesc _industry_view_desc = {
|
|
|
static const WindowDesc _industry_view_desc(
|
|
|
WDP_AUTO, WDP_AUTO, 260, 120, 260, 120,
|
|
|
WC_INDUSTRY_VIEW, WC_NONE,
|
|
|
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
|
|
|
_industry_view_widgets,
|
|
|
};
|
|
|
_industry_view_widgets
|
|
|
);
|
|
|
|
|
|
void ShowIndustryViewWindow(int industry)
|
|
|
{
|
|
|
AllocateWindowDescFront<IndustryViewWindow>(&_industry_view_desc, industry);
|
|
|
}
|
|
|
|
|
|
/** Names of the widgets of the industry directory gui */
|
|
|
enum IndustryDirectoryWidgets {
|
|
|
IDW_CLOSEBOX = 0,
|
|
|
IDW_CAPTION,
|
|
|
IDW_STICKY,
|
|
|
IDW_DROPDOWN_ORDER,
|
|
@@ -976,23 +976,23 @@ GUIIndustryList::SortFunction * const In
|
|
|
|
|
|
/* Names of the sorting functions */
|
|
|
const StringID IndustryDirectoryWindow::sorter_names[] = {
|
|
|
STR_SORT_BY_DROPDOWN_NAME,
|
|
|
STR_SORT_BY_TYPE,
|
|
|
STR_SORT_BY_PRODUCTION,
|
|
|
STR_SORT_BY_TRANSPORTED,
|
|
|
INVALID_STRING_ID
|
|
|
};
|
|
|
|
|
|
|
|
|
/** Window definition of the industy directory gui */
|
|
|
static const WindowDesc _industry_directory_desc = {
|
|
|
static const WindowDesc _industry_directory_desc(
|
|
|
WDP_AUTO, WDP_AUTO, 428, 190, 428, 190,
|
|
|
WC_INDUSTRY_DIRECTORY, WC_NONE,
|
|
|
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_STICKY_BUTTON | WDF_RESIZABLE,
|
|
|
_industry_directory_widgets,
|
|
|
};
|
|
|
_industry_directory_widgets
|
|
|
);
|
|
|
|
|
|
void ShowIndustryDirectory()
|
|
|
{
|
|
|
AllocateWindowDescFront<IndustryDirectoryWindow>(&_industry_directory_desc, 0);
|
|
|
}
|