PDA

View Full Version : [MU] Code NewFont Main 1.05D S4 Emu by boris160



muonlinegr2
13-11-17, 09:15 PM
Customização bem bacana que deixa o mu com uma cara mais bonita!

NewFont.h



#pragma once
#include "stdafx.h"
//---------------------------------------------------------------------------
#define Offset_CreateFontA1 0x00406153
#define Offset_CreateFontA2 0x005E5B15
#define Offset_CreateFontA3 0x005E5B7C
#define Offset_CreateFontA4 0x005E5BE5
#define Offset_CreateFontA5 0x005E5C4E
//---------------------------------------------------------------------------
class Font
{
public:
//--
Font(){};
~Font(){};
//--
void Load();
HFONT LoadNewFont();




//--
}; extern Font gFont;
//---------------------------------------------------------------------------



NewFont.cpp



//---------------------------------------------------------------------------
#include "stdafx.h"
#include "Util.h"
#include "NewFont.h"
//---------------------------------------------------------------------------
Font gFont;
//---------------------------------------------------------------------------
char MyFontFaceName[100];
char sValue[99];
//--
int Bold = GetPrivateProfileIntA("Font", "Main_Font_Bold", 1,".\\Config.ini");
int Height = GetPrivateProfileIntA("Font", "Main_Font_Height", 13, ".\\Config.ini");
int Italic = GetPrivateProfileIntA("Font", "Main_Font_Italic", 0, ".\\Config.ini");
int Unicode = GetPrivateProfileIntA("Font", "Main_Font_Unicode", 1, ".\\Config.ini");
//--
int Width = GetPrivateProfileIntA("Font", "Main_Font_Width", 0, ".\\Config.ini");
int UnderLine = GetPrivateProfileIntA("Font", "Main_Font_Underline", 0, ".\\Config.ini");
int Quality = GetPrivateProfileIntA("Font", "Main_Font_Quality", 3, ".\\Config.ini");
int StrikeOut = GetPrivateProfileIntA("Font", "Main_Font_StrikeOut", 0, ".\\Config.ini");
//---------------------------------------------------------------------------
void Font::Load()
{
GetPrivateProfileStringA("Font", "Main_Font_Name", "Georgia", MyFontFaceName, 100, ".\\Config.ini");
//--
SetCompleteHook(0xE8, Offset_CreateFontA1, &Font::LoadNewFont);
SetCompleteHook(0xE8, Offset_CreateFontA2, &Font::LoadNewFont);
SetCompleteHook(0xE8, Offset_CreateFontA3, &Font::LoadNewFont);
SetCompleteHook(0xE8, Offset_CreateFontA4, &Font::LoadNewFont);
SetCompleteHook(0xE8, Offset_CreateFontA5, &Font::LoadNewFont);
//--
SetByte((Offset_CreateFontA1 + 5), 0x90);
SetByte((Offset_CreateFontA2 + 5), 0x90);
SetByte((Offset_CreateFontA3 + 5), 0x90);
SetByte((Offset_CreateFontA4 + 5), 0x90);
SetByte((Offset_CreateFontA5 + 5), 0x90);
}
//---------------------------------------------------------------------------
HFONT Font::LoadNewFont()
{
HFONT MyFont;
//--
if (Bold == 0)
{
if (Unicode == 1)
{
MyFont = CreateFontA(Height, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x01, 0, 0, Quality, 0, MyFontFaceName);
}
else
{
MyFont = CreateFontA(Height, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x0, 0, 0, Quality, 0, MyFontFaceName);
}
}
else
{
if (Unicode == 1)
{
MyFont = CreateFontA(Height, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x01, 0, 0, Quality, 0, MyFontFaceName);
}
else
{
MyFont = CreateFontA(Height, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x0, 0, 0, Quality, 0, MyFontFaceName);
}
}




return MyFont;
}
//---------------------------------------------------------------------------


Main.cpp



#include "NewFont.h"

gFont.Load();


<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>


Créditos:
Boris160