Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2]

Experienced Elementalist
Joined
Apr 2, 2009
Messages
223
Reaction score
59
wFjyuq0 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums


By takumi12

MUHELPER

NewUIMuHelper.h
Code:
#pragma once
#include "NewUIBase.h"
#include "NewUIManager.h"
#include "NewUIButton.h"

namespace SEASON3B
{
	class CNewUIMuHelper : public CNewUIObj
	{
	public:
		enum IMAGE_LIST
		{

			IMAGE_BASE_WINDOW_BACK = CNewUIMessageBoxMng::IMAGE_MSGBOX_BACK,				//. newui_msgbox_back.jpg
			IMAGE_BASE_WINDOW_TOP = CNewUIMyInventory::IMAGE_INVENTORY_BACK_TOP,			//. newui_item_back01.tga	(190,64)
			IMAGE_BASE_WINDOW_LEFT = CNewUIMyInventory::IMAGE_INVENTORY_BACK_LEFT,		//. newui_item_back02-l.tga	(21,320)
			IMAGE_BASE_WINDOW_RIGHT = CNewUIMyInventory::IMAGE_INVENTORY_BACK_RIGHT,		//. newui_item_back02-r.tga	(21,320)
			IMAGE_BASE_WINDOW_BOTTOM = CNewUIMyInventory::IMAGE_INVENTORY_BACK_BOTTOM,	//. newui_item_back03.tga	(190,45)
			IMAGE_BASE_WINDOW_BTN_EXIT = CNewUIMyInventory::IMAGE_INVENTORY_EXIT_BTN,		//. newui_exit_00.tga
			//--
			IMAGE_TABLE_TOP_LEFT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_TOP_LEFT,			//. newui_item_table01(L).tga (14,14)
			IMAGE_TABLE_TOP_RIGHT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_TOP_RIGHT,			//. newui_item_table01(R).tga (14,14)
			IMAGE_TABLE_BOTTOM_LEFT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_BOTTOM_LEFT,		//. newui_item_table02(L).tga (14,14)
			IMAGE_TABLE_BOTTOM_RIGHT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_BOTTOM_RIGHT,	//. newui_item_table02(R).tga (14,14)
			IMAGE_TABLE_TOP_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_TOP_PIXEL,			//. newui_item_table03(up).tga (1, 14)
			IMAGE_TABLE_BOTTOM_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_BOTTOM_PIXEL,	//. newui_item_table03(dw).tga (1,14)
			IMAGE_TABLE_LEFT_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_LEFT_PIXEL,		//. newui_item_table03(L).tga (14,1)
			IMAGE_TABLE_RIGHT_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_RIGHT_PIXEL,		//. newui_item_table03(R).tga (14,1)
			//--
			IMAGE_WINDOW_TAB_BTN = CNewUIGuildInfoWindow::IMAGE_GUILDINFO_TAB_BUTTON,
			//--
			IMAGE_MACROUI_HELPER_RAGEMINUS = BITMAP_INTERFACE_MACROUI_BEGIN,		// newui_position02.tga			(70, 25)	
			IMAGE_MACROUI_HELPER_OPTIONBUTTON = BITMAP_INTERFACE_MACROUI_BEGIN+1,		// newui_position02.tga			(70, 25)	
			IMAGE_MACROUI_HELPER_INPUTNUMBER = BITMAP_INTERFACE_MACROUI_BEGIN+2,
			IMAGE_MACROUI_HELPER_INPUTSTRING = BITMAP_INTERFACE_MACROUI_BEGIN+3,
			//-- Buttons
			IMAGE_CHAINFO_BTN_STAT = BITMAP_INTERFACE_NEW_CHAINFO_WINDOW_BEGIN + 1,
			IMAGE_CLEARNESS_BTN = BITMAP_CURSEDTEMPLE_BEGIN+4,
			IMAGE_IGS_BUTTON = BITMAP_IGS_MSGBOX_BUTTON,

		};
	private:
		enum PARTY_WINDOW_SIZE
		{
			WINDOW_WIDTH = 190,
			WINDOW_HEIGHT = 429,
		};
		typedef struct
		{
			int iNumTab;
			BYTE class_character[max_class_s6+2];
			CNewUIButton* btn;
		} CButtonTap;

		typedef struct
		{
			int iNumTab;
			BYTE class_character[max_class_s6+2];
			CNewUICheckBox* box;
		} CheckBoxTap;

		typedef struct
		{
			int iNumTab;
			int s_ImgIndex;
			POINT m_Pos;
			POINT m_Size;
			BYTE class_character[max_class_s6 + 2];
		} cTexture;

		typedef struct
		{
			int iNumTab;
			POINT m_Pos;
			unicode::t_string m_Name;
			BYTE class_character[max_class_s6 + 2];
		} cTextName;

		typedef std::map<int, CButtonTap> cButtonMap;
		typedef std::map<int, CheckBoxTap> cCheckBoxMap;
		typedef std::map<int, cTexture> cTextureMap;
		typedef std::map<int, cTextName> cTextNameMap;

	private:
		CNewUIManager* m_pNewUIMng;
		POINT					m_Pos;
		CNewUIRadioGroupButton	m_TabBtn;
		int						m_iNumCurOpenTab;
		cButtonMap				m_ButtonList;
		cCheckBoxMap			m_CheckBoxList;
		cTextureMap				m_TextureList;
		cTextNameMap			m_TextNameList;
	public:
		void RenderBtnList();
		int UpdateMouseBtnList();
		void RegisterBtnCharacter(BYTE class_character, int Identificador);
		void RegisterButton(int Identificador, CButtonTap button);
		void InsertButton(int imgindex, int x, int y, int sx, int sy, bool overflg, bool isimgwidth, bool bClickEffect, bool MoveTxt, unicode::t_string btname, unicode::t_string tooltiptext, int Identificador, int iNumTab);
		//--
		void RenderBoxList();
		int UpdateMouseBoxList();
		void RegisterBoxCharacter(BYTE class_character, int Identificador);
		void RegisterCheckBox(int Identificador, CheckBoxTap button);
		void InsertCheckBox(int imgindex, int x, int y, int sx, int sy, bool overflg, unicode::t_string btname, int Identificador, int iNumTab);
		//--
		void RenderTextureList();
		int UpdateTextureList();
		void RegisterTextureCharacter(BYTE class_character, int Identificador);
		void RegisterTexture(int Identificador, cTexture button);
		void InsertTexture(int imgindex, int x, int y, int sx, int sy, int Identificador, int iNumTab);
		//--
		void RenderTextList();
		void RegisterTextCharacter(BYTE class_character, int Identificador);
		void RegisterTextur(int Identificador, cTextName button);
		void InsertText(int x, int y, unicode::t_string Name, int Identificador, int iNumTab);
	public:
		CNewUIMuHelper();
		virtual ~CNewUIMuHelper();

		bool Create(CNewUIManager* pNewUIMng, int x, int y);
		void Release();

		bool Render();
		bool Update();
		bool UpdateMouseEvent();
		bool UpdateKeyEvent();

		float GetLayerDepth();
		float GetKeyEventOrder();

		void InitText();
		void InitImage();
		void InitButtons();
		void InitCheckBox();
		void SetPos(int x, int y);
		void RenderBack(int x, int y, int width, int height);

	private:
		void LoadImages();
		void UnloadImages();
	};

}

NewUIMuHelper.cpp
Code:
#include "stdafx.h"
#include "NewUISystem.h"

#include "NewUIMuHelper.h"


SEASON3B::CNewUIMuHelper::CNewUIMuHelper()
{
	m_pNewUIMng = NULL;
	m_Pos.x = m_Pos.y = 0;
	m_ButtonList.clear();
	m_iNumCurOpenTab = 0;
}

SEASON3B::CNewUIMuHelper::~CNewUIMuHelper()
{
	Release();
}

bool SEASON3B::CNewUIMuHelper::Create(CNewUIManager* pNewUIMng, int x, int y)
{
	if (NULL == pNewUIMng)
		return false;

	m_pNewUIMng = pNewUIMng;
	m_pNewUIMng->AddUIObj(SEASON3B::INTERFACE_MUHELPER, this);

	SetPos(x, y);

	LoadImages();

	InitButtons();

	InitCheckBox();

	InitImage();

	InitText();

	Show(false);

	return true;
}

void SEASON3B::CNewUIMuHelper::Release()
{
	UnloadImages();

	if (m_pNewUIMng)
	{
		m_pNewUIMng->RemoveUIObj(this);
		m_pNewUIMng = NULL;
	}
}

void SEASON3B::CNewUIMuHelper::SetPos(int x, int y)
{
	m_Pos.x = x;
	m_Pos.y = y;
}

void SEASON3B::CNewUIMuHelper::InitButtons()
{
	std::list<unicode::t_string> ltext;
	ltext.push_back(GlobalText[3500]);
	ltext.push_back(GlobalText[3501]);
	ltext.push_back(GlobalText[3590]);

	m_TabBtn.CreateRadioGroup(3, IMAGE_WINDOW_TAB_BTN, TRUE);
	m_TabBtn.ChangeRadioText(ltext);
	m_TabBtn.ChangeRadioButtonInfo(true, m_Pos.x + 10.f, m_Pos.y + 48.f, 56, 22);
	m_TabBtn.ChangeFrame(m_iNumCurOpenTab);

	InsertButton(IMAGE_CHAINFO_BTN_STAT, m_Pos.x + 56, m_Pos.y + 78, 16, 15, 0, 0, 0, 0, "", "", 0, 0);
	InsertButton(IMAGE_MACROUI_HELPER_RAGEMINUS, m_Pos.x + 56, m_Pos.y + 97, 16, 15, 0, 0, 0, 0, "", "", 1, 0);
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 191, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 2, 0); //-- skill 2
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 243, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 3, 0); //-- skill 3
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 84, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 4, 0); //-- Buff
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 79, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 5, 0); //-- potion
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 84, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 6, 0); //-- potion
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 17, m_Pos.y + 234, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 7, 0); //-- potion
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 17, m_Pos.y + 234, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 8, 0); //-- potion
	InsertButton(IMAGE_CHAINFO_BTN_STAT, m_Pos.x + 56, m_Pos.y + 78, 16, 15, 0, 0, 0, 0, "", "", 9, 1);
	InsertButton(IMAGE_MACROUI_HELPER_RAGEMINUS, m_Pos.x + 56, m_Pos.y + 97, 16, 15, 0, 0, 0, 0, "", "", 10, 1);
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 208, 38, 24, 1, 0, 1, 1, GlobalText[3505], "", 11, 1); //-- Buff
	InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 309, 38, 24, 1, 0, 1, 1, GlobalText[3506], "", 12, 1); //-- Buff
	//--
	InsertButton(IMAGE_IGS_BUTTON, m_Pos.x + 120, m_Pos.y + 388, 52, 26, 1, 0, 1, 1, GlobalText[3503], "", 13, -1);
	InsertButton(IMAGE_IGS_BUTTON, m_Pos.x + 65, m_Pos.y + 388, 52, 26, 1, 0, 1, 1, GlobalText[3504], "", 14, -1);
	InsertButton(IMAGE_BASE_WINDOW_BTN_EXIT, m_Pos.x + 20, m_Pos.y + 388, 36, 29, 0, 0, 0, 0, "", GlobalText[388], 15, -1);

	RegisterBtnCharacter(0xFF, 0);
	RegisterBtnCharacter(0xFF, 1);
	RegisterBtnCharacter(0xFF, 2);
	RegisterBtnCharacter(0xFF, 9);
	RegisterBtnCharacter(0xFF, 10);
	RegisterBtnCharacter(0xFF, 11);
	RegisterBtnCharacter(0xFF, 12);
	RegisterBtnCharacter(0xFF, 13);
	RegisterBtnCharacter(0xFF, 15);
	RegisterBtnCharacter(0xFF, 14);

	RegisterBtnCharacter(Dark_Knight, 3);
	RegisterBtnCharacter(Dark_Knight, 6);

	RegisterBtnCharacter(Dark_Wizard, 3);
	RegisterBtnCharacter(Dark_Wizard, 6);
	RegisterBtnCharacter(Dark_Wizard, 7);

	RegisterBtnCharacter(Magic_Gladiator, 3);
	RegisterBtnCharacter(Magic_Gladiator, 6);
	RegisterBtnCharacter(Dark_Lord, 6);

	RegisterBtnCharacter(Rage_Fighter, 3);
	RegisterBtnCharacter(Rage_Fighter, 6);

	RegisterBtnCharacter(Fairy_Elf, 3);
	RegisterBtnCharacter(Fairy_Elf, 4);
	RegisterBtnCharacter(Fairy_Elf, 8);

	RegisterBtnCharacter(Summoner, 3);
	RegisterBtnCharacter(Summoner, 5);
}

void SEASON3B::CNewUIMuHelper::InitCheckBox()
{
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 79, m_Pos.y + 80, 15, 15, 0, GlobalText[3507], 0, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 18, m_Pos.y + 122, 15, 15, 0, GlobalText[3508], 1, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 18, m_Pos.y + 137, 15, 15, 0, GlobalText[3509], 2, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 174, 15, 15, 0, GlobalText[3510], 3, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 191, 15, 15, 0, GlobalText[3511], 4, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 226, 15, 15, 0, GlobalText[3510], 5, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 243, 15, 15, 0, GlobalText[3511], 6, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 18, m_Pos.y + 226, 15, 15, 0, GlobalText[3512], 7, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 25, m_Pos.y + 276, 15, 15, 0, GlobalText[3513], 8, 0);

	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 60, m_Pos.y + 218, 15, 15, 0, GlobalText[3514], 9, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 15, m_Pos.y + 218, 15, 15, 0, GlobalText[3515], 10, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 79, m_Pos.y + 97, 15, 15, 0, GlobalText[3516], 11, 0);
	InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 79, m_Pos.y + 97, 15, 15, 0, GlobalText[3517], 12, 0);

	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 79, m_Pos.y + 80, 15, 15, 0, GlobalText[3518], 13, 1);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 17, m_Pos.y + 125, 15, 15, 0, GlobalText[3519], 14, 1);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 17, m_Pos.y + 152, 15, 15, 0, GlobalText[3520], 15, 1);

	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 22, m_Pos.y + 170, 15, 15, 0, GlobalText[3521], 16, 1);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 85, m_Pos.y + 170, 15, 15, 0, GlobalText[3522], 17, 1);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 22, m_Pos.y + 185, 15, 15, 0, GlobalText[3523], 18, 1);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 85, m_Pos.y + 185, 15, 15, 0, GlobalText[3524], 19, 1);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 22, m_Pos.y + 200, 15, 15, 0, GlobalText[3525], 20, 1);
	//--
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 18, m_Pos.y + 80, 15, 15, 0, GlobalText[3591], 21, 2);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 18, m_Pos.y + 97, 15, 15, 0, GlobalText[3592], 23, 2);
	InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 18, m_Pos.y + 125, 15, 15, 0, GlobalText[3594], 22, 2);

	RegisterBoxCharacter(0xFF, 0);
	RegisterBoxCharacter(0xFF, 1);
	RegisterBoxCharacter(0xFF, 2);
	RegisterBoxCharacter(0xFF, 3);
	RegisterBoxCharacter(0xFF, 4);
	RegisterBoxCharacter(0xFF, 8);
	RegisterBoxCharacter(0xFF, 13);
	RegisterBoxCharacter(0xFF, 14);
	RegisterBoxCharacter(0xFF, 15);
	RegisterBoxCharacter(0xFF, 16);
	RegisterBoxCharacter(0xFF, 17);
	RegisterBoxCharacter(0xFF, 19);
	RegisterBoxCharacter(0xFF, 18);
	RegisterBoxCharacter(0xFF, 20);
	RegisterBoxCharacter(0xFF, 21);
	RegisterBoxCharacter(0xFF, 23);
	RegisterBoxCharacter(0xFF, 22);

	RegisterBoxCharacter(Dark_Knight, 5);
	RegisterBoxCharacter(Dark_Knight, 6);
	RegisterBoxCharacter(Dark_Knight, 7);

	RegisterBoxCharacter(Dark_Wizard, 5);
	RegisterBoxCharacter(Dark_Wizard, 6);
	RegisterBoxCharacter(Dark_Wizard, 10);

	RegisterBoxCharacter(Magic_Gladiator, 5);
	RegisterBoxCharacter(Magic_Gladiator, 6);

	RegisterBoxCharacter(Dark_Lord, 9);

	RegisterBoxCharacter(Fairy_Elf, 11);
	RegisterBoxCharacter(Fairy_Elf, 5);
	RegisterBoxCharacter(Fairy_Elf, 6);
	RegisterBoxCharacter(Fairy_Elf, 10);

	RegisterBoxCharacter(Summoner, 5);
	RegisterBoxCharacter(Summoner, 6);
	RegisterBoxCharacter(Summoner, 12);

	RegisterBoxCharacter(Rage_Fighter, 5);
	RegisterBoxCharacter(Rage_Fighter, 6);
}

void SEASON3B::CNewUIMuHelper::InitImage()
{
	InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 17, m_Pos.y + 171, 32, 38, 0, 0);
	InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 61, m_Pos.y + 171, 32, 38, 1, 0);
	InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 61, m_Pos.y + 222, 32, 38, 2, 0);
	InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 21, m_Pos.y + 293, 32, 38, 3, 0);
	InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 55, m_Pos.y + 293, 32, 38, 4, 0);
	InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 89, m_Pos.y + 293, 32, 38, 5, 0);

	InsertTexture(IMAGE_MACROUI_HELPER_INPUTNUMBER, m_Pos.x + 135, m_Pos.y + 137, 28, 15, 6, 0);
	InsertTexture(IMAGE_MACROUI_HELPER_INPUTNUMBER, m_Pos.x + 135, m_Pos.y + 174, 28, 15, 7, 0);
	InsertTexture(IMAGE_MACROUI_HELPER_INPUTNUMBER, m_Pos.x + 135, m_Pos.y + 226, 28, 15, 8, 0);
	InsertTexture(IMAGE_MACROUI_HELPER_INPUTSTRING, m_Pos.x + 34, m_Pos.y + 216, 93, 15, 9, 1);


	RegisterTextureCharacter(0xFF, 0);
	RegisterTextureCharacter(0xFF, 1);
	RegisterTextureCharacter(0xFF, 3);
	RegisterTextureCharacter(0xFF, 4);
	RegisterTextureCharacter(0xFF, 5);
	RegisterTextureCharacter(0xFF, 6);
	RegisterTextureCharacter(0xFF, 7);
	RegisterTextureCharacter(0xFF, 9);


	RegisterTextureCharacter(Dark_Knight, 2);
	RegisterTextureCharacter(Dark_Knight, 8);
	RegisterTextureCharacter(Dark_Wizard, 2);
	RegisterTextureCharacter(Dark_Wizard, 8);
	RegisterTextureCharacter(Fairy_Elf, 2);
	RegisterTextureCharacter(Fairy_Elf, 8);
	RegisterTextureCharacter(Magic_Gladiator, 2);
	RegisterTextureCharacter(Magic_Gladiator, 8);
	RegisterTextureCharacter(Summoner, 2);
	RegisterTextureCharacter(Summoner, 8);
	RegisterTextureCharacter(Rage_Fighter, 2);
	RegisterTextureCharacter(Rage_Fighter, 8);
}

void SEASON3B::CNewUIMuHelper::InitText()
{
	InsertText(m_Pos.x + 18, m_Pos.y + 78, GlobalText[3526], 1, 0);
	InsertText(m_Pos.x + 18, m_Pos.y + 83, "________", 2, 0);
	InsertText(m_Pos.x + 113, m_Pos.y + 141, GlobalText[3527], 3, 0);
	InsertText(m_Pos.x + 162, m_Pos.y + 141, GlobalText[3528], 4, 0);
	InsertText(m_Pos.x + 18, m_Pos.y + 160, GlobalText[3529], 5, 0);
	InsertText(m_Pos.x + 59, m_Pos.y + 160, GlobalText[3530], 7, 0);
	InsertText(m_Pos.x + 162, m_Pos.y + 178, GlobalText[3527], 8, 0);
	InsertText(m_Pos.x + 59, m_Pos.y + 212, GlobalText[3531], 9, 0);
	
	InsertText(m_Pos.x + 162, m_Pos.y + 230, GlobalText[3527], 10, 0);
	InsertText(m_Pos.x + 18, m_Pos.y + 78, GlobalText[3532], 11, 1);
	InsertText(m_Pos.x + 18, m_Pos.y + 83, "________", 12, 1);

	RegisterTextCharacter(0xFF, 1);
	RegisterTextCharacter(0xFF, 2);
	RegisterTextCharacter(0xFF, 3);
	RegisterTextCharacter(0xFF, 4);
	RegisterTextCharacter(0xFF, 5);
	RegisterTextCharacter(0xFF, 7);
	RegisterTextCharacter(0xFF, 8);
	RegisterTextCharacter(0xFF, 11);
	RegisterTextCharacter(0xFF, 12);

	RegisterTextCharacter(Dark_Knight, 9);
	RegisterTextCharacter(Dark_Knight, 10);
	RegisterTextCharacter(Dark_Wizard, 9);
	RegisterTextCharacter(Dark_Wizard, 10);
	RegisterTextCharacter(Fairy_Elf, 9);
	RegisterTextCharacter(Fairy_Elf, 10);
	RegisterTextCharacter(Magic_Gladiator, 9);
	RegisterTextCharacter(Magic_Gladiator, 10);
	RegisterTextCharacter(Summoner, 9);
	RegisterTextCharacter(Summoner, 10);
	RegisterTextCharacter(Rage_Fighter, 9);
	RegisterTextCharacter(Rage_Fighter, 10);
}

bool SEASON3B::CNewUIMuHelper::Update()
{
	if (IsVisible())
	{
		int iNumCurOpenTab = m_TabBtn.UpdateMouseEvent();

		if (iNumCurOpenTab == RADIOGROUPEVENT_NONE)
			return true;

		m_iNumCurOpenTab = iNumCurOpenTab;
	}
	return true;
}

bool SEASON3B::CNewUIMuHelper::UpdateMouseEvent()
{
	/*switch (m_iNumCurOpenTab)
	{
	case TAB_GATE_MANAGING:
		UpdateGateManagingTab();
		break;
	case TAB_STATUE_MANAGING:
		UpdateStatueManagingTab();
		break;
	case TAB_TAX_MANAGING:
		UpdateTaxManagingTab();
		break;
	}

	if (true == BtnProcess())
		return false;*/

	POINT ptExitBtn1 = { m_Pos.x + 169, m_Pos.y + 7 };
	POINT ptExitBtn2 = { m_Pos.x + 13, m_Pos.y + 391 };

	if (SEASON3B::IsRelease(VK_LBUTTON) && CheckMouseIn(ptExitBtn1.x, ptExitBtn1.y, 13, 12))
	{
		g_pNewUISystem->Hide(SEASON3B::INTERFACE_MUHELPER);
	}

	int Identificador = UpdateMouseBtnList();

	if (Identificador == 15)
	{
		g_pNewUISystem->Hide(SEASON3B::INTERFACE_MUHELPER);
		return false;
	}

	UpdateMouseBoxList();


	if (CheckMouseIn(m_Pos.x, m_Pos.y, WINDOW_WIDTH, WINDOW_HEIGHT))
		return false;
	return true;
}

bool SEASON3B::CNewUIMuHelper::UpdateKeyEvent()
{
	if (IsVisible())
	{
		if (SEASON3B::IsPress(VK_ESCAPE) == true)
		{
			g_pNewUISystem->Hide(SEASON3B::INTERFACE_MUHELPER);
			//PlayBuffer(SOUND_CLICK01);

			return false;
		}
	}
	return true;
}

float SEASON3B::CNewUIMuHelper::GetLayerDepth()
{
	return 3.4;
}

float SEASON3B::CNewUIMuHelper::GetKeyEventOrder()
{
	return 3.4;
}

bool SEASON3B::CNewUIMuHelper::Render()
{
	EnableAlphaTest();
	glColor4f(1.f, 1.f, 1.f, 1.f);

	DWORD TextColor = g_pRenderText->GetTextColor();

	g_pRenderText->SetFont(g_hFont);
	g_pRenderText->SetTextColor(0xFFFFFFFF);

	g_pRenderText->SetBgColor(0);


	RenderImage(IMAGE_BASE_WINDOW_BACK, m_Pos.x, m_Pos.y, float(WINDOW_WIDTH), float(WINDOW_HEIGHT));
	RenderImage(IMAGE_BASE_WINDOW_TOP, m_Pos.x, m_Pos.y, float(WINDOW_WIDTH), 64.f);
	RenderImage(IMAGE_BASE_WINDOW_LEFT, m_Pos.x, m_Pos.y + 64.f, 21.f, float(WINDOW_HEIGHT) - 64.f - 45.f);
	RenderImage(IMAGE_BASE_WINDOW_RIGHT, m_Pos.x + float(WINDOW_WIDTH) - 21.f, m_Pos.y + 64.f, 21.f, float(WINDOW_HEIGHT) - 64.f - 45.f);
	RenderImage(IMAGE_BASE_WINDOW_BOTTOM, m_Pos.x, m_Pos.y + float(WINDOW_HEIGHT) - 45.f, float(WINDOW_WIDTH), 45.f);


	g_pRenderText->SetFont(g_hFontBold);

	g_pRenderText->RenderText(m_Pos.x, m_Pos.y + 13, GlobalText[3536], 190, 0, RT3_SORT_CENTER);

	RenderBack(m_Pos.x + 12, m_Pos.y + 340, 165, 46);

	g_pRenderText->SetFont(g_hFont);
	g_pRenderText->RenderText(m_Pos.x + 20, m_Pos.y + 347, GlobalText[3537], 0, 0, RT3_SORT_CENTER);

	g_pRenderText->SetTextColor(0xFF00B4FF);
	g_pRenderText->RenderText(m_Pos.x + 20, m_Pos.y + 365, GlobalText[3538], 0, 0, RT3_SORT_CENTER);

	g_pRenderText->SetTextColor(TextColor);

	int sTapIndex = m_iNumCurOpenTab;

	m_TabBtn.Render();

	if (sTapIndex)
	{
		if (sTapIndex == 1)
		{
			RenderBack(m_Pos.x + 12, m_Pos.y + 73, 68, 50);
			RenderBack(m_Pos.x + 75, m_Pos.y + 73, 102, 50);
			RenderBack(m_Pos.x + 12, m_Pos.y + 120, 165, 30);
			RenderBack(m_Pos.x + 12, m_Pos.y + 147, 165, 195);
			RenderBack(m_Pos.x + 16, m_Pos.y + 235, 158, 74);

			RenderImage(BITMAP_INTERFACE_CRYWOLF_BEGIN + 34, m_Pos.x + 29, m_Pos.y + 92, 15, 19, 0.f, 0.f, 15.f / 16.f, 19.f / 32.f);
		}
		else
		{
			RenderBack(m_Pos.x + 12, m_Pos.y + 73, 165, 50);
			RenderBack(m_Pos.x + 12, m_Pos.y + 120, 165, 222);
		}

	}
	else
	{
		RenderBack(m_Pos.x + 12, m_Pos.y + 73, 68, 50);
		RenderBack(m_Pos.x + 75, m_Pos.y + 73, 102, 50);
		RenderBack(m_Pos.x + 12, m_Pos.y + 120, 165, 39);
		RenderBack(m_Pos.x + 12, m_Pos.y + 156, 165, 120);
		RenderBack(m_Pos.x + 12, m_Pos.y + 273, 165, 69);

		RenderImage(BITMAP_INTERFACE_CRYWOLF_BEGIN + 33, m_Pos.x + 29, m_Pos.y + 92, 15, 19, 0.f, 0.f, 15.f / 16.f, 19.f / 32.f);
	}

	RenderBtnList();
	RenderBoxList();
	RenderTextureList();
	RenderTextList();
	DisableAlphaBlend();

	return true;
}

void SEASON3B::CNewUIMuHelper::RenderBack(int x, int y, int width, int height)
{
	EnableAlphaTest();
	glColor4f(0.0, 0.0, 0.0, 0.4f);
	RenderColor(x+3.f, y+2.f, width-7.f, height-7, 0.0, 0);
	EndRenderColor();

	RenderImage(IMAGE_TABLE_TOP_LEFT, x, y, 14.0, 14.0);
	RenderImage(IMAGE_TABLE_TOP_RIGHT, (x + width) - 14.f, y, 14.0, 14.0);
	RenderImage(IMAGE_TABLE_BOTTOM_LEFT, x, (y + height) - 14.f, 14.0, 14.0);
	RenderImage(IMAGE_TABLE_BOTTOM_RIGHT, (x + width) - 14.f, (y + height) - 14.f, 14.0, 14.0);
	RenderImage(IMAGE_TABLE_TOP_PIXEL, x + 6.f, y, (width - 12.f), 14.0);
	RenderImage(IMAGE_TABLE_RIGHT_PIXEL, (x + width) - 14.f, y + 6.f, 14.0, (height - 14.f));
	RenderImage(IMAGE_TABLE_BOTTOM_PIXEL, x + 6.f, (y + height) - 14.f, (width - 12.f), 14.0);
	RenderImage(IMAGE_TABLE_LEFT_PIXEL, x, (y + 6.f), 14.0, (height - 14.f));
}

void SEASON3B::CNewUIMuHelper::LoadImages()
{
	LoadBitmap("Interface\\MacroUI\\MacroUI_RangeMinus.tga", IMAGE_MACROUI_HELPER_RAGEMINUS, GL_LINEAR, GL_CLAMP, 1, 0);
	LoadBitmap("Interface\\MacroUI\\MacroUI_OptionButton.tga", IMAGE_MACROUI_HELPER_OPTIONBUTTON, GL_LINEAR, GL_CLAMP, 1, 0);
	LoadBitmap("Interface\\MacroUI\\MacroUI_InputNumber.tga", IMAGE_MACROUI_HELPER_INPUTNUMBER, GL_LINEAR, GL_CLAMP, 1, 0);
	LoadBitmap("Interface\\MacroUI\\MacroUI_InputString.tga", IMAGE_MACROUI_HELPER_INPUTSTRING, GL_LINEAR, GL_CLAMP, 1, 0);
	//--
	LoadBitmap("Interface\\InGameShop\\Ingame_Bt03.tga", IMAGE_IGS_BUTTON, GL_LINEAR, GL_CLAMP, 1, 0);

}

void SEASON3B::CNewUIMuHelper::UnloadImages()
{
	DeleteBitmap(IMAGE_MACROUI_HELPER_RAGEMINUS);
	DeleteBitmap(IMAGE_MACROUI_HELPER_OPTIONBUTTON);
	DeleteBitmap(IMAGE_MACROUI_HELPER_INPUTNUMBER);
	DeleteBitmap(IMAGE_MACROUI_HELPER_INPUTSTRING);
	//--
	DeleteBitmap(IMAGE_IGS_BUTTON);
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RegisterButton(int Identificador, CButtonTap button)
{
	m_ButtonList.insert(std::pair<int, CButtonTap>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::RegisterBtnCharacter(BYTE class_character, int Identificador)
{
	cButtonMap::iterator li = m_ButtonList.find(Identificador);

	if (li != m_ButtonList.end())
	{
		CButtonTap* cBTN = &li->second;
		if (class_character >= 0 && class_character < max_class_s6+2)
		{
			cBTN->class_character[class_character] = TRUE;
		}
		else
		{
			memset(cBTN->class_character, 1, sizeof(cBTN->class_character));
		}
	}
}

void SEASON3B::CNewUIMuHelper::InsertButton(int imgindex, int x, int y, int sx, int sy, bool overflg, bool isimgwidth, bool bClickEffect, bool MoveTxt, unicode::t_string btname, unicode::t_string tooltiptext, int Identificador, int iNumTab)
{
	CButtonTap cBTN;
	CNewUIButton* button = new CNewUIButton();

	button->ChangeButtonImgState(1, imgindex, overflg, isimgwidth, bClickEffect);
	button->ChangeButtonInfo(x, y, sx, sy);

	button->ChangeText(btname);
	button->ChangeToolTipText(tooltiptext, TRUE);

	if (MoveTxt)
	{
		button->MoveTextPos(0, -1);
	}

	cBTN.btn = button;
	cBTN.iNumTab = iNumTab;
	memset(cBTN.class_character, 0, sizeof(cBTN.class_character));

	RegisterButton(Identificador, cBTN);
}

void SEASON3B::CNewUIMuHelper::RenderBtnList()
{
	cButtonMap::iterator li = m_ButtonList.begin();

	for (; li != m_ButtonList.end(); li++)
	{
		CButtonTap* cBTN = &li->second;

		if ((cBTN->class_character[(0xF & Hero->Class)]) && (cBTN->iNumTab == m_iNumCurOpenTab || cBTN->iNumTab == -1))
		{
			cBTN->btn->Render();
		}
	}
}

int SEASON3B::CNewUIMuHelper::UpdateMouseBtnList()
{
	int Identificador = -1;

	cButtonMap::iterator li = m_ButtonList.begin();

	for (; li != m_ButtonList.end(); li++)
	{
		CButtonTap* cBTN = &li->second;

		if ((cBTN->class_character[(0xF & Hero->Class)]) && (cBTN->iNumTab == m_iNumCurOpenTab || cBTN->iNumTab == -1))
		{
			if (cBTN->btn->UpdateMouseEvent())
			{
				return li->first;
			}
		}
	}
	return Identificador;
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RegisterBoxCharacter(BYTE class_character, int Identificador)
{
	cCheckBoxMap::iterator li = m_CheckBoxList.find(Identificador);

	if (li != m_CheckBoxList.end())
	{
		CheckBoxTap* cBOX = &li->second;

		if (class_character >= 0 && class_character < max_class_s6 + 2)
		{
			cBOX->class_character[class_character] = TRUE;
		}
		else
		{
			memset(cBOX->class_character, 1, sizeof(cBOX->class_character));
		}
	}
}

void SEASON3B::CNewUIMuHelper::RegisterCheckBox(int Identificador, CheckBoxTap button)
{
	m_CheckBoxList.insert(std::pair<int, CheckBoxTap>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::InsertCheckBox(int imgindex, int x, int y, int sx, int sy, bool overflg, unicode::t_string btname, int Identificador, int iNumTab)
{
	CheckBoxTap cBOX;

	CNewUICheckBox* cbox = new CNewUICheckBox;

	cbox->CheckBoxImgState(imgindex);
	cbox->CheckBoxInfo(x, y, sx, sy);

	cbox->ChangeText(btname);
	cbox->RegisterBoxState(overflg);

	cBOX.box = cbox;
	cBOX.iNumTab = iNumTab;
	memset(cBOX.class_character, 0, sizeof(cBOX.class_character));

	RegisterCheckBox(Identificador, cBOX);
}

void SEASON3B::CNewUIMuHelper::RenderBoxList()
{
	cCheckBoxMap::iterator li = m_CheckBoxList.begin();

	for (; li != m_CheckBoxList.end(); li++)
	{
		CheckBoxTap* cBOX = &li->second;

		if ((cBOX->class_character[(0xF & Hero->Class)]) && (cBOX->iNumTab == m_iNumCurOpenTab || cBOX->iNumTab == -1))
		{
			cBOX->box->Render();
		}
	}
}

int SEASON3B::CNewUIMuHelper::UpdateMouseBoxList()
{
	int Identificador = -1;

	cCheckBoxMap::iterator li = m_CheckBoxList.begin();

	for (; li != m_CheckBoxList.end(); li++)
	{
		CheckBoxTap* cBOX = &li->second;

		if ((cBOX->class_character[(0xF & Hero->Class)]) && (cBOX->iNumTab == m_iNumCurOpenTab || cBOX->iNumTab == -1))
		{
			if (cBOX->box->UpdateMouseEvent())
			{
				return li->first;
			}
		}
	}
	return Identificador;
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RenderTextureList()
{
	cTextureMap::iterator li = m_TextureList.begin();

	for (; li != m_TextureList.end(); li++)
	{
		cTexture* cImage = &li->second;

		if ((cImage->class_character[(0xF & Hero->Class)]) && (cImage->iNumTab == m_iNumCurOpenTab || cImage->iNumTab == -1))
		{
			RenderImage(cImage->s_ImgIndex, cImage->m_Pos.x, cImage->m_Pos.y, cImage->m_Size.x, cImage->m_Size.y);
		}
	}
}

int SEASON3B::CNewUIMuHelper::UpdateTextureList()
{
	int Identificador = -1;

	cTextureMap::iterator li = m_TextureList.begin();

	for (; li != m_TextureList.end(); li++)
	{
		cTexture* cImage = &li->second;

		if ((cImage->class_character[(0xF & Hero->Class)]) && (cImage->iNumTab == m_iNumCurOpenTab || cImage->iNumTab == -1))
		{
			if (CheckMouseIn(cImage->m_Pos.x, cImage->m_Pos.y, cImage->m_Size.x, cImage->m_Size.y))
			{
				return li->first;
			}
		}
	}

	return Identificador;
}

void SEASON3B::CNewUIMuHelper::RegisterTextureCharacter(BYTE class_character, int Identificador)
{
	cTextureMap::iterator li = m_TextureList.find(Identificador);

	if (li != m_TextureList.end())
	{
		cTexture* cImage = &li->second;

		if (class_character >= 0 && class_character < max_class_s6 + 2)
		{
			cImage->class_character[class_character] = TRUE;
		}
		else
		{
			memset(cImage->class_character, 1, sizeof(cImage->class_character));
		}
	}
}

void SEASON3B::CNewUIMuHelper::RegisterTexture(int Identificador, cTexture button)
{
	m_TextureList.insert(std::pair<int, cTexture>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::InsertTexture(int imgindex, int x, int y, int sx, int sy, int Identificador, int iNumTab)
{
	cTexture cImage;

	cImage.s_ImgIndex = imgindex;
	cImage.m_Pos.x = x;
	cImage.m_Pos.y = y;
	cImage.m_Size.x = sx;
	cImage.m_Size.y = sy;
	cImage.iNumTab = iNumTab;

	memset(cImage.class_character, 0, sizeof(cImage.class_character));

	RegisterTexture(Identificador, cImage);
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RenderTextList()
{
	cTextNameMap::iterator li = m_TextNameList.begin();

	for (; li != m_TextNameList.end(); li++)
	{
		cTextName* cImage = &li->second;

		if ((cImage->class_character[(0xF & Hero->Class)]) && (cImage->iNumTab == m_iNumCurOpenTab || cImage->iNumTab == -1))
		{
			g_pRenderText->RenderText(cImage->m_Pos.x, cImage->m_Pos.y, cImage->m_Name.c_str());
		}
	}
}

void SEASON3B::CNewUIMuHelper::RegisterTextCharacter(BYTE class_character, int Identificador)
{
	cTextNameMap::iterator li = m_TextNameList.find(Identificador);

	if (li != m_TextNameList.end())
	{
		cTextName* cImage = &li->second;

		if (class_character >= 0 && class_character < max_class_s6 + 2)
		{
			cImage->class_character[class_character] = TRUE;
		}
		else
		{
			memset(cImage->class_character, 1, sizeof(cImage->class_character));
		}
	}
}

void SEASON3B::CNewUIMuHelper::RegisterTextur(int Identificador, cTextName button)
{
	m_TextNameList.insert(std::pair<int, cTextName>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::InsertText(int x, int y, unicode::t_string Name, int Identificador, int iNumTab)
{
	cTextName cText;

	cText.m_Pos.x = x;
	cText.m_Pos.y = y;
	cText.m_Name = Name;
	cText.iNumTab = iNumTab;

	memset(cText.class_character, 0, sizeof(cText.class_character));
	RegisterTextur(Identificador, cText);
}
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Jul 18, 2015
Messages
51
Reaction score
5
wFjyuq0 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums


By takumi12

MUHELPER

NewUIMuHelper.h
Code:
#pragma once
#include "NewUIBase.h"
#include "NewUIManager.h"
#include "NewUIButton.h"

namespace SEASON3B
{
    class CNewUIMuHelper : public CNewUIObj
    {
    public:
        enum IMAGE_LIST
        {

            IMAGE_BASE_WINDOW_BACK = CNewUIMessageBoxMng::IMAGE_MSGBOX_BACK,                //. newui_msgbox_back.jpg
            IMAGE_BASE_WINDOW_TOP = CNewUIMyInventory::IMAGE_INVENTORY_BACK_TOP,            //. newui_item_back01.tga    (190,64)
            IMAGE_BASE_WINDOW_LEFT = CNewUIMyInventory::IMAGE_INVENTORY_BACK_LEFT,        //. newui_item_back02-l.tga    (21,320)
            IMAGE_BASE_WINDOW_RIGHT = CNewUIMyInventory::IMAGE_INVENTORY_BACK_RIGHT,        //. newui_item_back02-r.tga    (21,320)
            IMAGE_BASE_WINDOW_BOTTOM = CNewUIMyInventory::IMAGE_INVENTORY_BACK_BOTTOM,    //. newui_item_back03.tga    (190,45)
            IMAGE_BASE_WINDOW_BTN_EXIT = CNewUIMyInventory::IMAGE_INVENTORY_EXIT_BTN,        //. newui_exit_00.tga
            //--
            IMAGE_TABLE_TOP_LEFT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_TOP_LEFT,            //. newui_item_table01(L).tga (14,14)
            IMAGE_TABLE_TOP_RIGHT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_TOP_RIGHT,            //. newui_item_table01(R).tga (14,14)
            IMAGE_TABLE_BOTTOM_LEFT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_BOTTOM_LEFT,        //. newui_item_table02(L).tga (14,14)
            IMAGE_TABLE_BOTTOM_RIGHT = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_BOTTOM_RIGHT,    //. newui_item_table02(R).tga (14,14)
            IMAGE_TABLE_TOP_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_TOP_PIXEL,            //. newui_item_table03(up).tga (1, 14)
            IMAGE_TABLE_BOTTOM_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_BOTTOM_PIXEL,    //. newui_item_table03(dw).tga (1,14)
            IMAGE_TABLE_LEFT_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_LEFT_PIXEL,        //. newui_item_table03(L).tga (14,1)
            IMAGE_TABLE_RIGHT_PIXEL = CNewUIInventoryCtrl::IMAGE_ITEM_TABLE_RIGHT_PIXEL,        //. newui_item_table03(R).tga (14,1)
            //--
            IMAGE_WINDOW_TAB_BTN = CNewUIGuildInfoWindow::IMAGE_GUILDINFO_TAB_BUTTON,
            //--
            IMAGE_MACROUI_HELPER_RAGEMINUS = BITMAP_INTERFACE_MACROUI_BEGIN,        // newui_position02.tga            (70, 25)    
            IMAGE_MACROUI_HELPER_OPTIONBUTTON = BITMAP_INTERFACE_MACROUI_BEGIN+1,        // newui_position02.tga            (70, 25)    
            IMAGE_MACROUI_HELPER_INPUTNUMBER = BITMAP_INTERFACE_MACROUI_BEGIN+2,
            IMAGE_MACROUI_HELPER_INPUTSTRING = BITMAP_INTERFACE_MACROUI_BEGIN+3,
            //-- Buttons
            IMAGE_CHAINFO_BTN_STAT = BITMAP_INTERFACE_NEW_CHAINFO_WINDOW_BEGIN + 1,
            IMAGE_CLEARNESS_BTN = BITMAP_CURSEDTEMPLE_BEGIN+4,
            IMAGE_IGS_BUTTON = BITMAP_IGS_MSGBOX_BUTTON,

        };
    private:
        enum PARTY_WINDOW_SIZE
        {
            WINDOW_WIDTH = 190,
            WINDOW_HEIGHT = 429,
        };
        typedef struct
        {
            int iNumTab;
            BYTE class_character[max_class_s6+2];
            CNewUIButton* btn;
        } CButtonTap;

        typedef struct
        {
            int iNumTab;
            BYTE class_character[max_class_s6+2];
            CNewUICheckBox* box;
        } CheckBoxTap;

        typedef struct
        {
            int iNumTab;
            int s_ImgIndex;
            POINT m_Pos;
            POINT m_Size;
            BYTE class_character[max_class_s6 + 2];
        } cTexture;

        typedef struct
        {
            int iNumTab;
            POINT m_Pos;
            unicode::t_string m_Name;
            BYTE class_character[max_class_s6 + 2];
        } cTextName;

        typedef std::map<int, CButtonTap> cButtonMap;
        typedef std::map<int, CheckBoxTap> cCheckBoxMap;
        typedef std::map<int, cTexture> cTextureMap;
        typedef std::map<int, cTextName> cTextNameMap;

    private:
        CNewUIManager* m_pNewUIMng;
        POINT                    m_Pos;
        CNewUIRadioGroupButton    m_TabBtn;
        int                        m_iNumCurOpenTab;
        cButtonMap                m_ButtonList;
        cCheckBoxMap            m_CheckBoxList;
        cTextureMap                m_TextureList;
        cTextNameMap            m_TextNameList;
    public:
        void RenderBtnList();
        int UpdateMouseBtnList();
        void RegisterBtnCharacter(BYTE class_character, int Identificador);
        void RegisterButton(int Identificador, CButtonTap button);
        void InsertButton(int imgindex, int x, int y, int sx, int sy, bool overflg, bool isimgwidth, bool bClickEffect, bool MoveTxt, unicode::t_string btname, unicode::t_string tooltiptext, int Identificador, int iNumTab);
        //--
        void RenderBoxList();
        int UpdateMouseBoxList();
        void RegisterBoxCharacter(BYTE class_character, int Identificador);
        void RegisterCheckBox(int Identificador, CheckBoxTap button);
        void InsertCheckBox(int imgindex, int x, int y, int sx, int sy, bool overflg, unicode::t_string btname, int Identificador, int iNumTab);
        //--
        void RenderTextureList();
        int UpdateTextureList();
        void RegisterTextureCharacter(BYTE class_character, int Identificador);
        void RegisterTexture(int Identificador, cTexture button);
        void InsertTexture(int imgindex, int x, int y, int sx, int sy, int Identificador, int iNumTab);
        //--
        void RenderTextList();
        void RegisterTextCharacter(BYTE class_character, int Identificador);
        void RegisterTextur(int Identificador, cTextName button);
        void InsertText(int x, int y, unicode::t_string Name, int Identificador, int iNumTab);
    public:
        CNewUIMuHelper();
        virtual ~CNewUIMuHelper();

        bool Create(CNewUIManager* pNewUIMng, int x, int y);
        void Release();

        bool Render();
        bool Update();
        bool UpdateMouseEvent();
        bool UpdateKeyEvent();

        float GetLayerDepth();
        float GetKeyEventOrder();

        void InitText();
        void InitImage();
        void InitButtons();
        void InitCheckBox();
        void SetPos(int x, int y);
        void RenderBack(int x, int y, int width, int height);

    private:
        void LoadImages();
        void UnloadImages();
    };

}

NewUIMuHelper.cpp
Code:
#include "stdafx.h"
#include "NewUISystem.h"

#include "NewUIMuHelper.h"


SEASON3B::CNewUIMuHelper::CNewUIMuHelper()
{
    m_pNewUIMng = NULL;
    m_Pos.x = m_Pos.y = 0;
    m_ButtonList.clear();
    m_iNumCurOpenTab = 0;
}

SEASON3B::CNewUIMuHelper::~CNewUIMuHelper()
{
    Release();
}

bool SEASON3B::CNewUIMuHelper::Create(CNewUIManager* pNewUIMng, int x, int y)
{
    if (NULL == pNewUIMng)
        return false;

    m_pNewUIMng = pNewUIMng;
    m_pNewUIMng->AddUIObj(SEASON3B::INTERFACE_MUHELPER, this);

    SetPos(x, y);

    LoadImages();

    InitButtons();

    InitCheckBox();

    InitImage();

    InitText();

    Show(false);

    return true;
}

void SEASON3B::CNewUIMuHelper::Release()
{
    UnloadImages();

    if (m_pNewUIMng)
    {
        m_pNewUIMng->RemoveUIObj(this);
        m_pNewUIMng = NULL;
    }
}

void SEASON3B::CNewUIMuHelper::SetPos(int x, int y)
{
    m_Pos.x = x;
    m_Pos.y = y;
}

void SEASON3B::CNewUIMuHelper::InitButtons()
{
    std::list<unicode::t_string> ltext;
    ltext.push_back(GlobalText[3500]);
    ltext.push_back(GlobalText[3501]);
    ltext.push_back(GlobalText[3590]);

    m_TabBtn.CreateRadioGroup(3, IMAGE_WINDOW_TAB_BTN, TRUE);
    m_TabBtn.ChangeRadioText(ltext);
    m_TabBtn.ChangeRadioButtonInfo(true, m_Pos.x + 10.f, m_Pos.y + 48.f, 56, 22);
    m_TabBtn.ChangeFrame(m_iNumCurOpenTab);

    InsertButton(IMAGE_CHAINFO_BTN_STAT, m_Pos.x + 56, m_Pos.y + 78, 16, 15, 0, 0, 0, 0, "", "", 0, 0);
    InsertButton(IMAGE_MACROUI_HELPER_RAGEMINUS, m_Pos.x + 56, m_Pos.y + 97, 16, 15, 0, 0, 0, 0, "", "", 1, 0);
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 191, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 2, 0); //-- skill 2
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 243, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 3, 0); //-- skill 3
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 84, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 4, 0); //-- Buff
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 79, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 5, 0); //-- potion
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 84, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 6, 0); //-- potion
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 17, m_Pos.y + 234, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 7, 0); //-- potion
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 17, m_Pos.y + 234, 38, 24, 1, 0, 1, 1, GlobalText[3502], "", 8, 0); //-- potion
    InsertButton(IMAGE_CHAINFO_BTN_STAT, m_Pos.x + 56, m_Pos.y + 78, 16, 15, 0, 0, 0, 0, "", "", 9, 1);
    InsertButton(IMAGE_MACROUI_HELPER_RAGEMINUS, m_Pos.x + 56, m_Pos.y + 97, 16, 15, 0, 0, 0, 0, "", "", 10, 1);
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 208, 38, 24, 1, 0, 1, 1, GlobalText[3505], "", 11, 1); //-- Buff
    InsertButton(IMAGE_CLEARNESS_BTN, m_Pos.x + 132, m_Pos.y + 309, 38, 24, 1, 0, 1, 1, GlobalText[3506], "", 12, 1); //-- Buff
    //--
    InsertButton(IMAGE_IGS_BUTTON, m_Pos.x + 120, m_Pos.y + 388, 52, 26, 1, 0, 1, 1, GlobalText[3503], "", 13, -1);
    InsertButton(IMAGE_IGS_BUTTON, m_Pos.x + 65, m_Pos.y + 388, 52, 26, 1, 0, 1, 1, GlobalText[3504], "", 14, -1);
    InsertButton(IMAGE_BASE_WINDOW_BTN_EXIT, m_Pos.x + 20, m_Pos.y + 388, 36, 29, 0, 0, 0, 0, "", GlobalText[388], 15, -1);

    RegisterBtnCharacter(0xFF, 0);
    RegisterBtnCharacter(0xFF, 1);
    RegisterBtnCharacter(0xFF, 2);
    RegisterBtnCharacter(0xFF, 9);
    RegisterBtnCharacter(0xFF, 10);
    RegisterBtnCharacter(0xFF, 11);
    RegisterBtnCharacter(0xFF, 12);
    RegisterBtnCharacter(0xFF, 13);
    RegisterBtnCharacter(0xFF, 15);
    RegisterBtnCharacter(0xFF, 14);

    RegisterBtnCharacter(Dark_Knight, 3);
    RegisterBtnCharacter(Dark_Knight, 6);

    RegisterBtnCharacter(Dark_Wizard, 3);
    RegisterBtnCharacter(Dark_Wizard, 6);
    RegisterBtnCharacter(Dark_Wizard, 7);

    RegisterBtnCharacter(Magic_Gladiator, 3);
    RegisterBtnCharacter(Magic_Gladiator, 6);
    RegisterBtnCharacter(Dark_Lord, 6);

    RegisterBtnCharacter(Rage_Fighter, 3);
    RegisterBtnCharacter(Rage_Fighter, 6);

    RegisterBtnCharacter(Fairy_Elf, 3);
    RegisterBtnCharacter(Fairy_Elf, 4);
    RegisterBtnCharacter(Fairy_Elf, 8);

    RegisterBtnCharacter(Summoner, 3);
    RegisterBtnCharacter(Summoner, 5);
}

void SEASON3B::CNewUIMuHelper::InitCheckBox()
{
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 79, m_Pos.y + 80, 15, 15, 0, GlobalText[3507], 0, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 18, m_Pos.y + 122, 15, 15, 0, GlobalText[3508], 1, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 18, m_Pos.y + 137, 15, 15, 0, GlobalText[3509], 2, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 174, 15, 15, 0, GlobalText[3510], 3, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 191, 15, 15, 0, GlobalText[3511], 4, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 226, 15, 15, 0, GlobalText[3510], 5, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 94, m_Pos.y + 243, 15, 15, 0, GlobalText[3511], 6, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 18, m_Pos.y + 226, 15, 15, 0, GlobalText[3512], 7, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 25, m_Pos.y + 276, 15, 15, 0, GlobalText[3513], 8, 0);

    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 60, m_Pos.y + 218, 15, 15, 0, GlobalText[3514], 9, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 15, m_Pos.y + 218, 15, 15, 0, GlobalText[3515], 10, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 79, m_Pos.y + 97, 15, 15, 0, GlobalText[3516], 11, 0);
    InsertCheckBox(BITMAP_OPTION_BEGIN + 5, m_Pos.x + 79, m_Pos.y + 97, 15, 15, 0, GlobalText[3517], 12, 0);

    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 79, m_Pos.y + 80, 15, 15, 0, GlobalText[3518], 13, 1);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 17, m_Pos.y + 125, 15, 15, 0, GlobalText[3519], 14, 1);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 17, m_Pos.y + 152, 15, 15, 0, GlobalText[3520], 15, 1);

    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 22, m_Pos.y + 170, 15, 15, 0, GlobalText[3521], 16, 1);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 85, m_Pos.y + 170, 15, 15, 0, GlobalText[3522], 17, 1);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 22, m_Pos.y + 185, 15, 15, 0, GlobalText[3523], 18, 1);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 85, m_Pos.y + 185, 15, 15, 0, GlobalText[3524], 19, 1);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 22, m_Pos.y + 200, 15, 15, 0, GlobalText[3525], 20, 1);
    //--
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 18, m_Pos.y + 80, 15, 15, 0, GlobalText[3591], 21, 2);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 18, m_Pos.y + 97, 15, 15, 0, GlobalText[3592], 23, 2);
    InsertCheckBox(BITMAP_OPTION_BEGIN+5, m_Pos.x + 18, m_Pos.y + 125, 15, 15, 0, GlobalText[3594], 22, 2);

    RegisterBoxCharacter(0xFF, 0);
    RegisterBoxCharacter(0xFF, 1);
    RegisterBoxCharacter(0xFF, 2);
    RegisterBoxCharacter(0xFF, 3);
    RegisterBoxCharacter(0xFF, 4);
    RegisterBoxCharacter(0xFF, 8);
    RegisterBoxCharacter(0xFF, 13);
    RegisterBoxCharacter(0xFF, 14);
    RegisterBoxCharacter(0xFF, 15);
    RegisterBoxCharacter(0xFF, 16);
    RegisterBoxCharacter(0xFF, 17);
    RegisterBoxCharacter(0xFF, 19);
    RegisterBoxCharacter(0xFF, 18);
    RegisterBoxCharacter(0xFF, 20);
    RegisterBoxCharacter(0xFF, 21);
    RegisterBoxCharacter(0xFF, 23);
    RegisterBoxCharacter(0xFF, 22);

    RegisterBoxCharacter(Dark_Knight, 5);
    RegisterBoxCharacter(Dark_Knight, 6);
    RegisterBoxCharacter(Dark_Knight, 7);

    RegisterBoxCharacter(Dark_Wizard, 5);
    RegisterBoxCharacter(Dark_Wizard, 6);
    RegisterBoxCharacter(Dark_Wizard, 10);

    RegisterBoxCharacter(Magic_Gladiator, 5);
    RegisterBoxCharacter(Magic_Gladiator, 6);

    RegisterBoxCharacter(Dark_Lord, 9);

    RegisterBoxCharacter(Fairy_Elf, 11);
    RegisterBoxCharacter(Fairy_Elf, 5);
    RegisterBoxCharacter(Fairy_Elf, 6);
    RegisterBoxCharacter(Fairy_Elf, 10);

    RegisterBoxCharacter(Summoner, 5);
    RegisterBoxCharacter(Summoner, 6);
    RegisterBoxCharacter(Summoner, 12);

    RegisterBoxCharacter(Rage_Fighter, 5);
    RegisterBoxCharacter(Rage_Fighter, 6);
}

void SEASON3B::CNewUIMuHelper::InitImage()
{
    InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 17, m_Pos.y + 171, 32, 38, 0, 0);
    InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 61, m_Pos.y + 171, 32, 38, 1, 0);
    InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 61, m_Pos.y + 222, 32, 38, 2, 0);
    InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 21, m_Pos.y + 293, 32, 38, 3, 0);
    InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 55, m_Pos.y + 293, 32, 38, 4, 0);
    InsertTexture(BITMAP_INTERFACE_NEW_SKILLICON_BEGIN + 4, m_Pos.x + 89, m_Pos.y + 293, 32, 38, 5, 0);

    InsertTexture(IMAGE_MACROUI_HELPER_INPUTNUMBER, m_Pos.x + 135, m_Pos.y + 137, 28, 15, 6, 0);
    InsertTexture(IMAGE_MACROUI_HELPER_INPUTNUMBER, m_Pos.x + 135, m_Pos.y + 174, 28, 15, 7, 0);
    InsertTexture(IMAGE_MACROUI_HELPER_INPUTNUMBER, m_Pos.x + 135, m_Pos.y + 226, 28, 15, 8, 0);
    InsertTexture(IMAGE_MACROUI_HELPER_INPUTSTRING, m_Pos.x + 34, m_Pos.y + 216, 93, 15, 9, 1);


    RegisterTextureCharacter(0xFF, 0);
    RegisterTextureCharacter(0xFF, 1);
    RegisterTextureCharacter(0xFF, 3);
    RegisterTextureCharacter(0xFF, 4);
    RegisterTextureCharacter(0xFF, 5);
    RegisterTextureCharacter(0xFF, 6);
    RegisterTextureCharacter(0xFF, 7);
    RegisterTextureCharacter(0xFF, 9);


    RegisterTextureCharacter(Dark_Knight, 2);
    RegisterTextureCharacter(Dark_Knight, 8);
    RegisterTextureCharacter(Dark_Wizard, 2);
    RegisterTextureCharacter(Dark_Wizard, 8);
    RegisterTextureCharacter(Fairy_Elf, 2);
    RegisterTextureCharacter(Fairy_Elf, 8);
    RegisterTextureCharacter(Magic_Gladiator, 2);
    RegisterTextureCharacter(Magic_Gladiator, 8);
    RegisterTextureCharacter(Summoner, 2);
    RegisterTextureCharacter(Summoner, 8);
    RegisterTextureCharacter(Rage_Fighter, 2);
    RegisterTextureCharacter(Rage_Fighter, 8);
}

void SEASON3B::CNewUIMuHelper::InitText()
{
    InsertText(m_Pos.x + 18, m_Pos.y + 78, GlobalText[3526], 1, 0);
    InsertText(m_Pos.x + 18, m_Pos.y + 83, "________", 2, 0);
    InsertText(m_Pos.x + 113, m_Pos.y + 141, GlobalText[3527], 3, 0);
    InsertText(m_Pos.x + 162, m_Pos.y + 141, GlobalText[3528], 4, 0);
    InsertText(m_Pos.x + 18, m_Pos.y + 160, GlobalText[3529], 5, 0);
    InsertText(m_Pos.x + 59, m_Pos.y + 160, GlobalText[3530], 7, 0);
    InsertText(m_Pos.x + 162, m_Pos.y + 178, GlobalText[3527], 8, 0);
    InsertText(m_Pos.x + 59, m_Pos.y + 212, GlobalText[3531], 9, 0);
    
    InsertText(m_Pos.x + 162, m_Pos.y + 230, GlobalText[3527], 10, 0);
    InsertText(m_Pos.x + 18, m_Pos.y + 78, GlobalText[3532], 11, 1);
    InsertText(m_Pos.x + 18, m_Pos.y + 83, "________", 12, 1);

    RegisterTextCharacter(0xFF, 1);
    RegisterTextCharacter(0xFF, 2);
    RegisterTextCharacter(0xFF, 3);
    RegisterTextCharacter(0xFF, 4);
    RegisterTextCharacter(0xFF, 5);
    RegisterTextCharacter(0xFF, 7);
    RegisterTextCharacter(0xFF, 8);
    RegisterTextCharacter(0xFF, 11);
    RegisterTextCharacter(0xFF, 12);

    RegisterTextCharacter(Dark_Knight, 9);
    RegisterTextCharacter(Dark_Knight, 10);
    RegisterTextCharacter(Dark_Wizard, 9);
    RegisterTextCharacter(Dark_Wizard, 10);
    RegisterTextCharacter(Fairy_Elf, 9);
    RegisterTextCharacter(Fairy_Elf, 10);
    RegisterTextCharacter(Magic_Gladiator, 9);
    RegisterTextCharacter(Magic_Gladiator, 10);
    RegisterTextCharacter(Summoner, 9);
    RegisterTextCharacter(Summoner, 10);
    RegisterTextCharacter(Rage_Fighter, 9);
    RegisterTextCharacter(Rage_Fighter, 10);
}

bool SEASON3B::CNewUIMuHelper::Update()
{
    if (IsVisible())
    {
        int iNumCurOpenTab = m_TabBtn.UpdateMouseEvent();

        if (iNumCurOpenTab == RADIOGROUPEVENT_NONE)
            return true;

        m_iNumCurOpenTab = iNumCurOpenTab;
    }
    return true;
}

bool SEASON3B::CNewUIMuHelper::UpdateMouseEvent()
{
    /*switch (m_iNumCurOpenTab)
    {
    case TAB_GATE_MANAGING:
        UpdateGateManagingTab();
        break;
    case TAB_STATUE_MANAGING:
        UpdateStatueManagingTab();
        break;
    case TAB_TAX_MANAGING:
        UpdateTaxManagingTab();
        break;
    }

    if (true == BtnProcess())
        return false;*/

    POINT ptExitBtn1 = { m_Pos.x + 169, m_Pos.y + 7 };
    POINT ptExitBtn2 = { m_Pos.x + 13, m_Pos.y + 391 };

    if (SEASON3B::IsRelease(VK_LBUTTON) && CheckMouseIn(ptExitBtn1.x, ptExitBtn1.y, 13, 12))
    {
        g_pNewUISystem->Hide(SEASON3B::INTERFACE_MUHELPER);
    }

    int Identificador = UpdateMouseBtnList();

    if (Identificador == 15)
    {
        g_pNewUISystem->Hide(SEASON3B::INTERFACE_MUHELPER);
        return false;
    }

    UpdateMouseBoxList();


    if (CheckMouseIn(m_Pos.x, m_Pos.y, WINDOW_WIDTH, WINDOW_HEIGHT))
        return false;
    return true;
}

bool SEASON3B::CNewUIMuHelper::UpdateKeyEvent()
{
    if (IsVisible())
    {
        if (SEASON3B::IsPress(VK_ESCAPE) == true)
        {
            g_pNewUISystem->Hide(SEASON3B::INTERFACE_MUHELPER);
            //PlayBuffer(SOUND_CLICK01);

            return false;
        }
    }
    return true;
}

float SEASON3B::CNewUIMuHelper::GetLayerDepth()
{
    return 3.4;
}

float SEASON3B::CNewUIMuHelper::GetKeyEventOrder()
{
    return 3.4;
}

bool SEASON3B::CNewUIMuHelper::Render()
{
    EnableAlphaTest();
    glColor4f(1.f, 1.f, 1.f, 1.f);

    DWORD TextColor = g_pRenderText->GetTextColor();

    g_pRenderText->SetFont(g_hFont);
    g_pRenderText->SetTextColor(0xFFFFFFFF);

    g_pRenderText->SetBgColor(0);


    RenderImage(IMAGE_BASE_WINDOW_BACK, m_Pos.x, m_Pos.y, float(WINDOW_WIDTH), float(WINDOW_HEIGHT));
    RenderImage(IMAGE_BASE_WINDOW_TOP, m_Pos.x, m_Pos.y, float(WINDOW_WIDTH), 64.f);
    RenderImage(IMAGE_BASE_WINDOW_LEFT, m_Pos.x, m_Pos.y + 64.f, 21.f, float(WINDOW_HEIGHT) - 64.f - 45.f);
    RenderImage(IMAGE_BASE_WINDOW_RIGHT, m_Pos.x + float(WINDOW_WIDTH) - 21.f, m_Pos.y + 64.f, 21.f, float(WINDOW_HEIGHT) - 64.f - 45.f);
    RenderImage(IMAGE_BASE_WINDOW_BOTTOM, m_Pos.x, m_Pos.y + float(WINDOW_HEIGHT) - 45.f, float(WINDOW_WIDTH), 45.f);


    g_pRenderText->SetFont(g_hFontBold);

    g_pRenderText->RenderText(m_Pos.x, m_Pos.y + 13, GlobalText[3536], 190, 0, RT3_SORT_CENTER);

    RenderBack(m_Pos.x + 12, m_Pos.y + 340, 165, 46);

    g_pRenderText->SetFont(g_hFont);
    g_pRenderText->RenderText(m_Pos.x + 20, m_Pos.y + 347, GlobalText[3537], 0, 0, RT3_SORT_CENTER);

    g_pRenderText->SetTextColor(0xFF00B4FF);
    g_pRenderText->RenderText(m_Pos.x + 20, m_Pos.y + 365, GlobalText[3538], 0, 0, RT3_SORT_CENTER);

    g_pRenderText->SetTextColor(TextColor);

    int sTapIndex = m_iNumCurOpenTab;

    m_TabBtn.Render();

    if (sTapIndex)
    {
        if (sTapIndex == 1)
        {
            RenderBack(m_Pos.x + 12, m_Pos.y + 73, 68, 50);
            RenderBack(m_Pos.x + 75, m_Pos.y + 73, 102, 50);
            RenderBack(m_Pos.x + 12, m_Pos.y + 120, 165, 30);
            RenderBack(m_Pos.x + 12, m_Pos.y + 147, 165, 195);
            RenderBack(m_Pos.x + 16, m_Pos.y + 235, 158, 74);

            RenderImage(BITMAP_INTERFACE_CRYWOLF_BEGIN + 34, m_Pos.x + 29, m_Pos.y + 92, 15, 19, 0.f, 0.f, 15.f / 16.f, 19.f / 32.f);
        }
        else
        {
            RenderBack(m_Pos.x + 12, m_Pos.y + 73, 165, 50);
            RenderBack(m_Pos.x + 12, m_Pos.y + 120, 165, 222);
        }

    }
    else
    {
        RenderBack(m_Pos.x + 12, m_Pos.y + 73, 68, 50);
        RenderBack(m_Pos.x + 75, m_Pos.y + 73, 102, 50);
        RenderBack(m_Pos.x + 12, m_Pos.y + 120, 165, 39);
        RenderBack(m_Pos.x + 12, m_Pos.y + 156, 165, 120);
        RenderBack(m_Pos.x + 12, m_Pos.y + 273, 165, 69);

        RenderImage(BITMAP_INTERFACE_CRYWOLF_BEGIN + 33, m_Pos.x + 29, m_Pos.y + 92, 15, 19, 0.f, 0.f, 15.f / 16.f, 19.f / 32.f);
    }

    RenderBtnList();
    RenderBoxList();
    RenderTextureList();
    RenderTextList();
    DisableAlphaBlend();

    return true;
}

void SEASON3B::CNewUIMuHelper::RenderBack(int x, int y, int width, int height)
{
    EnableAlphaTest();
    glColor4f(0.0, 0.0, 0.0, 0.4f);
    RenderColor(x+3.f, y+2.f, width-7.f, height-7, 0.0, 0);
    EndRenderColor();

    RenderImage(IMAGE_TABLE_TOP_LEFT, x, y, 14.0, 14.0);
    RenderImage(IMAGE_TABLE_TOP_RIGHT, (x + width) - 14.f, y, 14.0, 14.0);
    RenderImage(IMAGE_TABLE_BOTTOM_LEFT, x, (y + height) - 14.f, 14.0, 14.0);
    RenderImage(IMAGE_TABLE_BOTTOM_RIGHT, (x + width) - 14.f, (y + height) - 14.f, 14.0, 14.0);
    RenderImage(IMAGE_TABLE_TOP_PIXEL, x + 6.f, y, (width - 12.f), 14.0);
    RenderImage(IMAGE_TABLE_RIGHT_PIXEL, (x + width) - 14.f, y + 6.f, 14.0, (height - 14.f));
    RenderImage(IMAGE_TABLE_BOTTOM_PIXEL, x + 6.f, (y + height) - 14.f, (width - 12.f), 14.0);
    RenderImage(IMAGE_TABLE_LEFT_PIXEL, x, (y + 6.f), 14.0, (height - 14.f));
}

void SEASON3B::CNewUIMuHelper::LoadImages()
{
    LoadBitmap("Interface\\MacroUI\\MacroUI_RangeMinus.tga", IMAGE_MACROUI_HELPER_RAGEMINUS, GL_LINEAR, GL_CLAMP, 1, 0);
    LoadBitmap("Interface\\MacroUI\\MacroUI_OptionButton.tga", IMAGE_MACROUI_HELPER_OPTIONBUTTON, GL_LINEAR, GL_CLAMP, 1, 0);
    LoadBitmap("Interface\\MacroUI\\MacroUI_InputNumber.tga", IMAGE_MACROUI_HELPER_INPUTNUMBER, GL_LINEAR, GL_CLAMP, 1, 0);
    LoadBitmap("Interface\\MacroUI\\MacroUI_InputString.tga", IMAGE_MACROUI_HELPER_INPUTSTRING, GL_LINEAR, GL_CLAMP, 1, 0);
    //--
    LoadBitmap("Interface\\InGameShop\\Ingame_Bt03.tga", IMAGE_IGS_BUTTON, GL_LINEAR, GL_CLAMP, 1, 0);

}

void SEASON3B::CNewUIMuHelper::UnloadImages()
{
    DeleteBitmap(IMAGE_MACROUI_HELPER_RAGEMINUS);
    DeleteBitmap(IMAGE_MACROUI_HELPER_OPTIONBUTTON);
    DeleteBitmap(IMAGE_MACROUI_HELPER_INPUTNUMBER);
    DeleteBitmap(IMAGE_MACROUI_HELPER_INPUTSTRING);
    //--
    DeleteBitmap(IMAGE_IGS_BUTTON);
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RegisterButton(int Identificador, CButtonTap button)
{
    m_ButtonList.insert(std::pair<int, CButtonTap>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::RegisterBtnCharacter(BYTE class_character, int Identificador)
{
    cButtonMap::iterator li = m_ButtonList.find(Identificador);

    if (li != m_ButtonList.end())
    {
        CButtonTap* cBTN = &li->second;
        if (class_character >= 0 && class_character < max_class_s6+2)
        {
            cBTN->class_character[class_character] = TRUE;
        }
        else
        {
            memset(cBTN->class_character, 1, sizeof(cBTN->class_character));
        }
    }
}

void SEASON3B::CNewUIMuHelper::InsertButton(int imgindex, int x, int y, int sx, int sy, bool overflg, bool isimgwidth, bool bClickEffect, bool MoveTxt, unicode::t_string btname, unicode::t_string tooltiptext, int Identificador, int iNumTab)
{
    CButtonTap cBTN;
    CNewUIButton* button = new CNewUIButton();

    button->ChangeButtonImgState(1, imgindex, overflg, isimgwidth, bClickEffect);
    button->ChangeButtonInfo(x, y, sx, sy);

    button->ChangeText(btname);
    button->ChangeToolTipText(tooltiptext, TRUE);

    if (MoveTxt)
    {
        button->MoveTextPos(0, -1);
    }

    cBTN.btn = button;
    cBTN.iNumTab = iNumTab;
    memset(cBTN.class_character, 0, sizeof(cBTN.class_character));

    RegisterButton(Identificador, cBTN);
}

void SEASON3B::CNewUIMuHelper::RenderBtnList()
{
    cButtonMap::iterator li = m_ButtonList.begin();

    for (; li != m_ButtonList.end(); li++)
    {
        CButtonTap* cBTN = &li->second;

        if ((cBTN->class_character[(0xF & Hero->Class)]) && (cBTN->iNumTab == m_iNumCurOpenTab || cBTN->iNumTab == -1))
        {
            cBTN->btn->Render();
        }
    }
}

int SEASON3B::CNewUIMuHelper::UpdateMouseBtnList()
{
    int Identificador = -1;

    cButtonMap::iterator li = m_ButtonList.begin();

    for (; li != m_ButtonList.end(); li++)
    {
        CButtonTap* cBTN = &li->second;

        if ((cBTN->class_character[(0xF & Hero->Class)]) && (cBTN->iNumTab == m_iNumCurOpenTab || cBTN->iNumTab == -1))
        {
            if (cBTN->btn->UpdateMouseEvent())
            {
                return li->first;
            }
        }
    }
    return Identificador;
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RegisterBoxCharacter(BYTE class_character, int Identificador)
{
    cCheckBoxMap::iterator li = m_CheckBoxList.find(Identificador);

    if (li != m_CheckBoxList.end())
    {
        CheckBoxTap* cBOX = &li->second;

        if (class_character >= 0 && class_character < max_class_s6 + 2)
        {
            cBOX->class_character[class_character] = TRUE;
        }
        else
        {
            memset(cBOX->class_character, 1, sizeof(cBOX->class_character));
        }
    }
}

void SEASON3B::CNewUIMuHelper::RegisterCheckBox(int Identificador, CheckBoxTap button)
{
    m_CheckBoxList.insert(std::pair<int, CheckBoxTap>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::InsertCheckBox(int imgindex, int x, int y, int sx, int sy, bool overflg, unicode::t_string btname, int Identificador, int iNumTab)
{
    CheckBoxTap cBOX;

    CNewUICheckBox* cbox = new CNewUICheckBox;

    cbox->CheckBoxImgState(imgindex);
    cbox->CheckBoxInfo(x, y, sx, sy);

    cbox->ChangeText(btname);
    cbox->RegisterBoxState(overflg);

    cBOX.box = cbox;
    cBOX.iNumTab = iNumTab;
    memset(cBOX.class_character, 0, sizeof(cBOX.class_character));

    RegisterCheckBox(Identificador, cBOX);
}

void SEASON3B::CNewUIMuHelper::RenderBoxList()
{
    cCheckBoxMap::iterator li = m_CheckBoxList.begin();

    for (; li != m_CheckBoxList.end(); li++)
    {
        CheckBoxTap* cBOX = &li->second;

        if ((cBOX->class_character[(0xF & Hero->Class)]) && (cBOX->iNumTab == m_iNumCurOpenTab || cBOX->iNumTab == -1))
        {
            cBOX->box->Render();
        }
    }
}

int SEASON3B::CNewUIMuHelper::UpdateMouseBoxList()
{
    int Identificador = -1;

    cCheckBoxMap::iterator li = m_CheckBoxList.begin();

    for (; li != m_CheckBoxList.end(); li++)
    {
        CheckBoxTap* cBOX = &li->second;

        if ((cBOX->class_character[(0xF & Hero->Class)]) && (cBOX->iNumTab == m_iNumCurOpenTab || cBOX->iNumTab == -1))
        {
            if (cBOX->box->UpdateMouseEvent())
            {
                return li->first;
            }
        }
    }
    return Identificador;
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RenderTextureList()
{
    cTextureMap::iterator li = m_TextureList.begin();

    for (; li != m_TextureList.end(); li++)
    {
        cTexture* cImage = &li->second;

        if ((cImage->class_character[(0xF & Hero->Class)]) && (cImage->iNumTab == m_iNumCurOpenTab || cImage->iNumTab == -1))
        {
            RenderImage(cImage->s_ImgIndex, cImage->m_Pos.x, cImage->m_Pos.y, cImage->m_Size.x, cImage->m_Size.y);
        }
    }
}

int SEASON3B::CNewUIMuHelper::UpdateTextureList()
{
    int Identificador = -1;

    cTextureMap::iterator li = m_TextureList.begin();

    for (; li != m_TextureList.end(); li++)
    {
        cTexture* cImage = &li->second;

        if ((cImage->class_character[(0xF & Hero->Class)]) && (cImage->iNumTab == m_iNumCurOpenTab || cImage->iNumTab == -1))
        {
            if (CheckMouseIn(cImage->m_Pos.x, cImage->m_Pos.y, cImage->m_Size.x, cImage->m_Size.y))
            {
                return li->first;
            }
        }
    }

    return Identificador;
}

void SEASON3B::CNewUIMuHelper::RegisterTextureCharacter(BYTE class_character, int Identificador)
{
    cTextureMap::iterator li = m_TextureList.find(Identificador);

    if (li != m_TextureList.end())
    {
        cTexture* cImage = &li->second;

        if (class_character >= 0 && class_character < max_class_s6 + 2)
        {
            cImage->class_character[class_character] = TRUE;
        }
        else
        {
            memset(cImage->class_character, 1, sizeof(cImage->class_character));
        }
    }
}

void SEASON3B::CNewUIMuHelper::RegisterTexture(int Identificador, cTexture button)
{
    m_TextureList.insert(std::pair<int, cTexture>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::InsertTexture(int imgindex, int x, int y, int sx, int sy, int Identificador, int iNumTab)
{
    cTexture cImage;

    cImage.s_ImgIndex = imgindex;
    cImage.m_Pos.x = x;
    cImage.m_Pos.y = y;
    cImage.m_Size.x = sx;
    cImage.m_Size.y = sy;
    cImage.iNumTab = iNumTab;

    memset(cImage.class_character, 0, sizeof(cImage.class_character));

    RegisterTexture(Identificador, cImage);
}

//===============================================================================================================
//===============================================================================================================

void SEASON3B::CNewUIMuHelper::RenderTextList()
{
    cTextNameMap::iterator li = m_TextNameList.begin();

    for (; li != m_TextNameList.end(); li++)
    {
        cTextName* cImage = &li->second;

        if ((cImage->class_character[(0xF & Hero->Class)]) && (cImage->iNumTab == m_iNumCurOpenTab || cImage->iNumTab == -1))
        {
            g_pRenderText->RenderText(cImage->m_Pos.x, cImage->m_Pos.y, cImage->m_Name.c_str());
        }
    }
}

void SEASON3B::CNewUIMuHelper::RegisterTextCharacter(BYTE class_character, int Identificador)
{
    cTextNameMap::iterator li = m_TextNameList.find(Identificador);

    if (li != m_TextNameList.end())
    {
        cTextName* cImage = &li->second;

        if (class_character >= 0 && class_character < max_class_s6 + 2)
        {
            cImage->class_character[class_character] = TRUE;
        }
        else
        {
            memset(cImage->class_character, 1, sizeof(cImage->class_character));
        }
    }
}

void SEASON3B::CNewUIMuHelper::RegisterTextur(int Identificador, cTextName button)
{
    m_TextNameList.insert(std::pair<int, cTextName>(Identificador, button));
}

void SEASON3B::CNewUIMuHelper::InsertText(int x, int y, unicode::t_string Name, int Identificador, int iNumTab)
{
    cTextName cText;

    cText.m_Pos.x = x;
    cText.m_Pos.y = y;
    cText.m_Name = Name;
    cText.iNumTab = iNumTab;

    memset(cText.class_character, 0, sizeof(cText.class_character));
    RegisterTextur(Identificador, cText);
}
i unknow :
BITMAP_INTERFACE_MACROUI_BEGIN -> add in ?
max_class_s6 -> = 7 ?
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Apr 24, 2015
Messages
31
Reaction score
7
i unknow :
BITMAP_INTERFACE_MACROUI_BEGIN -> add in ?
max_class_s6 -> = 7 ?

For me i put in _TextureIndex.h
After BITMAP_GENS_RANKBACK,

EDITED:
BITMAP_UI_MACRO_BEGIN = 31760,
BITMAP_UI_MACRO_END = BITMAP_UI_MACRO_BEGIN + 12,

&

#define MAX_CLASS 7
 
Last edited:
Joined
Jul 31, 2012
Messages
490
Reaction score
93
Thanks a lot!!! this was what i was looking for! =)

I will help you, or rather I will solve your problem.

I've adapted it to kayito format, for better understanding.

This is how I solved this problem.
It can be solved easily.
PHP:
void RenderNumber(vec3_t Position,int Num,vec3_t Color,float Alpha,float Scale)
{
	vec3_t p;
	VectorCopy(Position,p);
	vec3_t Light[4];
	VectorCopy(Color,Light[0]);
	VectorCopy(Color,Light[1]);
	VectorCopy(Color,Light[2]);
	VectorCopy(Color,Light[3]);
    if(Num == -1)
	{
		float UV[4][2];
		TEXCOORD(UV[0],0.f       ,32.f/32.f);
		TEXCOORD(UV[1],32.f/256.f,32.f/32.f);
		TEXCOORD(UV[2],32.f/256.f,17.f/32.f);
		TEXCOORD(UV[3],0.f       ,17.f/32.f);
		RenderSpriteUV(BITMAP_FONT+1,p,45,20,UV,Light,Alpha);
	}
	else if(Num == -2)
	{
		RenderSprite(BITMAP_FONT_HIT,p,32*Scale,20*Scale, Light[0], 0.f, 0.f, 0.f, 27.f/32.f, 15.f/16.f);	
	}
}

void RenderNumberPoints(vec3_t Position,int Num,vec3_t Color,float Alpha,float Scale)
{
	vec3_t p;
	VectorCopy(Position,p);
	vec3_t Light[4];
	VectorCopy(Color,Light[0]);
	VectorCopy(Color,Light[1]);
	VectorCopy(Color,Light[2]);
	VectorCopy(Color,Light[3]);

	char Text[32];
	itoa(Num,Text,10);
	p[0] -= strlen(Text)*5.f;
	unsigned int Length = strlen(Text);
	p[0] -= Length*Scale*0.125f;
	p[1] -= Length*Scale*0.125f;

	// ---- Angle calculation -------------------------------- //
	float sinTh = sinf((float)(ANGLE_TO_RAD * (CameraAngle[2])));
	float cosTh = cosf((float)(ANGLE_TO_RAD * (CameraAngle[2])));
	// ------------------------------------------------------- //
	for(unsigned int i=0;i<Length;i++)
	{
		float UV[4][2];
		float u = (float)(Text[i]-48)*16.f/256.f;
		TEXCOORD(UV[0],u           ,16.f/32.f);
		TEXCOORD(UV[1],u+16.f/256.f,16.f/32.f);
		TEXCOORD(UV[2],u+16.f/256.f,0.f);
		TEXCOORD(UV[3],u           ,0.f);
		RenderSpriteUV(BITMAP_FONT+1,p,Scale,Scale,UV,Light,Alpha);
		//p[0] += Scale*0.5f;
		//p[1] += Scale*0.5f;
		p[0] += Scale / 0.7071067f * cosTh / 2;
		p[1] -= Scale / 0.7071067f * sinTh / 2;
	}
}

PHP:
void RenderPoints( BYTE byRenderOneMore )
{
#ifdef DO_PROFILING
	g_pProfiler->BeginUnit( EPROFILING_RENDER_POINTS, PROFILING_RENDER_POINTS );
#endif // DO_PROFILING
	
	EnableAlphaTest();
    DisableDepthTest();
    for(int i=0;i<MAX_POINTS;i++)
	{
		PARTICLE *o = &Points[i];
		if(o->Live)
		{
            if ( byRenderOneMore==1 )            //  Ľö¸é ľĆ·ˇŔÇ °Íµé¸¸ Âď´Â´Ů.
            {
                if ( o->Position[2]>350.f ) continue;
            }
            else if ( byRenderOneMore==2 )       //  Ľö¸éŔ§ŔÇ °Íµé¸¸ Âď´Â´Ů.
            {
                if ( o->Position[2]<=300.f ) continue;
            }
#ifdef PBG_ADD_NEWCHAR_MONK_SKILL
			else if(o->bRepeatedly)
			{
				if( o->Position[2] <= o->fRepeatedlyHeight) continue;
			}
#endif //PBG_ADD_NEWCHAR_MONK_SKILL
			
			if (o->Type > -1)
			{
				RenderNumberPoints(o->Position,o->Type,o->Color,o->Gravity*0.4f,o->Scale);
			}
			else 
			{
				RenderNumber(o->Position,o->Type,o->Color,o->Gravity*0.4f,o->Scale);
			}
		}
	}
#ifdef DO_PROFILING
	g_pProfiler->EndUnit( EPROFILING_RENDER_POINTS );
#endif // DO_PROFILING
}
 
Last edited:
Newbie Spellweaver
Joined
Mar 29, 2020
Messages
11
Reaction score
0
Thanks, i was studying Math, Sin and Cos, to solve it and thinking how. xD

I lack a lot ... T_T

I will help you, or rather I will solve your problem.

I've adapted it to kayito format, for better understanding.

This is how I solved this problem.
It can be solved easily.
PHP:
void RenderNumber(vec3_t Position,int Num,vec3_t Color,float Alpha,float Scale)
{
    vec3_t p;
    VectorCopy(Position,p);
    vec3_t Light[4];
    VectorCopy(Color,Light[0]);
    VectorCopy(Color,Light[1]);
    VectorCopy(Color,Light[2]);
    VectorCopy(Color,Light[3]);
    if(Num == -1)
    {
        float UV[4][2];
        TEXCOORD(UV[0],0.f       ,32.f/32.f);
        TEXCOORD(UV[1],32.f/256.f,32.f/32.f);
        TEXCOORD(UV[2],32.f/256.f,17.f/32.f);
        TEXCOORD(UV[3],0.f       ,17.f/32.f);
        RenderSpriteUV(BITMAP_FONT+1,p,45,20,UV,Light,Alpha);
    }
    else if(Num == -2)
    {
        RenderSprite(BITMAP_FONT_HIT,p,32*Scale,20*Scale, Light[0], 0.f, 0.f, 0.f, 27.f/32.f, 15.f/16.f);    
    }
}

void RenderNumberPoints(vec3_t Position,int Num,vec3_t Color,float Alpha,float Scale)
{
    vec3_t p;
    VectorCopy(Position,p);
    vec3_t Light[4];
    VectorCopy(Color,Light[0]);
    VectorCopy(Color,Light[1]);
    VectorCopy(Color,Light[2]);
    VectorCopy(Color,Light[3]);

    char Text[32];
    itoa(Num,Text,10);
    p[0] -= strlen(Text)*5.f;
    unsigned int Length = strlen(Text);
    p[0] -= Length*Scale*0.125f;
    p[1] -= Length*Scale*0.125f;

    // ---- Angle calculation -------------------------------- //
    float sinTh = sinf((float)(ANGLE_TO_RAD * (CameraAngle[2])));
    float cosTh = cosf((float)(ANGLE_TO_RAD * (CameraAngle[2])));
    // ------------------------------------------------------- //
    for(unsigned int i=0;i<Length;i++)
    {
        float UV[4][2];
        float u = (float)(Text[i]-48)*16.f/256.f;
        TEXCOORD(UV[0],u           ,16.f/32.f);
        TEXCOORD(UV[1],u+16.f/256.f,16.f/32.f);
        TEXCOORD(UV[2],u+16.f/256.f,0.f);
        TEXCOORD(UV[3],u           ,0.f);
        RenderSpriteUV(BITMAP_FONT+1,p,Scale,Scale,UV,Light,Alpha);
        //p[0] += Scale*0.5f;
        //p[1] += Scale*0.5f;
        p[0] += Scale / 0.7071067f * cosTh / 2;
        p[1] -= Scale / 0.7071067f * sinTh / 2;
    }
}

PHP:
void RenderPoints( BYTE byRenderOneMore )
{
#ifdef DO_PROFILING
    g_pProfiler->BeginUnit( EPROFILING_RENDER_POINTS, PROFILING_RENDER_POINTS );
#endif // DO_PROFILING
    
    EnableAlphaTest();
    DisableDepthTest();
    for(int i=0;i<MAX_POINTS;i++)
    {
        PARTICLE *o = &Points[i];
        if(o->Live)
        {
            if ( byRenderOneMore==1 )            //  Ľö¸é ľĆ·ˇŔÇ °Íµé¸¸ Âď´Â´Ů.
            {
                if ( o->Position[2]>350.f ) continue;
            }
            else if ( byRenderOneMore==2 )       //  Ľö¸éŔ§ŔÇ °Íµé¸¸ Âď´Â´Ů.
            {
                if ( o->Position[2]<=300.f ) continue;
            }
#ifdef PBG_ADD_NEWCHAR_MONK_SKILL
            else if(o->bRepeatedly)
            {
                if( o->Position[2] <= o->fRepeatedlyHeight) continue;
            }
#endif //PBG_ADD_NEWCHAR_MONK_SKILL
            
            if (o->Type > -1)
            {
                RenderNumberPoints(o->Position,o->Type,o->Color,o->Gravity*0.4f,o->Scale);
            }
            else 
            {
                RenderNumber(o->Position,o->Type,o->Color,o->Gravity*0.4f,o->Scale);
            }
        }
    }
#ifdef DO_PROFILING
    g_pProfiler->EndUnit( EPROFILING_RENDER_POINTS );
#endif // DO_PROFILING
}
 
Joined
Jul 31, 2012
Messages
490
Reaction score
93
You are seeing the wrong function I think.
Check the RenderNumber function, since within it the calculations of the position of each number are performed.
I think you should change those calculations making the X angle of the camera affect the result.

In the Season 6 main, i did it like this:

Code:
SetCompleteHook(0xE9, 0x0063764C, &this->RotateFix);

__declspec(naked) void CCamera::RotateFix()
{
    static DWORD jmpBack = 0x0063752D;

    _asm
    {
        Lea Eax, [Ebp - 0x38]; //-> p[1]
        Lea Ecx, [Ebp - 0x3C]; //-> p[0]
        Push Dword Ptr[Ebp + 0x18]; //-> Scale
        Push Eax; //-> p[1]
        Push Ecx; //-> p[2]
        Call RotateDmg;
        Add Esp, 0xC;
        Jmp[jmpBack];
    }
}

void CCamera::RotateDmg(float& X, float& Y, float D)
{
    const float Rad = 0.01745329f;

    float sinTh = sin(Rad * (*gCamera.m_Address.RotX));

    float cosTh = cos(Rad * (*gCamera.m_Address.RotX));

    X += D / 0.7071067f * cosTh / 2;

    Y -= D / 0.7071067f * sinTh / 2;
}

[Ebp - 0x38] => p[1]
[Ebp - 0x3C] => p[0]
[Ebp - 0x18] => Scale

So you need to change these two lines inside RenderNumber function:

Code:
p[0] += Scale * 0.5f;

p[1] += Scale * 0.5f;





Try changing these two lines inside RenderNumber function:

Code:
p[0] += Scale * 0.5f;

p[1] += Scale * 0.5f;

For something like this:

Code:
const float Rad = 0.01745329f;

float sinTh = sin(Rad * (Camera.RotX));

float cosTh = cos(Rad * (Camera.RotX));

p[0] += Scale / 0.7071067f * cosTh / 2;

p[1] -= Scale / 0.7071067f * sinTh / 2;

I don't know how your camera system works but if its based on the DLL version, i think this should work.

Your number for the angle to radius calculation is not completely accurate and may cause a slight deviation.

The whole number is
PHP:
#define ANGLE_TO_RAD	0.017453292519943294f
 
Newbie Spellweaver
Joined
Mar 29, 2020
Messages
11
Reaction score
0
"o->Color" can be posible that i have it like "o->Angle" ?
=/
Don't found o->Color in my Struct
 
Joined
Jul 31, 2012
Messages
490
Reaction score
93
"o->Color" can be posible that i have it like "o->Angle" ?
=/
Don't found o->Color in my Struct

Having an angle in the structure that determines the color is quite confusing.

I replaced it in my structure as Color.

PHP:
typedef struct
{
	bool   Live;
	int    Type;
	int    TexType;
	int    SubType;
	float  Scale;
	vec3_t Position;
	vec3_t Angle;
	vec3_t Color;
	vec3_t Light;
	float  Alpha;
	int    LifeTime;
	OBJECT *Target;
	float  Rotation;
	int    Frame;

	bool   bEnableMove;
	float  Gravity;
	vec3_t Velocity;
	vec3_t TurningForce;
	vec3_t StartPosition; 
#ifdef ADD_SOCKET_ITEM
	int iNumBone;				// żŔşęÁ§Ć®ŔÇ ÇŘ´çÇĎ´Â ş»ąřČŁŔÇ Ŕ§Äˇ¸¦ ş¸Á¤
#endif // ADD_SOCKET_ITEM
#ifdef PBG_ADD_NEWCHAR_MONK_SKILL
	bool bRepeatedly;
	float fRepeatedlyHeight;
#endif //PBG_ADD_NEWCHAR_MONK_SKILL
} PARTICLE;
 
Joined
Jul 31, 2012
Messages
490
Reaction score
93
Thanks, now i have my Camera %100 :E

100%? It will never be completely finished.
It is necessary to create a 3D camera settings file in the game client or in the registry.
The user should always have the exact point of view that he sets himself.

1. Make in-game settings and save option.
2. Create a friendly interface that the user can change.
 
Joined
Jul 31, 2012
Messages
490
Reaction score
93
Could someone share the source of split system messages?
Somehow I don't have time to work on it and I would definitely share some of my code in return.
 
Newbie Spellweaver
Joined
Mar 29, 2020
Messages
11
Reaction score
0
You mean separated the chat from the system messages?

It was shared in other forum from @muccone:
PHP:
if (MsgType != TYPE_SYSTEM_MESSAGE)
			{
				CMessageText* pAllMsgText = new CMessageText;
				if (!pAllMsgText->Create(strID, strText1, MsgType))
					delete pAllMsgText;
				else
				{
					m_vecAllMsgs.push_back(pAllMsgText);
				}
			}


if (MsgType == TYPE_SYSTEM_MESSAGE)
			{
				nScrollLinesNew++;
			}else
			if( (GetCurrentMsgType() == TYPE_ALL_MESSAGE || GetCurrentMsgType() == MsgType) && MsgType != TYPE_SYSTEM_MESSAGE)
			{
				nScrollLines++;
			}

if (MsgType == TYPE_SYSTEM_MESSAGE)
	{
		pvecMsgs = GetMsgs(MsgType);
		if (pvecMsgs == NULL)
		{
			assert(!"Error chat 4");
			return;
		}
		if (nScrollLinesNew > 0 && ((pvecMsgs->size() - (m_iCurrentRenderEndLineMsg + 1) - nScrollLinesNew) < 3))
			m_iCurrentRenderEndLineMsg = pvecMsgs->size() - 1;
		else if (!m_bShowFrame)
			m_iCurrentRenderEndLineMsg = pvecMsgs->size() - 1;
		

	}

bool SEASON3B::CNewUIChatLogWindow::RenderMessagesNew()
{
	float fRenderPosX = m_WndPos.x, fRenderPosY = m_WndPos.y - m_WndSize.cy + SCROLL_TOP_BOTTOM_PART_HEIGHT;

	type_vector_msgs* pvecMsgs = GetMsgs(TYPE_SYSTEM_MESSAGE);
	if (pvecMsgs == NULL)
	{
		assert(!"empty chat!");
		return false;
	}
	int iRenderStartLine = 0;
	if (GetCurrentRenderEndLineMsg() >= m_nShowingLinesMsg)
	{
		iRenderStartLine = GetCurrentRenderEndLineMsg() - m_nShowingLinesMsg + 1;
	}
	else
	{
		fRenderPosY = fRenderPosY + FONT_LEADING + (SCROLL_MIDDLE_PART_HEIGHT * (m_nShowingLinesMsg - GetCurrentRenderEndLineMsg() - 1));
	}
	fRenderPosY -= 270;
	BYTE byAlpha = 150;
	if (m_bShowFrame) byAlpha = 100;
	EnableAlphaTest();
	for (int i = iRenderStartLine, s = 0; i <= GetCurrentRenderEndLineMsg(); i++, s++)
	{
		if (i < 0 && i >= (int)pvecMsgs->size()) break;

		bool bRenderMessage = true;
		g_pRenderText->SetFont(g_hFont);
		g_pRenderText->SetBgColor(0, 0, 0, 150);
		g_pRenderText->SetTextColor(100, 150, 255, 255);
		CMessageText* pMsgText = (*pvecMsgs)[i];
		if (bRenderMessage && !pMsgText->GetText().empty())
		{
			POINT ptRenderPos = { (long)fRenderPosX + (long)WND_LEFT_RIGHT_EDGE, (long)fRenderPosY + (long)FONT_LEADING + ((long)SCROLL_MIDDLE_PART_HEIGHT * (long)s) };


			if (!pMsgText->GetID().empty())
			{
				if (m_bPointedMessage == true && m_iPointedMessageIndex == i)
				{
					g_pRenderText->SetBgColor(30, 30, 30, 180);
					g_pRenderText->SetTextColor(255, 128, 255, 255);
				}
				std::string strIDUTF8 = "";
				g_pMultiLanguage->ConvertANSIToUTF8OrViceVersa(strIDUTF8, (pMsgText->GetID()).c_str());
				type_string strLine = strIDUTF8 + " : " + pMsgText->GetText();
				g_pRenderText->RenderText(ptRenderPos.x, ptRenderPos.y, strLine.c_str());
			}
			else
			{
				g_pRenderText->RenderText(ptRenderPos.x, ptRenderPos.y, pMsgText->GetText().c_str());
			}
		}
	}
	DisableAlphaBlend();

	return true;
}
Could someone share the source of split system messages?
Somehow I don't have time to work on it and I would definitely share some of my code in return.
 
Joined
Jul 31, 2012
Messages
490
Reaction score
93
You mean separated the chat from the system messages?

It was shared in other forum from @muccone:
PHP:
if (MsgType != TYPE_SYSTEM_MESSAGE)
			{
				CMessageText* pAllMsgText = new CMessageText;
				if (!pAllMsgText->Create(strID, strText1, MsgType))
					delete pAllMsgText;
				else
				{
					m_vecAllMsgs.push_back(pAllMsgText);
				}
			}


if (MsgType == TYPE_SYSTEM_MESSAGE)
			{
				nScrollLinesNew++;
			}else
			if( (GetCurrentMsgType() == TYPE_ALL_MESSAGE || GetCurrentMsgType() == MsgType) && MsgType != TYPE_SYSTEM_MESSAGE)
			{
				nScrollLines++;
			}

if (MsgType == TYPE_SYSTEM_MESSAGE)
	{
		pvecMsgs = GetMsgs(MsgType);
		if (pvecMsgs == NULL)
		{
			assert(!"Error chat 4");
			return;
		}
		if (nScrollLinesNew > 0 && ((pvecMsgs->size() - (m_iCurrentRenderEndLineMsg + 1) - nScrollLinesNew) < 3))
			m_iCurrentRenderEndLineMsg = pvecMsgs->size() - 1;
		else if (!m_bShowFrame)
			m_iCurrentRenderEndLineMsg = pvecMsgs->size() - 1;
		

	}

bool SEASON3B::CNewUIChatLogWindow::RenderMessagesNew()
{
	float fRenderPosX = m_WndPos.x, fRenderPosY = m_WndPos.y - m_WndSize.cy + SCROLL_TOP_BOTTOM_PART_HEIGHT;

	type_vector_msgs* pvecMsgs = GetMsgs(TYPE_SYSTEM_MESSAGE);
	if (pvecMsgs == NULL)
	{
		assert(!"empty chat!");
		return false;
	}
	int iRenderStartLine = 0;
	if (GetCurrentRenderEndLineMsg() >= m_nShowingLinesMsg)
	{
		iRenderStartLine = GetCurrentRenderEndLineMsg() - m_nShowingLinesMsg + 1;
	}
	else
	{
		fRenderPosY = fRenderPosY + FONT_LEADING + (SCROLL_MIDDLE_PART_HEIGHT * (m_nShowingLinesMsg - GetCurrentRenderEndLineMsg() - 1));
	}
	fRenderPosY -= 270;
	BYTE byAlpha = 150;
	if (m_bShowFrame) byAlpha = 100;
	EnableAlphaTest();
	for (int i = iRenderStartLine, s = 0; i <= GetCurrentRenderEndLineMsg(); i++, s++)
	{
		if (i < 0 && i >= (int)pvecMsgs->size()) break;

		bool bRenderMessage = true;
		g_pRenderText->SetFont(g_hFont);
		g_pRenderText->SetBgColor(0, 0, 0, 150);
		g_pRenderText->SetTextColor(100, 150, 255, 255);
		CMessageText* pMsgText = (*pvecMsgs)[i];
		if (bRenderMessage && !pMsgText->GetText().empty())
		{
			POINT ptRenderPos = { (long)fRenderPosX + (long)WND_LEFT_RIGHT_EDGE, (long)fRenderPosY + (long)FONT_LEADING + ((long)SCROLL_MIDDLE_PART_HEIGHT * (long)s) };


			if (!pMsgText->GetID().empty())
			{
				if (m_bPointedMessage == true && m_iPointedMessageIndex == i)
				{
					g_pRenderText->SetBgColor(30, 30, 30, 180);
					g_pRenderText->SetTextColor(255, 128, 255, 255);
				}
				std::string strIDUTF8 = "";
				g_pMultiLanguage->ConvertANSIToUTF8OrViceVersa(strIDUTF8, (pMsgText->GetID()).c_str());
				type_string strLine = strIDUTF8 + " : " + pMsgText->GetText();
				g_pRenderText->RenderText(ptRenderPos.x, ptRenderPos.y, strLine.c_str());
			}
			else
			{
				g_pRenderText->RenderText(ptRenderPos.x, ptRenderPos.y, pMsgText->GetText().c_str());
			}
		}
	}
	DisableAlphaBlend();

	return true;
}

Yes, this code is shared on page 17 or 18.

But it is necessary to add all the functions and definitions to it.
For example:
PHP:
GetCurrentRenderEndLineMsg()
m_nShowingLinesMsg
nScrollLinesNew
m_iCurrentRenderEndLineMsg

Or modifying the function to display other messages
PHP:
bool SEASON3B::CNewUIChatLogWindow::RenderMessages()

Without these pieces of code, it's just a stub without work.
 
Initiate Mage
Joined
Jan 6, 2023
Messages
2
Reaction score
0
我可以加你的朋友吗?你的WhatsApp ID是什么?

- - - 更新 - - -

是的,这个代码在第17页或18页共享

。添加到到。

PHP:
 getCurrentRenderendLineMsg(
)m_nshowinglinesmsg 
nscrolllinesnew m_icurrentrenderendendlinemsg [ 
/ php 
]或者工作。









[COLOR=#666666][/COLOR]



Can I add your friends? What is your WhatsApp ID?

[QUOTE="leorond, post: 9161095, member: 1333426669"]是的,这个代码在第17页或18页共享。

但是需要将所有函数和定义添加到其中。
例如:
[PHP]GetCurrentRenderEndLineMsg() 
m_nShowingLinesMsg 
nScrollLinesNew 
m_iCurrentRenderEndLineMsg

或者修改函数显示其他消息
PHP:
bool SEASON3B::CNewUIChatLogWindow::RenderMessages()

没有这些代码,它只是存根没有工作。
 
Joined
Jul 31, 2012
Messages
490
Reaction score
93
我可以加你的朋友吗?你的WhatsApp ID是什么?

- - - 更新 - - -

是的,这个代码在第17页或18页共享

。添加到到。

PHP:
 getCurrentRenderendLineMsg(
)m_nshowinglinesmsg 
nscrolllinesnew m_icurrentrenderendendlinemsg [ 
/ php 
]或者工作。









[COLOR=#666666][/COLOR]



Can I add your friends? What is your WhatsApp ID?[/QUOTE]

I don't use WhatsApp or Skype.
I have Facebook, if you want I can send you a contact.
 
Back
Top