summaryrefslogtreecommitdiff
path: root/src/script/api/script_company.hpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-02-13 22:05:08 +0000
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-03-03 09:15:39 +0100
commite0c2ad1b6591859a1a30216e396cdab6e6bb028f (patch)
treeb8d65be4898bbb1e783be8f589a48b465c7745a9 /src/script/api/script_company.hpp
parent3c047b124e28db45621de06d5556c96598352fc7 (diff)
downloadopenttd-e0c2ad1b6591859a1a30216e396cdab6e6bb028f.tar.xz
Add: AI functions to get/set company colours.
Diffstat (limited to 'src/script/api/script_company.hpp')
-rw-r--r--src/script/api/script_company.hpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/script/api/script_company.hpp b/src/script/api/script_company.hpp
index dc917500b..55cb7a930 100644
--- a/src/script/api/script_company.hpp
+++ b/src/script/api/script_company.hpp
@@ -14,6 +14,8 @@
#include "script_text.hpp"
#include "../../economy_type.h"
+#include "../../livery.h"
+#include "../../gfx_type.h"
/**
* Class that handles all company related functions.
@@ -46,6 +48,55 @@ public:
GENDER_INVALID = -1, ///< An invalid gender.
};
+ /** List of different livery schemes. */
+ enum LiveryScheme {
+ LS_DEFAULT, ///< Default scheme.
+ LS_STEAM, ///< Steam engines.
+ LS_DIESEL, ///< Diesel engines.
+ LS_ELECTRIC, ///< Electric engines.
+ LS_MONORAIL, ///< Monorail engines.
+ LS_MAGLEV, ///< Maglev engines.
+ LS_DMU, ///< DMUs and their passenger wagons.
+ LS_EMU, ///< EMUs and their passenger wagons.
+ LS_PASSENGER_WAGON_STEAM, ///< Passenger wagons attached to steam engines.
+ LS_PASSENGER_WAGON_DIESEL, ///< Passenger wagons attached to diesel engines.
+ LS_PASSENGER_WAGON_ELECTRIC, ///< Passenger wagons attached to electric engines.
+ LS_PASSENGER_WAGON_MONORAIL, ///< Passenger wagons attached to monorail engines.
+ LS_PASSENGER_WAGON_MAGLEV, ///< Passenger wagons attached to maglev engines.
+ LS_FREIGHT_WAGON, ///< Freight wagons.
+ LS_BUS, ///< Buses.
+ LS_TRUCK, ///< Trucks.
+ LS_PASSENGER_SHIP, ///< Passenger ships.
+ LS_FREIGHT_SHIP, ///< Freight ships.
+ LS_HELICOPTER, ///< Helicopters.
+ LS_SMALL_PLANE, ///< Small aeroplanes.
+ LS_LARGE_PLANE, ///< Large aeroplanes.
+ LS_PASSENGER_TRAM, ///< Passenger trams.
+ LS_FREIGHT_TRAM, ///< Freight trams.
+ LS_INVALID = -1,
+ };
+
+ /** List of colours. */
+ enum Colours {
+ COLOUR_DARK_BLUE,
+ COLOUR_PALE_GREEN,
+ COLOUR_PINK,
+ COLOUR_YELLOW,
+ COLOUR_RED,
+ COLOUR_LIGHT_BLUE,
+ COLOUR_GREEN,
+ COLOUR_DARK_GREEN,
+ COLOUR_BLUE,
+ COLOUR_CREAM,
+ COLOUR_MAUVE,
+ COLOUR_PURPLE,
+ COLOUR_ORANGE,
+ COLOUR_BROWN,
+ COLOUR_GREY,
+ COLOUR_WHITE,
+ COLOUR_INVALID = ::INVALID_COLOUR
+ };
+
/**
* Types of expenses.
* @api -ai
@@ -331,6 +382,36 @@ public:
* @return The minimum required money for autorenew to work.
*/
static Money GetAutoRenewMoney(CompanyID company);
+
+ /**
+ * Set primary colour for your company.
+ * @param scheme Livery scheme to set.
+ * @param colour Colour to set.
+ * @return False if unable to set primary colour of the livery scheme (e.g. colour in use).
+ */
+ static bool SetPrimaryLiveryColour(LiveryScheme scheme, Colours colour);
+
+ /**
+ * Set secondary colour for your company.
+ * @param scheme Livery scheme to set.
+ * @param colour Colour to set.
+ * @return False if unable to set secondary colour of the livery scheme.
+ */
+ static bool SetSecondaryLiveryColour(LiveryScheme scheme, Colours colour);
+
+ /**
+ * Get primary colour of a livery for your company.
+ * @param scheme Livery scheme to get.
+ * @return Primary colour of livery.
+ */
+ static ScriptCompany::Colours GetPrimaryLiveryColour(LiveryScheme scheme);
+
+ /**
+ * Get secondary colour of a livery for your company.
+ * @param scheme Livery scheme to get.
+ * @return Secondary colour of livery.
+ */
+ static ScriptCompany::Colours GetSecondaryLiveryColour(LiveryScheme scheme);
};
DECLARE_POSTFIX_INCREMENT(ScriptCompany::CompanyID)