Merge branch 'master' into jgrpp

# Conflicts:
#	src/company_cmd.cpp
#	src/core/overflowsafe_type.hpp
#	src/economy.cpp
#	src/engine_base.h
#	src/ground_vehicle.cpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/newgrf_commons.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_industries.cpp
#	src/newgrf_object.cpp
#	src/newgrf_roadstop.cpp
#	src/newgrf_station.cpp
#	src/rail_gui.cpp
#	src/road_cmd.h
#	src/road_gui.cpp
#	src/saveload/afterload.cpp
#	src/script/api/script_log.cpp
#	src/script/api/script_log.hpp
#	src/settings_gui.cpp
#	src/settingsgen/settingsgen.cpp
#	src/station_cmd.cpp
#	src/station_cmd.h
#	src/station_gui.cpp
#	src/strgen/strgen.cpp
#	src/string_func.h
#	src/string_type.h
#	src/table/settings/network_private_settings.ini
#	src/tests/math_func.cpp
#	src/textfile_gui.cpp
#	src/timetable_gui.cpp
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
#	src/waypoint_cmd.h
#	src/widgets/dropdown.cpp
This commit is contained in:
Jonathan G Rennison
2023-06-03 19:16:42 +01:00
101 changed files with 987 additions and 964 deletions

View File

@@ -22,32 +22,6 @@ class ScriptLog : public ScriptObject {
friend class ScriptController;
public:
/**
* Log levels; The value is also feed to DEBUG() lvl.
* This has no use for you, as script writer.
* @api -all
*/
enum ScriptLogType {
LOG_SQ_ERROR = 0, ///< Squirrel printed an error.
LOG_ERROR = 1, ///< User printed an error.
LOG_SQ_INFO = 2, ///< Squirrel printed some info.
LOG_WARNING = 3, ///< User printed some warning.
LOG_INFO = 4, ///< User printed some info.
};
/**
* Internal representation of the log-data inside the script.
* This has no use for you, as script writer.
* @api -all
*/
struct LogData {
char **lines; ///< The log-lines.
ScriptLog::ScriptLogType *type; ///< Per line, which type of log it was.
int count; ///< Total amount of log-lines possible.
int pos; ///< Current position in lines.
int used; ///< Total amount of used log-lines.
};
/**
* Print an Info message to the logs.
* @param message The message to log.
@@ -69,23 +43,17 @@ public:
*/
static void Error(const char *message);
/**
* Free the log pointer.
* @api -all
*/
static void FreeLogPointer();
/**
* Log this message once.
* @api -all
*/
static void LogOnce(ScriptLog::ScriptLogType level, std::string &&message);
static void LogOnce(ScriptLogTypes::ScriptLogType level, std::string &&message);
private:
/**
* Internal command to log the message in a common way.
*/
static void Log(ScriptLog::ScriptLogType level, const char *message);
static void Log(ScriptLogTypes::ScriptLogType level, const char *message);
};
#endif /* SCRIPT_LOG_HPP */