Cube-World-Commands-Mod/cwmods/cube/ChatWidget.cpp

20 lines
701 B
C++
Raw Permalink Normal View History

2019-09-23 07:50:21 +08:00
#include "ChatWidget.h"
#include "../cwmods.h"
void cube::ChatWidget::PrintMessage(const wchar_t* message, FloatRGBA* color){
2019-09-23 07:50:21 +08:00
msvc::wstring str(message);
2019-10-06 04:08:12 +08:00
((void(*)(cube::ChatWidget*, msvc::wstring*, FloatRGBA*))CWBase()+0x26BF10)(this, &str, color);
2019-09-23 07:50:21 +08:00
}
void cube::ChatWidget::PrintMessage(const wchar_t* message) {
2019-09-23 07:50:21 +08:00
this->PrintMessage(message, 255, 255, 255);
}
void cube::ChatWidget::PrintMessage(const wchar_t* message, char red, char green, char blue){
2019-09-23 07:50:21 +08:00
float f_red = (float)red / 255.0;
float f_green = (float)green / 255.0;
float f_blue = (float)blue / 255.0;
FloatRGBA color(f_red, f_green, f_blue, 1.0);
this->PrintMessage(message, &color);
}