mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	- Compile fix for editor - Renamed /Editor to /editor and Scripting/ERM to scripting/erm - Removed unused ipch folder and format file - Removed ancient lua folder
This commit is contained in:
		| @@ -105,7 +105,7 @@ else() | ||||
| endif() | ||||
|  | ||||
| set (AI_LIB_DIR "${LIB_DIR}/AI") | ||||
| set (SCRIPTING_LIB_DIR "${LIB_DIR}/Scripting") | ||||
| set (SCRIPTING_LIB_DIR "${LIB_DIR}/scripting") | ||||
|  | ||||
| #define required constants | ||||
| add_definitions(-DM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_DIR}") | ||||
| @@ -120,10 +120,10 @@ add_subdirectory(client) | ||||
| add_subdirectory(server) | ||||
| add_subdirectory(AI) | ||||
| if (NOT DISABLE_ERM) | ||||
| 	add_subdirectory(Scripting/ERM) | ||||
| 	add_subdirectory(scripting/erm) | ||||
| endif() | ||||
| if (ENABLE_EDITOR) | ||||
| 	add_subdirectory(Editor) | ||||
| 	add_subdirectory(editor) | ||||
| endif() | ||||
|  | ||||
| ####################################### | ||||
|   | ||||
| @@ -12,7 +12,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StupidAI", "AI\StupidAI\Stu | ||||
| 		{B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ERM", "Scripting\ERM\ERM.vcxproj", "{8F202F43-106D-4F63-AD9D-B1D43E803E8C}" | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ERM", "scripting\erm\ERM.vcxproj", "{8F202F43-106D-4F63-AD9D-B1D43E803E8C}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} | ||||
| 	EndProjectSection | ||||
|   | ||||
| @@ -12,7 +12,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StupidAI", "AI\StupidAI\Stu | ||||
| 		{B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ERM", "Scripting\ERM\ERM.vcxproj", "{8F202F43-106D-4F63-AD9D-B1D43E803E8C}" | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ERM", "scripting\erm\ERM.vcxproj", "{8F202F43-106D-4F63-AD9D-B1D43E803E8C}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} | ||||
| 	EndProjectSection | ||||
| @@ -30,7 +30,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BattleAI", "AI\BattleAI\Bat | ||||
| 		{B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} | ||||
| 	EndProjectSection | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "Editor\Editor.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor", "editor\Editor.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" | ||||
| 	ProjectSection(ProjectDependencies) = postProject | ||||
| 		{B952FFC5-3039-4DE1-9F08-90ACDA483D8F} = {B952FFC5-3039-4DE1-9F08-90ACDA483D8F} | ||||
| 	EndProjectSection | ||||
|   | ||||
| @@ -420,7 +420,7 @@ void CClient::newGame( CConnection *con, StartInfo *si ) | ||||
| 	hotSeat = (humanPlayers > 1); | ||||
|  | ||||
| // 	std::vector<FileInfo> scriptModules; | ||||
| // 	CFileUtility::getFilesWithExt(scriptModules, LIB_DIR "/Scripting", "." LIB_EXT); | ||||
| // 	CFileUtility::getFilesWithExt(scriptModules, LIB_DIR "/scripting", "." LIB_EXT); | ||||
| // 	BOOST_FOREACH(FileInfo &m, scriptModules) | ||||
| // 	{ | ||||
| // 		CScriptingModule * nm = CDynLibHandler::getNewScriptingModule(m.name); | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| #ifndef EDITOR_H | ||||
| #define EDITOR_H | ||||
| 
 | ||||
| #include <memory> | ||||
| #include <QtWidgets/QMainWindow> | ||||
| #include "ui_editor.h" | ||||
| 
 | ||||
| @@ -16,8 +17,7 @@ public: | ||||
| 	~Editor(); | ||||
| 	void createMenus(); | ||||
| 
 | ||||
| 
 | ||||
| 	std::unique_ptr<CMap> map; | ||||
|     std::unique_ptr<CMap> map; | ||||
| private: | ||||
| 
 | ||||
| 	std::vector<std::string> txtEditor, txtEditorCmd; | ||||
| @@ -3,7 +3,8 @@ | ||||
|  | ||||
| #include "../CConfigHandler.h" | ||||
|  | ||||
| CBasicLogConfigurator::CBasicLogConfigurator(const std::string & filePath, CConsoleHandler * console) : filePath(filePath), console(console), appendToLogFile(false) | ||||
| CBasicLogConfigurator::CBasicLogConfigurator(const std::string & filePath, CConsoleHandler * console) : filePath(filePath), | ||||
|     console(console), appendToLogFile(false) | ||||
| { | ||||
|  | ||||
| } | ||||
| @@ -79,7 +80,8 @@ void CBasicLogConfigurator::configure() | ||||
|     } | ||||
|     catch(const std::exception & e) | ||||
|     { | ||||
|         logGlobal->errorStream() << "Could not initialize the logging system due to configuration error/s. The logging system can be in a corrupted state. " << e.what(); | ||||
|         logGlobal->errorStream() << "Could not initialize the logging system due to configuration error/s." | ||||
|             << "The logging system can be in a corrupted state. " << e.what(); | ||||
|     } | ||||
|  | ||||
|     logGlobal->infoStream() << "Initialized logging system based on settings successfully."; | ||||
|   | ||||
| @@ -370,9 +370,6 @@ EConsoleTextColor::EConsoleTextColor CColorMapping::getColorFor(const CLoggerDom | ||||
|  | ||||
| CLogConsoleTarget::CLogConsoleTarget(CConsoleHandler * console) : console(console), threshold(ELogLevel::INFO), coloredOutputEnabled(true) | ||||
| { | ||||
|     // more verbose version: | ||||
| 	//formatter.setPattern("%l %n [%t] - %m"); | ||||
|  | ||||
| 	formatter.setPattern("%m"); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -126,12 +126,15 @@ extern DLL_LINKAGE CLogger * logBonus; | ||||
| extern DLL_LINKAGE CLogger * logNetwork; | ||||
| extern DLL_LINKAGE CLogger * logAi; | ||||
|  | ||||
| /// Macros for tracing the control flow of the application conveniently. If the TRACE_BEGIN macro is used it should be the first statement in the function, whereas | ||||
| /// the TRACE_END should be last one before a return statement. Logging traces via this macro have almost no impact when the trace is disabled. | ||||
| /// Macros for tracing the control flow of the application conveniently. If the TRACE_BEGIN macro is used it should be | ||||
| /// the first statement in the function, whereas the TRACE_END should be last one before a return statement. | ||||
| /// Logging traces via this macro have almost no impact when the trace is disabled. | ||||
| #define TRACE_BEGIN(logger) logger->traceStream() << boost::format("Entering %s.") % BOOST_CURRENT_FUNCTION; | ||||
| #define TRACE_BEGIN_PARAMS(logger, formatStr, params) if(logger->isTraceEnabled()) logger->traceStream() << boost::format("Entering %s: " + std::string(formatStr) + ".") % BOOST_CURRENT_FUNCTION % params; | ||||
| #define TRACE_BEGIN_PARAMS(logger, formatStr, params) if(logger->isTraceEnabled()) logger->traceStream() << \ | ||||
|     boost::format("Entering %s: " + std::string(formatStr) + ".") % BOOST_CURRENT_FUNCTION % params; | ||||
| #define TRACE_END(logger) logger->traceStream() << boost::format("Leaving %s.") % BOOST_CURRENT_FUNCTION; | ||||
| #define TRACE_END_PARAMS(logger, formatStr, params) if(logger->isTraceEnabled()) logger->traceStream() << boost::format("Leaving %s: " + std::string(formatStr) + ".") % BOOST_CURRENT_FUNCTION % params; | ||||
| #define TRACE_END_PARAMS(logger, formatStr, params) if(logger->isTraceEnabled()) logger->traceStream() << \ | ||||
|     boost::format("Leaving %s: " + std::string(formatStr) + ".") % BOOST_CURRENT_FUNCTION % params; | ||||
|  | ||||
| /* ---------------------------------------------------------------------------- */ | ||||
| /* Implementation/Detail classes, Private API */ | ||||
| @@ -159,7 +162,8 @@ private: | ||||
| struct DLL_LINKAGE LogRecord | ||||
| { | ||||
|     LogRecord(const CLoggerDomain & domain, ELogLevel::ELogLevel level, const std::string & message) | ||||
|         : domain(domain), level(level), message(message), timeStamp(boost::posix_time::second_clock::local_time()), threadId(boost::this_thread::get_id()) | ||||
|         : domain(domain), level(level), message(message), timeStamp(boost::posix_time::second_clock::local_time()), | ||||
|           threadId(boost::this_thread::get_id()) | ||||
|     { | ||||
|  | ||||
|     } | ||||
| @@ -249,8 +253,8 @@ private: | ||||
| class DLL_LINKAGE CLogFileTarget : public ILogTarget | ||||
| { | ||||
| public: | ||||
|     /// Constructs a CLogFileTarget and opens the file designated by filePath. If the append parameter is true, the file will be appended to. Otherwise the file designated by filePath | ||||
|     /// will be truncated before being opened. | ||||
|     /// Constructs a CLogFileTarget and opens the file designated by filePath. If the append parameter is true, the file | ||||
|     /// will be appended to. Otherwise the file designated by filePath will be truncated before being opened. | ||||
|     explicit CLogFileTarget(const std::string & filePath, bool append = true); | ||||
|     ~CLogFileTarget(); | ||||
|  | ||||
|   | ||||
| @@ -74,16 +74,16 @@ | ||||
|   </ImportGroup> | ||||
|   <PropertyGroup Label="UserMacros" /> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <OutDir>$(VCMI_Out)\Scripting\</OutDir> | ||||
| 	<OutDir>$(VCMI_Out)\scripting\</OutDir> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <OutDir>$(VCMI_Out)\Scripting\</OutDir> | ||||
| 	<OutDir>$(VCMI_Out)\scripting\</OutDir> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'"> | ||||
|     <OutDir>$(VCMI_Out)\Scripting\</OutDir> | ||||
| 	<OutDir>$(VCMI_Out)\scripting\</OutDir> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'"> | ||||
|     <OutDir>$(VCMI_Out)\Scripting\</OutDir> | ||||
| 	<OutDir>$(VCMI_Out)\scripting\</OutDir> | ||||
|   </PropertyGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <ClCompile> | ||||
| @@ -141,4 +141,4 @@ | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||||
|   <ImportGroup Label="ExtensionTargets"> | ||||
|   </ImportGroup> | ||||
| </Project> | ||||
| </Project> | ||||
| @@ -1,66 +0,0 @@ | ||||
| ------------------------- | ||||
| -- | ||||
| ------------------------- | ||||
| function find(t, searched) | ||||
| 	print("searching") | ||||
| 	for index,value in ipairs(t)  | ||||
| 	do  | ||||
| 		print(index.." "..value) | ||||
| 		if value==searched | ||||
| 		then | ||||
| 			return index | ||||
| 		end | ||||
| 	end | ||||
| 	return nil | ||||
| end | ||||
|  | ||||
| function contain(t, searched) | ||||
| 	print("searching") | ||||
| 	for index,value in ipairs(t)  | ||||
| 	do  | ||||
| 		print(index.." "..value) | ||||
| 		if value==searched | ||||
| 		then | ||||
| 			return true | ||||
| 		end | ||||
| 	end | ||||
| 	return false | ||||
| end | ||||
|  | ||||
| function push_back(t,value) | ||||
| 	t[(#t)+1] = value | ||||
| end | ||||
|  | ||||
| myObjects = {} | ||||
| name = "" | ||||
| visited = {} | ||||
| -------------------------------------------------------------- | ||||
| function newObject_23 (ob) | ||||
| 	myObjects[ob] = {} | ||||
| 	print("Dostaje info o nowym Marletto Tower spod adresu " .. ob) | ||||
| 	print(vcmi.getPos(ob)) | ||||
| 	visited[true],visited[false] = vcmi.getGnrlText(352), vcmi.getGnrlText(353) | ||||
| end | ||||
|  | ||||
| function hoverText_23(Object) | ||||
| 	local Hero = vcmi.getSelectedHero() | ||||
| 	local ret = name.." " | ||||
| 	if Hero>-1 | ||||
| 	then | ||||
| 		ret = ret..visited[contain(myObjects[ObjectAddress],Hero)] | ||||
| 	end | ||||
| 	return name..visited[contain(myObjects[ObjectAddress],Hero)] | ||||
| 	 | ||||
| end | ||||
|  | ||||
| function heroVisit_23(ObjectAddress, HeroID) | ||||
| 	print("Hero with ID " .. HeroID .. " has visited object at " .. ObjectAddress) | ||||
| 	if find(myObjects[ObjectAddress],HeroID) | ||||
| 	then | ||||
| 		print("Ten bohater juz tu byl") | ||||
| 	else | ||||
| 		print("Bierz obrone...") | ||||
| 		vcmi.changePrimSkill(HeroID, 1, 1) | ||||
| 		push_back(myObjects[ObjectAddress],HeroID) | ||||
| 	end | ||||
| end | ||||
		Reference in New Issue
	
	Block a user