mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-01-30 19:42:51 +03:00
chore(ui): implement SetNonSpaceWrap() for error messages
This commit is contained in:
parent
5b55f8cc20
commit
c03ea57e21
@ -19,6 +19,7 @@
|
|||||||
#include <bc/Debug.hpp>
|
#include <bc/Debug.hpp>
|
||||||
#include <common/Prop.hpp>
|
#include <common/Prop.hpp>
|
||||||
#include <storm/Error.hpp>
|
#include <storm/Error.hpp>
|
||||||
|
#include <storm/Log.hpp>
|
||||||
#include <bc/os/Path.hpp>
|
#include <bc/os/Path.hpp>
|
||||||
|
|
||||||
CVar* Client::g_accountListVar;
|
CVar* Client::g_accountListVar;
|
||||||
@ -150,6 +151,7 @@ void SetPaths() {
|
|||||||
datadir = buffer;
|
datadir = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SLogSetDefaultDirectory(datadir);
|
||||||
SFile::SetBasePath(datadir);
|
SFile::SetBasePath(datadir);
|
||||||
SFile::SetDataPath("Data\\");
|
SFile::SetDataPath("Data\\");
|
||||||
|
|
||||||
@ -368,7 +370,7 @@ void StormInitialize() {
|
|||||||
// TODO
|
// TODO
|
||||||
// SStrInitialize();
|
// SStrInitialize();
|
||||||
// SErrInitialize();
|
// SErrInitialize();
|
||||||
// SLogInitialize();
|
SLogInitialize();
|
||||||
// SFile::Initialize();
|
// SFile::Initialize();
|
||||||
|
|
||||||
Blizzard::Debug::SetAssertHandler(BlizzardAssertCallback);
|
Blizzard::Debug::SetAssertHandler(BlizzardAssertCallback);
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#include "ui/ScriptFunctions.hpp"
|
#include "ui/ScriptFunctions.hpp"
|
||||||
#include "console/CVar.hpp"
|
#include "console/CVar.hpp"
|
||||||
#include "util/Filesystem.hpp"
|
#include "util/Filesystem.hpp"
|
||||||
#include "util/Log.hpp"
|
#include "util/SysMessage.hpp"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <common/MD5.hpp>
|
#include <common/MD5.hpp>
|
||||||
|
|
||||||
@ -523,7 +523,7 @@ void CGlueMgr::Resume() {
|
|||||||
|
|
||||||
CWOWClientStatus status;
|
CWOWClientStatus status;
|
||||||
|
|
||||||
if (!SLogCreate("Logs\\GlueXML.log", 0, status.m_logFile)) {
|
if (!SLogCreate("Logs\\GlueXML.log", 0, &status.m_logFile)) {
|
||||||
SysMsgPrintf(SYSMSG_WARNING, "Cannot create WOWClient log file \"%s\"!", "Logs\\GlueXML.log");
|
SysMsgPrintf(SYSMSG_WARNING, "Cannot create WOWClient log file \"%s\"!", "Logs\\GlueXML.log");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -748,6 +748,17 @@ void CSimpleFontString::SetJustifyH(uint8_t justify) {
|
|||||||
|
|
||||||
void CSimpleFontString::SetNonSpaceWrap(int32_t a2) {
|
void CSimpleFontString::SetNonSpaceWrap(int32_t a2) {
|
||||||
// TODO
|
// TODO
|
||||||
|
// Proper implementation
|
||||||
|
uint32_t styleFlags = a2
|
||||||
|
? this->m_styleFlags | 0x1000
|
||||||
|
: this->m_styleFlags & ~0x1000;
|
||||||
|
|
||||||
|
if (this->m_styleFlags != styleFlags) {
|
||||||
|
this->m_styleFlags = styleFlags;
|
||||||
|
if (this->m_string) {
|
||||||
|
this->UpdateString();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleFontString::SetSpacing(float spacing) {
|
void CSimpleFontString::SetSpacing(float spacing) {
|
||||||
|
|||||||
@ -4,8 +4,14 @@
|
|||||||
|
|
||||||
CStatus CStatus::s_errorList;
|
CStatus CStatus::s_errorList;
|
||||||
|
|
||||||
void CStatus::Add(const CStatus& status) {
|
void CStatus::Add(const CStatus& source) {
|
||||||
// TODO
|
// TODO
|
||||||
|
// Remove const_cast<> workaround
|
||||||
|
CStatus& src = const_cast<CStatus&>(source);
|
||||||
|
|
||||||
|
for (auto i = src.statusList.Head(); i; i = src.statusList.Next(i)) {
|
||||||
|
this->Add(i->severity, i->text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStatus::Add(STATUS_TYPE severity, const char* format, ...) {
|
void CStatus::Add(STATUS_TYPE severity, const char* format, ...) {
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
#ifndef UTIL_C_STATUS_HPP
|
#ifndef UTIL_C_STATUS_HPP
|
||||||
#define UTIL_C_STATUS_HPP
|
#define UTIL_C_STATUS_HPP
|
||||||
|
|
||||||
|
#include <storm/List.hpp>
|
||||||
|
#include <storm/Log.hpp>
|
||||||
|
|
||||||
enum STATUS_TYPE {
|
enum STATUS_TYPE {
|
||||||
STATUS_INFO = 0x0,
|
STATUS_INFO = 0x0,
|
||||||
STATUS_WARNING = 0x1,
|
STATUS_WARNING = 0x1,
|
||||||
@ -10,6 +13,13 @@ enum STATUS_TYPE {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class CStatus {
|
class CStatus {
|
||||||
|
public:
|
||||||
|
struct STATUSENTRY {
|
||||||
|
char* text;
|
||||||
|
STATUS_TYPE severity;
|
||||||
|
TSLink<CStatus::STATUSENTRY> link;
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Static variables
|
// Static variables
|
||||||
static CStatus s_errorList;
|
static CStatus s_errorList;
|
||||||
@ -17,11 +27,14 @@ class CStatus {
|
|||||||
// Member functions
|
// Member functions
|
||||||
void Add(const CStatus&);
|
void Add(const CStatus&);
|
||||||
void Add(STATUS_TYPE, const char*, ...);
|
void Add(STATUS_TYPE, const char*, ...);
|
||||||
|
|
||||||
|
public:
|
||||||
|
STORM_EXPLICIT_LIST(CStatus::STATUSENTRY, link) statusList;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CWOWClientStatus : public CStatus {
|
class CWOWClientStatus : public CStatus {
|
||||||
public:
|
public:
|
||||||
void* m_logFile = nullptr;
|
HSLOG m_logFile = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
CStatus& GetGlobalStatusObj(void);
|
CStatus& GetGlobalStatusObj(void);
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
#include "util/Log.hpp"
|
#include "util/SysMessage.hpp"
|
||||||
|
|
||||||
bool SLogCreate(const char* filename, uint32_t flags, void* log) {
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SysMsgPrintf(SYSMSG_TYPE severity, const char* format, ...) {
|
void SysMsgPrintf(SYSMSG_TYPE severity, const char* format, ...) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef UTIL_LOG_HPP
|
#ifndef UTIL_SYSMESSAGE_HPP
|
||||||
#define UTIL_LOG_HPP
|
#define UTIL_SYSMESSAGE_HPP
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@ -11,8 +11,6 @@ enum SYSMSG_TYPE {
|
|||||||
SYSMSG_NUMTYPES = 0x4
|
SYSMSG_NUMTYPES = 0x4
|
||||||
};
|
};
|
||||||
|
|
||||||
bool SLogCreate(const char*, uint32_t, void*);
|
|
||||||
|
|
||||||
void SysMsgPrintf(SYSMSG_TYPE, const char*, ...);
|
void SysMsgPrintf(SYSMSG_TYPE, const char*, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user