latest novapolis client for 1.5

--HG--
branch : novattd150
This commit is contained in:
Pavel Stupnikov
2015-03-16 03:20:50 +03:00
parent d201932121
commit e48d2d58e0
69 changed files with 3756 additions and 486 deletions
+4
View File
@@ -52,6 +52,10 @@ enum CompanyWidgets {
WID_C_SELECT_MULTIPLAYER, ///< Multiplayer selection panel.
WID_C_COMPANY_PASSWORD, ///< Button to set company password.
WID_C_COMPANY_JOIN, ///< Button to join company.
CW_WIDGET_COMPANY_JOIN2,
CW_WIDGET_COMPANY_RESET,
CW_WIDGET_COMPANY_SUSPEND,
CW_WIDGET_COMPANY_RESUME,
};
/** Widgets of the #CompanyFinancesWindow class. */
+6 -1
View File
@@ -42,7 +42,12 @@ void DropDownListStringItem::Draw(int left, int right, int top, int bottom, bool
{
DrawString(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, this->String(), sel ? TC_WHITE : TC_BLACK);
}
/*
const char * DropDownListCharStringItem::String() const
{
return this->string;
}
*/
/**
* Natural sorting comparator function for DropDownList::sort().
* @param first Left side of comparison.
+39
View File
@@ -16,6 +16,11 @@
#include "../gfx_func.h"
#include "../core/smallvec_type.hpp"
#include "table/strings.h"
#include "../stdafx.h"
#include "../window_gui.h"
#include "../string_func.h"
#include "../strings_func.h"
#include "../window_func.h"
/**
* Base list item class from which others are derived. If placed in a list it
@@ -47,12 +52,46 @@ public:
virtual bool Selectable() const { return true; }
virtual uint Width() const;
//virtual const char * String() const;
virtual void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const;
virtual StringID String() const { return this->string; }
static int CDECL NatSortFunc(const DropDownListItem * const *first, const DropDownListItem * const *second);
};
/**
* Drop down list entry for showing a checked/unchecked toggle item. Use
* DropDownListCheckedItem or DropDownListCharStringCheckedItem depending of
* type of string used (either StringID or const char*).
*/
template <class T, typename S>
class DropDownListCheckedItemT : public T {
uint checkmark_width;
public:
bool checked;
DropDownListCheckedItemT<T,S>(S string, int result, bool masked, bool checked) : T(string, result, masked), checked(checked)
{
this->checkmark_width = GetStringBoundingBox(STR_JUST_CHECKMARK).width + 3;
}
virtual ~DropDownListCheckedItemT<T,S>() {}
virtual uint Width() const
{
return T::Width() + this->checkmark_width;
}
virtual void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
{
bool rtl = _current_text_dir == TD_RTL;
if (this->checked) {
DrawString(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, STR_JUST_CHECKMARK, sel ? TC_WHITE : TC_BLACK);
}
DrawString(left + WD_FRAMERECT_LEFT + (rtl ? 0 : this->checkmark_width), right - WD_FRAMERECT_RIGHT - (rtl ? this->checkmark_width : 0), top, this->String(), sel ? TC_WHITE : TC_BLACK);
}
};
#define DropDownListCheckedItem DropDownListCheckedItemT<DropDownListStringItem,StringID>
#define DropDownListCharStringCheckedItem DropDownListCheckedItemT<DropDownListCharStringItem,const char*>
/**
* String list item with parameters.
*/
+4
View File
@@ -29,6 +29,10 @@ enum CompanyValueWidgets {
WID_CV_BACKGROUND, ///< Background of the window.
WID_CV_GRAPH, ///< Graph itself.
WID_CV_RESIZE, ///< Resize button.
WID_CPR2_FOOTER, ///< Footer.
WID_CPR2_ENABLE_CARGOES, ///< Enable cargoes button.
WID_CPR2_DISABLE_CARGOES, ///< Disable cargoes button.
WID_CPR2_CARGO_FIRST, ///< First cargo in the list.
};
/** Widget of the #PerformanceHistoryGraphWindow class. */
+1
View File
@@ -34,6 +34,7 @@ enum IndustryViewWidgets {
enum IndustryDirectoryWidgets {
WID_ID_DROPDOWN_ORDER, ///< Dropdown for the order of the sort.
WID_ID_DROPDOWN_CRITERIA, ///< Dropdown for the criteria of the sort.
WID_ID_DROPDOWN_FILTER, ///< Industry filter
WID_ID_INDUSTRY_LIST, ///< Industry list.
WID_ID_SCROLLBAR, ///< Scrollbar of the list.
};
+5
View File
@@ -51,6 +51,11 @@ enum NetworkGameWidgets {
WID_NG_ADD, ///< 'Add server' button.
WID_NG_START, ///< 'Start server' button.
WID_NG_CANCEL, ///< 'Cancel' button.
WID_NG_NOVA, ///< filter nova
WID_NG_REDDIT, ///< filter reddit
WID_NG_NICE, ///< filter n-ice
WID_NG_BTPRO, ///< filter btpro
};
/** Widgets of the #NetworkStartServerWindow class. */
+6 -4
View File
@@ -21,6 +21,7 @@ enum RailToolbarWidgets {
WID_RAT_BUILD_EW, ///< Build rail along the game view X axis.
WID_RAT_BUILD_Y, ///< Build rail along the game grid Y axis.
WID_RAT_AUTORAIL, ///< Autorail tool.
WID_RAT_POLYRAIL, ///< Polyline rail tool.
WID_RAT_DEMOLISH, ///< Destroy something with dynamite!
WID_RAT_BUILD_DEPOT, ///< Build a depot.
WID_RAT_BUILD_WAYPOINT, ///< Build a waypoint.
@@ -99,10 +100,11 @@ enum BuildSignalWidgets {
/** Widgets of the #BuildRailDepotWindow class. */
enum BuildRailDepotWidgets {
/* Name starts with BRA instead of BR, because of collision with BuildRoadDepotWidgets */
WID_BRAD_DEPOT_NE, ///< Build a depot with the entrance in the north east.
WID_BRAD_DEPOT_SE, ///< Build a depot with the entrance in the south east.
WID_BRAD_DEPOT_SW, ///< Build a depot with the entrance in the south west.
WID_BRAD_DEPOT_NW, ///< Build a depot with the entrance in the north west.
WID_BRAD_DEPOT_NE, ///< Build a depot with the entrance in the north east.
WID_BRAD_DEPOT_SE, ///< Build a depot with the entrance in the south east.
WID_BRAD_DEPOT_SW, ///< Build a depot with the entrance in the south west.
WID_BRAD_DEPOT_NW, ///< Build a depot with the entrance in the north west.
WID_BRAD_DEPOT_AUTO, ///< Build a depot, autoselect entrance.
};
/** Widgets of the #BuildRailWaypointWindow class. */
+21 -17
View File
@@ -17,7 +17,8 @@ enum RoadToolbarWidgets {
/* Name starts with RO instead of R, because of collision with RailToolbarWidgets */
WID_ROT_ROAD_X, ///< Build road in x-direction.
WID_ROT_ROAD_Y, ///< Build road in y-direction.
WID_ROT_AUTOROAD, ///< Autorail.
WID_ROT_AUTOROAD, ///< Autoroad.
WID_ROT_FULLROAD, ///< Auto full road (no half-tiles).
WID_ROT_DEMOLISH, ///< Demolish.
WID_ROT_DEPOT, ///< Build depot.
WID_ROT_BUS_STATION, ///< Build bus station.
@@ -31,27 +32,30 @@ enum RoadToolbarWidgets {
/** Widgets of the #BuildRoadDepotWindow class. */
enum BuildRoadDepotWidgets {
/* Name starts with BRO instead of BR, because of collision with BuildRailDepotWidgets */
WID_BROD_CAPTION, ///< Caption of the window.
WID_BROD_DEPOT_NE, ///< Depot with NE entry.
WID_BROD_DEPOT_SE, ///< Depot with SE entry.
WID_BROD_DEPOT_SW, ///< Depot with SW entry.
WID_BROD_DEPOT_NW, ///< Depot with NW entry.
WID_BROD_CAPTION, ///< Caption of the window.
WID_BROD_DEPOT_NE, ///< Depot with NE entry.
WID_BROD_DEPOT_SE, ///< Depot with SE entry.
WID_BROD_DEPOT_SW, ///< Depot with SW entry.
WID_BROD_DEPOT_NW, ///< Depot with NW entry.
WID_BROD_DEPOT_AUTO, ///< Depot, autodetect entry.
};
/** Widgets of the #BuildRoadStationWindow class. */
enum BuildRoadStationWidgets {
/* Name starts with BRO instead of BR, because of collision with BuildRailStationWidgets */
WID_BROS_CAPTION, ///< Caption of the window.
WID_BROS_BACKGROUND, ///< Background of the window.
WID_BROS_STATION_NE, ///< Terminal station with NE entry.
WID_BROS_STATION_SE, ///< Terminal station with SE entry.
WID_BROS_STATION_SW, ///< Terminal station with SW entry.
WID_BROS_STATION_NW, ///< Terminal station with NW entry.
WID_BROS_STATION_X, ///< Drive-through station in x-direction.
WID_BROS_STATION_Y, ///< Drive-through station in y-direction.
WID_BROS_LT_OFF, ///< Turn off area highlight.
WID_BROS_LT_ON, ///< Turn on area highlight.
WID_BROS_INFO, ///< Station acceptance info.
WID_BROS_CAPTION, ///< Caption of the window.
WID_BROS_BACKGROUND, ///< Background of the window.
WID_BROS_STATION_NE, ///< Terminal station with NE entry.
WID_BROS_STATION_SE, ///< Terminal station with SE entry.
WID_BROS_STATION_SW, ///< Terminal station with SW entry.
WID_BROS_STATION_NW, ///< Terminal station with NW entry.
WID_BROS_STATION_X, ///< Drive-through station in x-direction.
WID_BROS_STATION_Y, ///< Drive-through station in y-direction.
WID_BROS_STATION_AUTO, ///< Terminal station, autoselect entry.
WID_BROS_STATION_XY_AUTO, ///< Drive-through station, autoselect direction.
WID_BROS_LT_OFF, ///< Turn off area highlight.
WID_BROS_LT_ON, ///< Turn on area highlight.
WID_BROS_INFO, ///< Station acceptance info.
};
#endif /* WIDGETS_ROAD_WIDGET_H */
+2
View File
@@ -23,9 +23,11 @@ enum ToolbarNormalWidgets {
WID_TN_SUBSIDIES, ///< Subsidy menu.
WID_TN_STATIONS, ///< Station menu.
WID_TN_FINANCES, ///< Finance menu.
WID_TN_CARGOS, ///< Transported cargo menu
WID_TN_COMPANIES, ///< Company menu.
WID_TN_STORY, ///< Story menu.
WID_TN_GOAL, ///< Goal menu.
WID_TN_WATCH, ///< Watch gui menu
WID_TN_GRAPHS, ///< Graph menu.
WID_TN_LEAGUE, ///< Company league menu.
WID_TN_INDUSTRIES, ///< Industry menu.
+26
View File
@@ -19,6 +19,7 @@ enum TownDirectoryWidgets {
WID_TD_LIST, ///< List of towns.
WID_TD_SCROLLBAR, ///< Scrollbar for the town list.
WID_TD_WORLD_POPULATION, ///< The world's population.
TDW_CAPTION_TEXT,
};
/** Widgets of the #TownAuthorityWindow class. */
@@ -41,6 +42,7 @@ enum TownViewWidgets {
WID_TV_CHANGE_NAME, ///< Change the name of this town.
WID_TV_EXPAND, ///< Expand this town (scenario editor only).
WID_TV_DELETE, ///< Delete this town (scenario editor only).
WID_TV_CB,
};
/** Widgets of the #FoundTownWindow class. */
@@ -62,4 +64,28 @@ enum TownFoundingWidgets {
WID_TF_LAYOUT_RANDOM, ///< Selection for a randomly chosen town layout.
};
enum TownHK {
HK_SADVERT,
HK_MADVERT,
HK_LADVERT,
HK_ROADS,
HK_STATUE,
HK_FUND,
};
enum CBTownWidgets {
WID_CB_LOCATION,
WID_CB_ADVERT,
WID_CB_FUND,
WID_CB_FUND_REGULAR,
WID_CB_DETAILS,
WID_CB_CARGO_NAME,
WID_CB_CARGO_AMOUNT,
WID_CB_CARGO_REQ,
WID_CB_CARGO_PREVIOUS,
WID_CB_CARGO_STORE,
WID_CB_CARGO_STORE_PCT,
WID_CB_CARGO_FROM,
};
#endif /* WIDGETS_TOWN_WIDGET_H */