Gems/Atom builds
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -258,9 +258,8 @@ bool CBaseLibrary::SaveLibrary(const char* name, bool saveEmptyLibrary)
|
||||
}
|
||||
if (!bRes)
|
||||
{
|
||||
string strMessage;
|
||||
QByteArray filenameUtf8 = fileName.toUtf8();
|
||||
strMessage.Format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data());
|
||||
AZStd::string strMessage = AZStd::string::format("The file %s is read-only and the save of the library couldn't be performed. Try to remove the \"read-only\" flag or check-out the file and then try again.", filenameUtf8.data());
|
||||
CryMessageBox(strMessage.c_str(), "Saving Error", MB_OK | MB_ICONWARNING);
|
||||
}
|
||||
return bRes;
|
||||
|
||||
@@ -206,11 +206,8 @@ namespace
|
||||
|
||||
static void LogToDebug([[maybe_unused]] QtMsgType Type, [[maybe_unused]] const QMessageLogContext& Context, const QString& message)
|
||||
{
|
||||
#if defined(WIN32) || defined(WIN64)
|
||||
OutputDebugStringW(L"Qt: ");
|
||||
OutputDebugStringW(reinterpret_cast<const wchar_t*>(message.utf16()));
|
||||
OutputDebugStringW(L"\n");
|
||||
#endif
|
||||
AZ::Debug::Platform::OutputToDebugger("Qt", message.utf8());
|
||||
AZ::Debug::Platform::OutputToDebugger(nullptr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1109,7 +1109,7 @@ void CEditorImpl::DetectVersion()
|
||||
|
||||
char ver[1024 * 8];
|
||||
|
||||
GetModuleFileName(NULL, exe, _MAX_PATH);
|
||||
AZ::Utils::GetExecutablePath(exe, _MAX_PATH);
|
||||
|
||||
int verSize = GetFileVersionInfoSize(exe, &dwHandle);
|
||||
if (verSize > 0)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "StringUtils.h"
|
||||
#include "../Include/SandboxAPI.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <CryString.h>
|
||||
#include "UnicodeFunctions.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDropEvent>
|
||||
@@ -36,28 +34,6 @@ public:
|
||||
|
||||
namespace QtUtil
|
||||
{
|
||||
// From QString to CryString
|
||||
inline CryStringT<char> ToString(const QString& str)
|
||||
{
|
||||
return Unicode::Convert<CryStringT<char> >(str);
|
||||
}
|
||||
|
||||
// From CryString to QString
|
||||
inline QString ToQString(const CryStringT<char>& str)
|
||||
{
|
||||
return Unicode::Convert<QString>(str);
|
||||
}
|
||||
|
||||
// From const char * to QString
|
||||
inline QString ToQString(const char* str, size_t len = -1)
|
||||
{
|
||||
if (len == -1)
|
||||
{
|
||||
len = strlen(str);
|
||||
}
|
||||
return Unicode::Convert<QString>(str, str + len);
|
||||
}
|
||||
|
||||
// Replacement for CString::trimRight()
|
||||
inline QString trimRight(const QString& str)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "CryThread.h"
|
||||
#include "StringUtils.h"
|
||||
#include "../Include/SandboxAPI.h"
|
||||
#include <QString>
|
||||
#include <QFileInfo>
|
||||
|
||||
@@ -15,24 +15,20 @@
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h> // for ebus events
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace
|
||||
{
|
||||
string g_currentModName; // folder name only!
|
||||
}
|
||||
|
||||
namespace Path
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SplitPath(const QString& rstrFullPathFilename, QString& rstrDriveLetter, QString& rstrDirectory, QString& rstrFilename, QString& rstrExtension)
|
||||
{
|
||||
string strFullPathString(rstrFullPathFilename.toUtf8().data());
|
||||
string strDriveLetter;
|
||||
string strDirectory;
|
||||
string strFilename;
|
||||
string strExtension;
|
||||
AZStd::string strFullPathString(rstrFullPathFilename.toUtf8().data());
|
||||
AZStd::string strDriveLetter;
|
||||
AZStd::string strDirectory;
|
||||
AZStd::string strFilename;
|
||||
AZStd::string strExtension;
|
||||
|
||||
char* szPath((char*)strFullPathString.c_str());
|
||||
char* pchLastPosition(szPath);
|
||||
@@ -81,16 +77,16 @@ namespace Path
|
||||
strFilename.assign(pchLastPosition, pchCurrentPosition);
|
||||
}
|
||||
|
||||
rstrDriveLetter = strDriveLetter;
|
||||
rstrDirectory = strDirectory;
|
||||
rstrFilename = strFilename;
|
||||
rstrExtension = strExtension;
|
||||
rstrDriveLetter = strDriveLetter.c_str();
|
||||
rstrDirectory = strDirectory.c_str();
|
||||
rstrFilename = strFilename.c_str();
|
||||
rstrExtension = strExtension.c_str();
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void GetDirectoryQueue(const QString& rstrSourceDirectory, QStringList& rcstrDirectoryTree)
|
||||
{
|
||||
string strCurrentDirectoryName;
|
||||
string strSourceDirectory(rstrSourceDirectory.toUtf8().data());
|
||||
AZStd::string strCurrentDirectoryName;
|
||||
AZStd::string strSourceDirectory(rstrSourceDirectory.toUtf8().data());
|
||||
const char* szSourceDirectory(strSourceDirectory.c_str());
|
||||
const char* pchCurrentPosition(szSourceDirectory);
|
||||
const char* pchLastPosition(szSourceDirectory);
|
||||
@@ -207,7 +203,9 @@ namespace Path
|
||||
|
||||
bool IsFolder(const char* pPath)
|
||||
{
|
||||
DWORD attrs = GetFileAttributes(pPath);
|
||||
AZStd::wstring pPathW;
|
||||
AZStd::to_wstring(pPathW, pPath);
|
||||
DWORD attrs = GetFileAttributes(pPathW.c_str());
|
||||
|
||||
if (attrs == FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
@@ -255,16 +253,17 @@ namespace Path
|
||||
/// Get the data folder
|
||||
AZStd::string GetEditingGameDataFolder()
|
||||
{
|
||||
static AZStd::string s_currentModName;
|
||||
// query the editor root. The bus exists in case we want tools to be able to override this.
|
||||
|
||||
|
||||
if (g_currentModName.empty())
|
||||
if (s_currentModName.empty())
|
||||
{
|
||||
return GetGameAssetsFolder();
|
||||
}
|
||||
AZStd::string str(GetGameAssetsFolder());
|
||||
str += "Mods\\";
|
||||
str += g_currentModName;
|
||||
str += s_currentModName;
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Path
|
||||
#endif
|
||||
file = path_buffer;
|
||||
}
|
||||
inline void Split(const string& filepath, string& path, string& file)
|
||||
inline void Split(const AZStd::string& filepath, AZStd::string& path, AZStd::string& file)
|
||||
{
|
||||
char path_buffer[_MAX_PATH];
|
||||
char drive[_MAX_DRIVE];
|
||||
@@ -101,7 +101,7 @@ namespace Path
|
||||
char fname[_MAX_FNAME];
|
||||
char ext[_MAX_EXT];
|
||||
#ifdef AZ_COMPILER_MSVC
|
||||
_splitpath_s(filepath, drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), 0, 0, 0, 0);
|
||||
_splitpath_s(filepath.c_str(), drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), 0, 0, 0, 0);
|
||||
_makepath_s(path_buffer, AZ_ARRAY_SIZE(path_buffer), drive, dir, 0, 0);
|
||||
path = path_buffer;
|
||||
_makepath_s(path_buffer, AZ_ARRAY_SIZE(path_buffer), 0, 0, fname, ext);
|
||||
@@ -137,7 +137,7 @@ namespace Path
|
||||
filename = fname;
|
||||
fext = ext;
|
||||
}
|
||||
inline void Split(const string& filepath, string& path, string& filename, string& fext)
|
||||
inline void Split(const AZStd::string& filepath, AZStd::string& path, AZStd::string& filename, AZStd::string& fext)
|
||||
{
|
||||
char path_buffer[_MAX_PATH];
|
||||
char drive[_MAX_DRIVE];
|
||||
@@ -145,7 +145,7 @@ namespace Path
|
||||
char fname[_MAX_FNAME];
|
||||
char ext[_MAX_EXT];
|
||||
#ifdef AZ_COMPILER_MSVC
|
||||
_splitpath_s(filepath, drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), fname, AZ_ARRAY_SIZE(fname), ext, AZ_ARRAY_SIZE(ext));
|
||||
_splitpath_s(filepath.c_str(), drive, AZ_ARRAY_SIZE(drive), dir, AZ_ARRAY_SIZE(dir), fname, AZ_ARRAY_SIZE(fname), ext, AZ_ARRAY_SIZE(ext));
|
||||
_makepath_s(path_buffer, AZ_ARRAY_SIZE(path_buffer), drive, dir, 0, 0);
|
||||
#else
|
||||
_splitpath(filepath, drive, dir, fname, ext);
|
||||
@@ -271,7 +271,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline void AddBackslash(AZstd::fixed_string<size>* path)
|
||||
inline void AddBackslash(AZStd::fixed_string<size>* path)
|
||||
{
|
||||
if (path->empty())
|
||||
{
|
||||
@@ -284,7 +284,7 @@ namespace Path
|
||||
}
|
||||
|
||||
template<size_t size>
|
||||
inline void AddSlash(AZstd::fixed_string<size>* path)
|
||||
inline void AddSlash(AZStd::fixed_string<size>* path)
|
||||
{
|
||||
if (path->empty())
|
||||
{
|
||||
@@ -357,7 +357,7 @@ namespace Path
|
||||
{
|
||||
return CaselessPaths(GetRelativePath(path, true));
|
||||
}
|
||||
inline string FullPathToGamePath(const char* path)
|
||||
inline AZStd::string FullPathToGamePath(const char* path)
|
||||
{
|
||||
return CaselessPaths(GetRelativePath(path, true)).toUtf8().data();
|
||||
}
|
||||
@@ -394,7 +394,7 @@ namespace Path
|
||||
inline QString GetAudioLocalizationFolder(bool returnAbsolutePath)
|
||||
{
|
||||
// Omit the trailing slash!
|
||||
QString sLocalizationFolder(QString(PathUtil::GetLocalizationFolder()).left(static_cast<int>(PathUtil::GetLocalizationFolder().size()) - 1));
|
||||
QString sLocalizationFolder(QString(PathUtil::GetLocalizationFolder().c_str()).left(static_cast<int>(PathUtil::GetLocalizationFolder().size()) - 1));
|
||||
|
||||
if (!sLocalizationFolder.isEmpty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user