Noticias:

SMF - Just Installed!

Menú principal

Mensajes recientes

#71
Source Mu / Re:[Main 5.2] Source Render Pa...
Último mensaje por Dakosmu - Mar 30, 2025, 12:27 AM
Cita de: Amumu en Mar 28, 2025, 11:17 PMhello, can you share the source file?  I always make mistakes in certain places.

hola amigo, este contenido es un copy y paste.
unicamente lo guarde para no olvidar
#72
Source Mu / Re:[Main 5.2] Source Render Pa...
Último mensaje por Amumu - Mar 28, 2025, 11:17 PM
hello, can you share the source file?  I always make mistakes in certain places.
#73
Source Mu / Season 0 Free (MuEmu) 1.00M
Último mensaje por Dakosmu - Mar 28, 2025, 04:04 AM
Season 0 Free (MuEmu) 1.00M

Season 0 Free:
- Version Free.
- Sin Limite de Usuarios.

IMAGENES:
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


EVENTOS:
* BloodCastle 
* BonusManager 
* CastleDeepEvent 
* CastleSiege 
* ChaosCastle 
* DevilSquare 
* DropEvent 
* InvasionManager 
* Kalima 

COMANDOS:
"/move" 
"/post" 
"/f" 
"/a" 
"/v" 
"/e" 
"/c" 
"/pk" 
"/zen" 
"/evo" 
"/bau" 
"/reset" 
"/gmmove" 
"/gmpost" 
"/track" 
"/trace" 
"/disconnect" 
"/fireworks" 
"/make" 
"/skin" 
"/setmoney" 
"/notice" 
"/mreset" 
"/war" 
"/soccer" 
"/re" 
"/store" 
"/offstore" 
"/hide" 
"/attack" 
"/offattack" 
"/quest" 
"/classe" 
"/mudarnome" 
"/spot" 
"/readd" 
"/clearinv" 
"/drop" 
"/duelnew" 
"/setlevel" 
"/pick" 
"/marry" 
"/banchar" 
"/banacc" 
"/ajuda" 
"/abrirbau" 
"/unbanchar" 
"/unbanacc" 
"/setvip" 

DESCARGAS:
Files: Descargar archivos 
Cliente: Descargar cliente 

Update - Free Sin Limites: 
GameServer y GameServerCS: Descargar GameServer 

Source: 
Sources (99B) + Server: Descargar fuente y servidor
#74
Source Mu / SOURCE - cant you share sd bar...
Último mensaje por Dakosmu - Mar 26, 2025, 12:53 AM
cant you share sd bar? yellow bar Main 5.2

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Buscas: //RenderGuageSD(); y lo cambias por RenderGuageSD();

ya luego buscas: void SEASON3B::CNewUIMainFrameWindow::RenderGuageSD()

y cambias por:

void SEASON3B::CNewUIMainFrameWindow::RenderGuageSD()
{
    float x, y, width, height;
    float fY, fH, fV;
    WORD wMaxShield, wShield;

    //Master_Level_Data.wMaxShield
    if (gCharacterManager.IsMasterLevel(Hero->Class) == true)
    {
        wMaxShield = max(1, Master_Level_Data.wMaxShield);
        wShield = min(wMaxShield, CharacterAttribute->Shield);
    }
    else
    {
        wMaxShield = max(1, CharacterAttribute->ShieldMax);
        wShield = min(wMaxShield, CharacterAttribute->Shield);
    }

    float fShield = 0.0f;

    if (wMaxShield > 0)
    {
        fShield = (wMaxShield - wShield) / (float)wMaxShield;
    }

    width = 16.f, height = 39.f;
    x = 120; y = 480.f - 42.f;
    fY = y + (fShield * height);
    fH = height - (fShield * height);
    fV = fShield;

    // Habilitar pruebas de alpha
    EnableAlphaTest(true);

    // Renderizar la imagen de la barra de escudo
    RenderBitmap(IMAGE_GAUGE_SD, x, fY, width, fH, 0.f, fV * height / 64.f, width / 16.f, (1.0f - fV) * height / 64.f);

    // Establecer color para el número del escudo
    glColor3f(0.91000003, 0.81, 0.60000002);

    // Renderizar el número del escudo
    float Sub = 10.f;  // Ajuste de posición
    GWidescreen.RenderNumbers(x + 12, GetWindowsY - Sub - 4, (int)wShield, 6.0, 7.0);

    // Restablecer el color a blanco
    glColor4f(1.f, 1.f, 1.f, 1.f);

    // Renderizar el tooltip si el mouse está sobre la barra
    height = 39.f;
    y = 480.f - 10.f - 39.f;
    if (SEASON3B::CheckMouseIn(x, y, width, height) == true)
    {
        char strTipText[256];
        sprintf(strTipText, GlobalText[2037], wShield, wMaxShield);
        RenderTipText((int)x - 20, (int)418, strTipText);
    }
}

Creditos
Dexign
#75
Source Mu / Re:Window movable - Tela flutu...
Último mensaje por Dakosmu - Mar 25, 2025, 07:29 PM
v0.9 - with .txt

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

interface.cpp

// Vincula os botões de navegação do painel Layout
this->BindObject(eLayout_BACK, 31658, 17, 18, -1, -1);
this->BindObject(eLayout_FORWARD, 31659, 17, 18, -1, -1);

Layout.h

#pragma once
#include <vector>
#include <string>

// Função para carregar os textos do arquivo
std::vector<std::vector<std::string>> LoadLayoutTexts();

class CLayout
{
public:
    CLayout();

    // Inicializa o Layout, carregando os textos de arquivo
    bool Init();

    // Atualiza o estado do painel (toggle F4 e drag and drop)
    void UpdateLayoutPanelWindow();

    int DrawToolTip(int X, int Y, LPCSTR Text, ...);

    // Desenha o painel flutuante na posição atual
    void DrawLayoutPanelWindow();
};

extern CLayout gLayout;

Layout.cpp

#include "stdafx.h"
#include "layout.h"
#include "Interface.h"
#include "Central.h"
#include "Defines.h"
#include "Import.h"
#include "CustomFont.h"
#include "Defines2.h"
#include <vector>
#include <string>
#include <fstream>
#include <windows.h> // Para DWORD, GetTickCount(), VK_F4, etc.
#include <cstdarg> // Para va_start e va_end

// Inicializa o gLayout e as variáveis de drag dentro da classe
CLayout::CLayout()
{
    // Construtor vazio. Caso necessite, adicione inicializações aqui.
}

CLayout gLayout;

// Variável global para armazenar os textos carregados
std::vector<std::vector<std::string>> g_LoadedTexts;

// Inicializa o Layout, carregando arquivos necessários
bool CLayout::Init()
{
    // Carrega o arquivo de textos do layout
    g_LoadedTexts = LoadLayoutTexts();
    return true;
}

// Função para ler os textos do arquivo
std::vector<std::vector<std::string>> LoadLayoutTexts()
{
    std::vector<std::vector<std::string>> pages;
    // Inicializa 5 páginas vazias
    for (int i = 0; i < 5; i++) {
        std::vector<std::string> emptyPage;
        pages.push_back(emptyPage);
    }

    // Tenta abrir o arquivo do caminho especificado
    std::string filePath = "MuServer\\Data\\Custom\\CustomTexts.txt";
    std::ifstream file(filePath);
   
    if (!file.is_open()) {
        // Se não conseguir abrir, tenta outro caminho
        filePath = "..\\MuServer\\Data\\Custom\\CustomTexts.txt";
        file.open(filePath);
       
        if (!file.is_open()) {
            // Se ainda não conseguir, tenta um caminho relativo
            filePath = "Data\\Custom\\CustomTexts.txt";
            file.open(filePath);
           
            if (!file.is_open()) {
                // Se não puder ser aberto, retorna as páginas vazias
                return pages;
            }
        }
    }

    int currentPageIndex = -1; // Inicia sem página selecionada
    std::string line;

    while (std::getline(file, line)) {
        // Remove espaços em branco no início e fim da linha
        if (!line.empty()) {
            size_t start = line.find_first_not_of(" \t");
            if (start != std::string::npos) {
                size_t end = line.find_last_not_of(" \t");
                line = line.substr(start, end - start + 1);
            }
        }

        // Pula linhas vazias
        if (line.empty()) {
            continue;
        }

        // Verifica se é uma linha de marcador de página
        if (line.find("[PAGE") == 0 && line.find("]") != std::string::npos) {
            // Extrai o número da página
            std::string pageNumStr = line.substr(5, line.find("]") - 5);
            try {
                int pageNum = std::stoi(pageNumStr);
                if (pageNum >= 1 && pageNum <= 5) {
                    currentPageIndex = pageNum - 1; // Ajusta para índice baseado em 0
                }
            } catch (...) {
                // Erro na conversão, ignora
            }
        }
        // Se estiver em uma página válida, adiciona a linha
        else if (currentPageIndex >= 0 && currentPageIndex < 5) {
            pages[currentPageIndex].push_back(line);
        }
    }

    file.close();
    return pages;
}

void CLayout::UpdateLayoutPanelWindow()
{
    // Variável estática para controlar o estado da tecla F4
    static bool isF4Pressed = false;
    bool currentF4State = (GetAsyncKeyState(VK_F4) & 0x8000) != 0;

    if (currentF4State && !isF4Pressed)
    {
        // Alterna a flag de exibição do painel
        gInterface.Data[eLayout_MAIN].OnShow = !gInterface.Data[eLayout_MAIN].OnShow;

        // Adiciona o som ao abrir ou fechar com F4
        PlayBuffer(25, 0, 0);

        isF4Pressed = true;
    }
    else if (!currentF4State)
    {
        isF4Pressed = false;
    }
}

int CLayout::DrawToolTip(int X, int Y, LPCSTR Text, ...)
{
    // Como estamos tendo problemas com va_start/va_end, vamos usar uma solução mais simples
    // Definir diretamente a cor do texto para branco antes de chamar pDrawToolTip
    pSetTextColor(pTextThis(), 255, 255, 255, 255); // Branco brilhante
   
    // Desenha o tooltip diretamente com o texto fornecido
    int result = pDrawToolTip(X, Y, Text);
   
    return result;
}

// Variáveis globais para controle de páginas
int currentPage = 0;
int maxPages = 5; // Número total de páginas disponíveis
DWORD lastButtonClickTime = 0; // Tempo do último clique nos botões
const DWORD clickDelay = 300; // Delay entre cliques em milissegundos

// Variáveis globais para controle do drag e da posição do painel
bool   m_isDragging = false;
POINT  m_dragStartPoint;
float m_windowPosX = (MAX_WIN_WIDTH - 230.0f) / 2;
float m_windowPosY = (MAX_WIN_HEIGHT - 240.0f) / 2;

// Variável para controlar o tempo do último clique no botão de menu
DWORD lastMenuButtonClickTime = 0;
const DWORD menuClickDelay = 300; // Delay entre cliques em milissegundos

// Variável para controlar o tempo do último clique no botão de opções
DWORD lastOptionButtonClickTime = 0;
const DWORD optionClickDelay = 300; // Delay entre cliques em milissegundos

// ID do objeto de interface para o botão de menu
short eLayoutButtonMenu = 12350; // Usando um ID não usado
// ID do objeto de interface para o botão de opções
short eLayoutButtonOption = 12351; // Usando um ID não usado

void CLayout::DrawLayoutPanelWindow()
{
    // Se o painel não estiver para ser exibido, sai da função
    if (!gInterface.Data[eLayout_MAIN].OnShow)
        return;

    // Garante o foco do cursor
    pSetCursorFocus = true;

    // Variáveis para controle de clique e tempo
    bool isLeftButtonDown = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0;
    DWORD currentTime = GetTickCount();

    // Dimensões fixas do painel
    const float MainWidth = 230.0f;
    const float MainHeight = 240.0f;

    // Lógica para drag and drop
    if (pCheckMouseOver(m_windowPosX, m_windowPosY, MainWidth, MainHeight) || m_isDragging)
    {
        if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
        {
            if (!m_isDragging)
            {
                m_isDragging = true;
                m_dragStartPoint.x = pCursorX;
                m_dragStartPoint.y = pCursorY;
            }
            else
            {
                float deltaX = pCursorX - m_dragStartPoint.x;
                float deltaY = pCursorY - m_dragStartPoint.y;

                m_windowPosX += deltaX;
                m_windowPosY += deltaY;

                if (m_windowPosX < 0)
                    m_windowPosX = 0;
                else if (m_windowPosX > MAX_WIN_WIDTH - MainWidth)
                    m_windowPosX = MAX_WIN_WIDTH - MainWidth;

                if (m_windowPosY < 0)
                    m_windowPosY = 0;
                else if (m_windowPosY > MAX_WIN_HEIGHT - MainHeight)
                    m_windowPosY = MAX_WIN_HEIGHT - MainHeight;

                m_dragStartPoint.x = pCursorX;
                m_dragStartPoint.y = pCursorY;
            }
        }
        else
        {
            m_isDragging = false;
        }
    }
    else
    {
        m_isDragging = false;
    }

    // Desenha o painel flutuante na posição atual
    gCentral.PrintDropBox(m_windowPosX, m_windowPosY, MainWidth, MainHeight, 0, 0);

    // Define a posição base para o texto
    float StartX = m_windowPosX;
    float StartY = m_windowPosY;

    // --- Botão de menu ---
    // Mostrar o botão apenas na página 5 (índice 4)
    if (currentPage == 4)
    {
        // Definindo as dimensões e posição do botão menu
        float menuButtonWidth = 107.1f; // Mesma largura do botão Menu Option
        float menuButtonHeight = 29.0f; // Mesma altura do botão Menu Option
        float menuButtonX = m_windowPosX + (MainWidth / 2) - (menuButtonWidth / 2);
        float menuButtonY = m_windowPosY + 5.0f; // Posicionado mais acima

        // Vinculando o objeto de botão de menu (apenas uma vez)
        static bool buttonBound = false;
        if (!buttonBound) {
            gInterface.BindObject(eLayoutButtonMenu, 0x7A5E, menuButtonWidth, menuButtonHeight, -1, -1);
            gInterface.BindObject(eLayoutButtonOption, 0x7A5E, menuButtonWidth, menuButtonHeight, -1, -1);
            buttonBound = true;
        }

        // Desenhando o botão do menu
        bool isHovered = pCheckMouseOver(menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight);

        // Verificando se está sobre o botão
        if (isHovered)
        {
            if (isLeftButtonDown && (currentTime - lastMenuButtonClickTime > menuClickDelay))
            {
                // Desenhando o botão com estilo de clique
                pDrawButton(0x7A5E, menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight, 0, 58);

                // Marca o tempo do clique
                lastMenuButtonClickTime = currentTime;

                // Reproduz som ao clicar
                PlayBuffer(25, 0, 0);

                // Fecha o painel de layout
                //gInterface.Data[eLayout_MAIN].OnShow = false;

                // aqui abre menu option
                //if (!gInterface.CheckMenuWindow())
                //{
                //    gInterface.CloseCustomWindow();
                //    gInterface.OpenMenuWindow();
                //}
            }
            else
            {
                // Desenhando o botão com estilo de hover
                pDrawButton(0x7A5E, menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight, 0, 29);
                this->DrawToolTip(menuButtonX + 5, menuButtonY - 15, "Abrir Menu");
            }
        }
        else
        {
            // Desenhando o botão normal
            pDrawButton(0x7A5E, menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight, 0, 0);
        }

        // Desenha o texto "MENU" no botão
        pSetTextColor(pTextThis(), 255, 255, 255, 255); // Define a cor do texto como branco brilhante
        gInterface.DrawFormat(eWhite, menuButtonX, menuButtonY + 9, menuButtonWidth, 3, "MENU");

        // ----- Botão Option -----
        // Posicionando o botão Option abaixo do botão Menu
        float optionButtonWidth = 107.1f;
        float optionButtonHeight = 29.0f;
        float optionButtonX = m_windowPosX + (MainWidth / 2) - (optionButtonWidth / 2);
        float optionButtonY = menuButtonY + menuButtonHeight + 5.0f; // 5 pixels abaixo do botão menu

        // Desenhando o botão de opções
        bool isOptionHovered = pCheckMouseOver(optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight);

        // Verificando se está sobre o botão
        if (isOptionHovered)
        {
            if (isLeftButtonDown && (currentTime - lastOptionButtonClickTime > optionClickDelay))
            {
                // Desenhando o botão com estilo de clique
                pDrawButton(0x7A5E, optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight, 0, 58);

                // Marca o tempo do clique
                lastOptionButtonClickTime = currentTime;

                // Reproduz som ao clicar
                PlayBuffer(25, 0, 0);

                // Aqui você pode adicionar a funcionalidade que deseja quando o botão for clicado
                // Por exemplo, abrir uma janela de configurações ou opções
                // Por enquanto, apenas fecha o layout como exemplo
                //gInterface.Data[eLayout_MAIN].OnShow = false;
            }
            else
            {
                // Desenhando o botão com estilo de hover
                pDrawButton(0x7A5E, optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight, 0, 29);
                this->DrawToolTip(optionButtonX + 5, optionButtonY - 15, "Configurações");
            }
        }
        else
        {
            // Desenhando o botão normal
            pDrawButton(0x7A5E, optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight, 0, 0);
        }

        // Desenha o texto "OPTION" no botão
        pSetTextColor(pTextThis(), 255, 255, 255, 255); // Define a cor do texto como branco brilhante
        gInterface.DrawFormat(eWhite, optionButtonX, optionButtonY + 9, optionButtonWidth, 3, "OPTION");
    }

    // Vetor com os tamanhos (em pontos) para cada linha
    std::vector<int> fontSizes;
    fontSizes.push_back(20);
    fontSizes.push_back(16);
    fontSizes.push_back(16);
    fontSizes.push_back(16);
    fontSizes.push_back(16);

    // Define o espaçamento vertical entre as linhas
    float linhaAltura = 30.0f;

    // Escolhe o texto da página atual da variável global carregada
    std::vector<std::string> textos;
    if (currentPage < g_LoadedTexts.size()) {
        textos = g_LoadedTexts[currentPage];
    }

    // Para cada linha, cria e aplica uma fonte personalizada com o tamanho correspondente e desenha o texto
    for (size_t i = 0; i < textos.size() && i < fontSizes.size(); i++)
    {
        HFONT hCustomFont = CreateFontA(
            -fontSizes[i],   // Tamanho da fonte (em pontos)
            0,               // Largura: ajuste automático
            0,               // Escapamento
            0,               // Orientação
            FW_BOLD,         // Peso: negrito
            FALSE,           // Não itálico
            FALSE,           // Sem sublinhado
            FALSE,           // Sem tachado
            DEFAULT_CHARSET,
            OUT_TT_PRECIS,
            CLIP_DEFAULT_PRECIS,
            CLEARTYPE_QUALITY,
            DEFAULT_PITCH | FF_DONTCARE,
            "Segoe UI"       // Nome da fonte
        );

        if (hCustomFont)
        {
            pSetFont(pTextThis(), (int)hCustomFont);
            pSetBkColor(pTextThis(), 0, 0, 0, 0); // Define a cor de fundo como transparente
            pSetTextColor(pTextThis(), 255, 255, 255, 255); // Define a cor do texto como branco brilhante
            pDrawText(pTextThis(), StartX - 16, StartY + 10 + i * linhaAltura,
                (LPCTSTR)textos[i].c_str(), 260, 0, (LPINT)3, 0);
            DeleteObject(hCustomFont);
        }
    }

    // Botões de navegação (avançar e voltar)
    float buttonWidth = 20.0f;
    float buttonHeight = 20.0f;

    float backButtonX = m_windowPosX + 10.0f;
    float backButtonY = m_windowPosY + MainHeight - 30.0f;

    float forwardButtonX = m_windowPosX + MainWidth - 30.0f;
    float forwardButtonY = m_windowPosY + MainHeight - 30.0f;

    // Botão de voltar (se não estiver na primeira página)
    if (currentPage > 0)
    {
        gInterface.DrawGUI(eLayout_BACK, backButtonX, backButtonY);

        if (pCheckMouseOver(backButtonX, backButtonY, buttonWidth, buttonHeight))
        {
            this->DrawToolTip(backButtonX + 5, backButtonY - 15, "Anterior");

            if (isLeftButtonDown && (currentTime - lastButtonClickTime > clickDelay))
            {
                currentPage--;
                lastButtonClickTime = currentTime;
                PlayBuffer(25, 0, 0);
            }
        }
    }

    // Botão de avançar (se não estiver na última página)
    if (currentPage < maxPages - 1)
    {
        gInterface.DrawGUI(eLayout_FORWARD, forwardButtonX, forwardButtonY);

        if (pCheckMouseOver(forwardButtonX, forwardButtonY, buttonWidth, buttonHeight))
        {
            this->DrawToolTip(forwardButtonX + 5, forwardButtonY - 15, "Próximo");

            if (isLeftButtonDown && (currentTime - lastButtonClickTime > clickDelay))
            {
                currentPage++;
                lastButtonClickTime = currentTime;
                PlayBuffer(25, 0, 0);
            }
        }
    }

    // Desenha o indicador de página com uma fonte fixa para não ser alterado ao passar o mouse sobre as setas
    HFONT hFixedFont = CreateFontA(
        -16,                     // Tamanho fixo da fonte
        0,
        0,
        0,
        FW_BOLD,
        FALSE,
        FALSE,
        FALSE,
        DEFAULT_CHARSET,
        OUT_TT_PRECIS,
        CLIP_DEFAULT_PRECIS,
        CLEARTYPE_QUALITY,
        DEFAULT_PITCH | FF_DONTCARE,
        "Segoe UI"              // Fonte fixa ("Segoe UI")
    );

    if (hFixedFont)
    {
        pSetFont(pTextThis(), (int)hFixedFont);
        char pageText[50];
        sprintf_s(pageText, "Página %d/%d", currentPage + 1, maxPages);
        pSetBkColor(pTextThis(), 0, 0, 0, 0); // Define a cor de fundo como transparente
        pSetTextColor(pTextThis(), 255, 255, 255, 255); // Define a cor do texto como branco brilhante
        pDrawText(pTextThis(), m_windowPosX + MainWidth / 2 - 40, m_windowPosY + MainHeight - 30,
            (LPCTSTR)pageText, 80, 0, (LPINT)3, 0);
        DeleteObject(hFixedFont);
    }

    // --- Botão de fechar ---
    float closeButtonX = m_windowPosX + MainWidth - 20;
    float closeButtonY = m_windowPosY - 10;

    gInterface.DrawGUI(eMenu_CLOSE, closeButtonX, closeButtonY);

    if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29))
    {
        this->DrawToolTip(closeButtonX + 5, closeButtonY + 25, "Close");
    }

    if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29) && (GetAsyncKeyState(VK_LBUTTON) & 0x8000))
    {
        // Adiciona o som ao fechar com o botão de fechar
        PlayBuffer(25, 0, 0);

        gInterface.Data[eLayout_MAIN].OnShow = false;
    }
}


main.cpp


extern "C" _declspec(dllexport) void EntryProc() // OK
{
gLayout.Init();
}

CustomTexts.txt

[PAGE1]
SEJA BEM VINDO AO MUONLINE
O continente de MU era glorioso e vasto,
Quando Kundun surgiu, trazendo o caos mortal.
Heróis lutaram com força e magia.
Criaturas sombrias espalharam terror.

[PAGE2]
GUIA DE CLASSES
SM: Mestre da magia elemental.
BK: Guerreiro poderoso em combate corpo a corpo.
Elf: Arqueira ágil com habilidades de suporte.
MG: Híbrido de força física e poderes mágicos.
as trevas estavam corruptas

[PAGE3]
MAPAS DE MU ONLINE
Lorencia: Cidade inicial e principal.
Noria: Lar dos elfos e seres másticos.
Davias: Deserto habitado por criaturas perigosas.
Atlans: Reino subaquático de monstros exóticos.
as vezes podemos alcançar

[PAGE4]
EVENTOS ESPECIAIS
Blood Castle: Desafie os guardiões.
Devil Square: Arena de monstros.
Chaos Castle: Sobreviva contra monstros.
Golden Invasion: Lute contra monstros dourados.
venha vamos correr para alcançar

[PAGE5]

Creditos
-LEGENDARY
#76
Source Mu / Source Implementación de Inter...
Último mensaje por Dakosmu - Mar 25, 2025, 07:02 PM
Source Implementación de Interfaces Botones en MuEmu y SSeMu


stdafx.h

#define BOTOES_FUNCOES    1

Protocol.h

Busca Client -> GameServer o buscas esto struct PMSG_HELPER_START_SEND

#if(BOTOES_FUNCOES)
struct PMSG_TICKET_SEND
{
    PSBMSG_HEAD header; // C1:F3:00
};
#endif

Interface.h

Dentro de class Interface

#if(BOTOES_FUNCOES)
    void        DRAW_TINHNANG_INTERFACE();
    bool        EVENT_TINHNANG_INTERFACE(DWORD Event);
    bool        EVENT_AUTORESET_INTERFACE(DWORD Event);
    bool        EVENT_LAMNHIEMVU_INTERFACE(DWORD Event);
    bool        EVENT_OFFATTACK_INTERFACE(DWORD Event);
    bool        EVENT_UYTHAC_INTERFACE(DWORD Event);
    bool        EVENT_TAYDIEM_INTERFACE(DWORD Event);
    bool        EVENT_TAYDIEM_MASTER_INTERFACE(DWORD Event);
#endif

Dentro de enum ObjectID

#if(BOTOES_FUNCOES)
        EXBEXO_AUTORESET_INTERFACE,
        EXBEXO_QUESTCLASS_INTERFACE,
        EXBEXO_OFFATTACK_INTERFACE,
        EXBEXO_UYTHAC_INTERFACE,
        EXBEXO_TAYDIEM_INTERFACE,
        EXBEXO_TAYDIEMMASTER_INTERFACE,
#endif


Interface.cpp

Dentro de void Interface::Load()

#if(BOTOES_FUNCOES)
    this->BindObject(EXBEXO_AUTORESET_INTERFACE, 0x313A, 78, 22, -1, -1);
    this->BindObject(EXBEXO_QUESTCLASS_INTERFACE, 0x313A, 78, 22, -1, -1);
    this->BindObject(EXBEXO_OFFATTACK_INTERFACE, 0x313A, 78, 22, -1, -1);
    this->BindObject(EXBEXO_UYTHAC_INTERFACE, 0x313A, 78, 22, -1, -1);
    this->BindObject(EXBEXO_TAYDIEM_INTERFACE, 0x313A, 78, 22, -1, -1);
    this->BindObject(EXBEXO_TAYDIEMMASTER_INTERFACE, 0x313A, 78, 22, -1, -1);
#endif

Dentro de void Interface::LoadImages()
#if(BOTOES_FUNCOES)
    pLoadImage("Custom\\Botone_Funtion\\Nut_80_25.tga", 0x313A, 0x2601, 0x2900, 1, 0); // NÚT BUTTON
#endif

Dentro de void Interface::Work()

#if(BOTOES_FUNCOES)
    gInterface.DRAW_TINHNANG_INTERFACE();
#endif

Al final
#if(BOTOES_FUNCOES)
void Interface::DRAW_TINHNANG_INTERFACE()
{



    float MainWidth = 30.0;
    float MainHeight = 20.0;
    float StartY = 20.0;
    float StartX = (MAX_WIN_WIDTH / 2) - (MainWidth / 2);
    if (this->CheckWindow(ObjWindow::Character))
    {
        // AutoReset
        this->DrawGUI(EXBEXO_AUTORESET_INTERFACE, StartX + 160, StartY + 52);
        //--------------------------------------------------------------------------------------------
        HFONT TextFontBold_Autoreset = CreateFontA(15, 0, 0, 0, 700, 0, 0, 0, 0x1, 0, 0, 3, 0, "Tahoma");
        pSetTextFont(pTextThis(), TextFontBold_Autoreset); //set font
        pSetTextColor(pTextThis(), 255, 255, 0, 255); // MÀU
        pSetBackgroundTextColor(pTextThis(), 0, 0, 0, 0);
        pDrawText(pTextThis(), 473, 77, "AutoReset", 150, 0, (LPINT)0, 0); // "Master reset"
        //Giải phóng
        DeleteObject(TextFontBold_Autoreset);
        //--------------------------------------------------------------------------------------------
        // QuestClass
        this->DrawGUI(EXBEXO_QUESTCLASS_INTERFACE, StartX + 239, StartY + 52);
        //--------------------------------------------------------------------------------------------
        HFONT TextFontBold_NhiemVu = CreateFontA(15, 0, 0, 0, 700, 0, 0, 0, 0x1, 0, 0, 3, 0, "Tahoma");
        pSetTextFont(pTextThis(), TextFontBold_NhiemVu); //set font
        pSetTextColor(pTextThis(), 0, 255, 255, 255); // MÀU
        pSetBackgroundTextColor(pTextThis(), 0, 0, 0, 0);
        pDrawText(pTextThis(), 558, 77, "QuestClass", 150, 0, (LPINT)0, 0); // "Làm Nhiệm Vụ"

        //Giải phóng
        DeleteObject(TextFontBold_NhiemVu);
        //--------------------------------------------------------------------------------------------
        // OffAttack
        this->DrawGUI(EXBEXO_OFFATTACK_INTERFACE, StartX + 160, StartY + 74);
        //--------------------------------------------------------------------------------------------
        HFONT TextFontBold_OffAttack = CreateFontA(15, 0, 0, 0, 700, 0, 0, 0, 0x1, 0, 0, 3, 0, "Tahoma");
        pSetTextFont(pTextThis(), TextFontBold_OffAttack); //set font
        pSetTextColor(pTextThis(), 255, 0, 0, 255); // MÀU
        pSetBackgroundTextColor(pTextThis(), 0, 0, 0, 0);
        pDrawText(pTextThis(), 473, 100, "ATTACK", 150, 0, (LPINT)0, 0); // "ATTACK"

        //Giải phóng
        DeleteObject(TextFontBold_OffAttack);
        //--------------------------------------------------------------------------------------------
        // UyThac
        this->DrawGUI(EXBEXO_UYTHAC_INTERFACE, StartX + 239, StartY + 74);
        //--------------------------------------------------------------------------------------------
        HFONT TextFontBold_UyThac = CreateFontA(15, 0, 0, 0, 700, 0, 0, 0, 0x1, 0, 0, 3, 0, "Tahoma");
        pSetTextFont(pTextThis(), TextFontBold_UyThac); //set font
        pSetTextColor(pTextThis(), 0, 255, 0, 255); // MÀU
        pSetBackgroundTextColor(pTextThis(), 0, 0, 0, 0);
        pDrawText(pTextThis(), 558, 100, "OFF ATTACK", 150, 0, (LPINT)0, 0); // "OFF ATTACK"

        //Giải phóng
        DeleteObject(TextFontBold_UyThac);
        //--------------------------------------------------------------------------------------------
        // TayDiem
        this->DrawGUI(EXBEXO_TAYDIEM_INTERFACE, StartX + 159, StartY + 351);
        //--------------------------------------------------------------------------------------------
        HFONT TextFontBold_TayDiem = CreateFontA(15, 0, 0, 0, 700, 0, 0, 0, 0x1, 0, 0, 3, 0, "Tahoma");
        pSetTextFont(pTextThis(), TextFontBold_TayDiem); //set font
        pSetTextColor(pTextThis(), 0, 255, 255, 255); // MÀU
        pSetBackgroundTextColor(pTextThis(), 0, 0, 0, 0);
        pDrawText(pTextThis(), 480, 377, "Del Points", 150, 0, (LPINT)0, 0); // "Tẩy Điểm"

        //Giải phóng
        DeleteObject(TextFontBold_TayDiem);
        //--------------------------------------------------------------------------------------------
        // TayDiemMaster
        this->DrawGUI(EXBEXO_TAYDIEMMASTER_INTERFACE, StartX + 239, StartY + 351);
        //--------------------------------------------------------------------------------------------
        HFONT TextFontBold_TayDiemMaster = CreateFontA(15, 0, 0, 0, 700, 0, 0, 0, 0x1, 0, 0, 3, 0, "Tahoma");
        pSetTextFont(pTextThis(), TextFontBold_TayDiemMaster); //set font
        pSetTextColor(pTextThis(), 0, 255, 255, 255); // MÀU
        pSetBackgroundTextColor(pTextThis(), 0, 0, 0, 0);
        pDrawText(pTextThis(), 560, 377, "Del Master", 150, 0, (LPINT)0, 0); // "Tẩy Điểm Master"

        //Giải phóng
        DeleteObject(TextFontBold_TayDiemMaster);
        //--------------------------------------------------------------------------------------------
    }
    //----------------------------------------------------------------------------------------------------------------------
    if (this->CheckWindow(ObjWindow::Character))
        if (gInterface.IsWorkZone(EXBEXO_AUTORESET_INTERFACE))
        {
            DWORD Color = eGray150;
            gInterface.DrawColoredGUI(EXBEXO_AUTORESET_INTERFACE, gInterface.Data[EXBEXO_AUTORESET_INTERFACE].X, gInterface.Data[EXBEXO_AUTORESET_INTERFACE].Y, Color);
        }
    //----------------------------------------------------------------------------------------------------------------------
    if (this->CheckWindow(ObjWindow::Character))
        if (gInterface.IsWorkZone(EXBEXO_QUESTCLASS_INTERFACE))
        {
            DWORD Color = eGray150;
            gInterface.DrawColoredGUI(EXBEXO_QUESTCLASS_INTERFACE, gInterface.Data[EXBEXO_QUESTCLASS_INTERFACE].X, gInterface.Data[EXBEXO_QUESTCLASS_INTERFACE].Y, Color);
        }
    //----------------------------------------------------------------------------------------------------------------------
    if (this->CheckWindow(ObjWindow::Character))
        if (gInterface.IsWorkZone(EXBEXO_OFFATTACK_INTERFACE))
        {
            DWORD Color = eGray150;
            gInterface.DrawColoredGUI(EXBEXO_OFFATTACK_INTERFACE, gInterface.Data[EXBEXO_OFFATTACK_INTERFACE].X, gInterface.Data[EXBEXO_OFFATTACK_INTERFACE].Y, Color);
        }
    //----------------------------------------------------------------------------------------------------------------------
    if (this->CheckWindow(ObjWindow::Character))
        if (gInterface.IsWorkZone(EXBEXO_UYTHAC_INTERFACE))
        {
            DWORD Color = eGray150;
            gInterface.DrawColoredGUI(EXBEXO_UYTHAC_INTERFACE, gInterface.Data[EXBEXO_UYTHAC_INTERFACE].X, gInterface.Data[EXBEXO_UYTHAC_INTERFACE].Y, Color);
        }
    //----------------------------------------------------------------------------------------------------------------------
    if (this->CheckWindow(ObjWindow::Character))
        if (gInterface.IsWorkZone(EXBEXO_TAYDIEM_INTERFACE))
        {
            DWORD Color = eGray150;
            gInterface.DrawColoredGUI(EXBEXO_TAYDIEM_INTERFACE, gInterface.Data[EXBEXO_TAYDIEM_INTERFACE].X, gInterface.Data[EXBEXO_TAYDIEM_INTERFACE].Y, Color);
        }
    //----------------------------------------------------------------------------------------------------------------------
    if (this->CheckWindow(ObjWindow::Character))
        if (gInterface.IsWorkZone(EXBEXO_TAYDIEMMASTER_INTERFACE))
        {
            DWORD Color = eGray150;
            gInterface.DrawColoredGUI(EXBEXO_TAYDIEMMASTER_INTERFACE, gInterface.Data[EXBEXO_TAYDIEMMASTER_INTERFACE].X, gInterface.Data[EXBEXO_TAYDIEMMASTER_INTERFACE].Y, Color);
        }

}

bool Interface::EVENT_TINHNANG_INTERFACE(DWORD Event)
{
    this->EVENT_AUTORESET_INTERFACE(Event);
    this->EVENT_LAMNHIEMVU_INTERFACE(Event);
    this->EVENT_OFFATTACK_INTERFACE(Event);
    this->EVENT_UYTHAC_INTERFACE(Event);
    this->EVENT_TAYDIEM_INTERFACE(Event);
    this->EVENT_TAYDIEM_MASTER_INTERFACE(Event);
    return true;
}
bool Interface::EVENT_AUTORESET_INTERFACE(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[EXBEXO_AUTORESET_INTERFACE].EventTick);
    if (!this->CheckWindow(ObjWindow::Character) || !IsWorkZone(EXBEXO_AUTORESET_INTERFACE))
    {
        return false;
    }
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[EXBEXO_AUTORESET_INTERFACE].OnClick = true;
        pSetCursorFocus = true;
        return true;
    }
    this->Data[EXBEXO_AUTORESET_INTERFACE].OnClick = false;
    pSetCursorFocus = false;
    // ----
    if (Delay < 500)
    {
        return false;
    }
    this->Data[EXBEXO_AUTORESET_INTERFACE].EventTick = GetTickCount();
    PMSG_TICKET_SEND pMsg;
    pMsg.header.set(0xFC, 0x23, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
    //gInterface.CloseWindow(Character);

    return true;

}
// ----------------------------------------------------------------------------------------------
bool Interface::EVENT_LAMNHIEMVU_INTERFACE(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[EXBEXO_QUESTCLASS_INTERFACE].EventTick);
    if (!this->CheckWindow(ObjWindow::Character) || !IsWorkZone(EXBEXO_QUESTCLASS_INTERFACE))
    {
        return false;
    }
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[EXBEXO_QUESTCLASS_INTERFACE].OnClick = true;
        pSetCursorFocus = true;
        return true;
    }
    this->Data[EXBEXO_QUESTCLASS_INTERFACE].OnClick = false;
    pSetCursorFocus = false;
    // ----
    if (Delay < 500)
    {
        return false;
    }
    this->Data[EXBEXO_QUESTCLASS_INTERFACE].EventTick = GetTickCount();
    PMSG_TICKET_SEND pMsg;
    pMsg.header.set(0xFC, 0x24, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
    //gInterface.CloseWindow(Character);
    return true;
}
// ----------------------------------------------------------------------------------------------
bool Interface::EVENT_OFFATTACK_INTERFACE(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[EXBEXO_OFFATTACK_INTERFACE].EventTick);
    if (!this->CheckWindow(ObjWindow::Character) || !IsWorkZone(EXBEXO_OFFATTACK_INTERFACE))
    {
        return false;
    }
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[EXBEXO_OFFATTACK_INTERFACE].OnClick = true;
        pSetCursorFocus = true;
        return true;
    }
    this->Data[EXBEXO_OFFATTACK_INTERFACE].OnClick = false;
    pSetCursorFocus = false;
    // ----
    if (Delay < 500)
    {
        return false;
    }
    this->Data[EXBEXO_OFFATTACK_INTERFACE].EventTick = GetTickCount();
    PMSG_TICKET_SEND pMsg;
    pMsg.header.set(0xFC, 0x25, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
    //gInterface.CloseWindow(Character);
    return true;
}
// ----------------------------------------------------------------------------------------------
bool Interface::EVENT_UYTHAC_INTERFACE(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[EXBEXO_UYTHAC_INTERFACE].EventTick);
    if (!this->CheckWindow(ObjWindow::Character) || !IsWorkZone(EXBEXO_UYTHAC_INTERFACE))
    {
        return false;
    }
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[EXBEXO_UYTHAC_INTERFACE].OnClick = true;
        pSetCursorFocus = true;
        return true;
    }
    this->Data[EXBEXO_UYTHAC_INTERFACE].OnClick = false;
    pSetCursorFocus = false;
    // ----
    if (Delay < 500)
    {
        return false;
    }
    this->Data[EXBEXO_UYTHAC_INTERFACE].EventTick = GetTickCount();
    PMSG_TICKET_SEND pMsg;
    pMsg.header.set(0xFC, 0x26, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
    //gInterface.CloseWindow(Character);
    return true;
}
// ----------------------------------------------------------------------------------------------
bool Interface::EVENT_TAYDIEM_INTERFACE(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[EXBEXO_TAYDIEM_INTERFACE].EventTick);
    if (!this->CheckWindow(ObjWindow::Character) || !IsWorkZone(EXBEXO_TAYDIEM_INTERFACE))
    {
        return false;
    }
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[EXBEXO_TAYDIEM_INTERFACE].OnClick = true;
        pSetCursorFocus = true;
        return true;
    }
    this->Data[EXBEXO_TAYDIEM_INTERFACE].OnClick = false;
    pSetCursorFocus = false;
    // ----
    if (Delay < 500)
    {
        return false;
    }
    this->Data[EXBEXO_TAYDIEM_INTERFACE].EventTick = GetTickCount();
    PMSG_TICKET_SEND pMsg;
    pMsg.header.set(0xFC, 0x27, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
    //gInterface.CloseWindow(Character);
    return true;
}
// ----------------------------------------------------------------------------------------------
bool Interface::EVENT_TAYDIEM_MASTER_INTERFACE(DWORD Event)
{
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - this->Data[EXBEXO_TAYDIEMMASTER_INTERFACE].EventTick);
    if (!this->CheckWindow(ObjWindow::Character) || !IsWorkZone(EXBEXO_TAYDIEMMASTER_INTERFACE))
    {
        return false;
    }
    if (Event == WM_LBUTTONDOWN)
    {
        this->Data[EXBEXO_TAYDIEMMASTER_INTERFACE].OnClick = true;
        pSetCursorFocus = true;
        return true;
    }
    this->Data[EXBEXO_TAYDIEMMASTER_INTERFACE].OnClick = false;
    pSetCursorFocus = false;
    // ----
    if (Delay < 500)
    {
        return false;
    }
    this->Data[EXBEXO_TAYDIEMMASTER_INTERFACE].EventTick = GetTickCount();
    PMSG_TICKET_SEND pMsg;
    pMsg.header.set(0xFC, 0x28, sizeof(pMsg));
    DataSend((BYTE*)&pMsg, pMsg.header.size);
    //gInterface.CloseWindow(Character);
    return true;
}

// ----------------------------------------------------------------------------------------------
#endif


import.h

//#if(BOTOES_FUNCOES)
#define pSetTextFont              ((int(__thiscall*)(LPVOID This, HFONT a2)) 0x00420120)
//


Controller.cpp

Dentro de case WM_LBUTTONDOWN:

#if(BOTOES_FUNCOES)
            gInterface.EVENT_TINHNANG_INTERFACE(wParam);
#endif


Descargar
https://mega.nz/file/KUYBBLJB#2Sd8XW1ukEdPEjF9DMH7_D3OegiGCLVPPgIeZsTO7xA

Creditos
al creador del codigo
Dakosmu por la mini guia



#77
Source Mu / MuServer S12.1 - Update 12.1.2...
Último mensaje por Dakosmu - Mar 25, 2025, 09:26 AM
MuServer S12.1 - Update 12.1.2.9

Buenas tardes comunidad, aca les vengo a dejar la ultima actualizacion del S12-1 hecha por Michi28

# Max user por GS 200
# Compatible con SQL 2008

aca les dejo algunas imagenes.... espero que lo disfruten
https://imgur.com/a/YY4cuet

MuServer....
https://www.mediafire.com/file/wqd94ghbci050gc/MuServerS12.rar/file

Cliente S12
https://drive.google.com/file/d/1dvQ8foL4lp-VvdkpHmh4Wcpdwmfc3ezT/view

si ya tinen el cliente S12 pegan este parche para el mazo of the king

Parche....
https://www.mediafire.com/file/3xtx4qv6zkhta90/Data.rar/file

Credito: @michi28 o @jorge2016 (son los mismos xD)
#78
Source Mu / [Main 5.2] Source Render Guild...
Último mensaje por Dakosmu - Mar 25, 2025, 09:21 AM
[Main 5.2] Source Render Guild Logo Name Player v.1


¡Comparto con ustedes esta útil modificación para mostrar emblemas de gremio junto a los nombres de los jugadores en MU Online! Perfecta para servidores privados o modificaciones client-side.

------Características principales-------
Muestra el emblema del gremio al lado del nombre de cada jugador
Totalmente integrado con el sistema de renderizado existente
Soporte para transparencias y blending adecuado
Posición personalizable del emblema

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión



BUSCAR: void RenderBoolean(int x, int y, CHAT* c) en Zzzinterface.cpp

y REEMPLAZAN por este:

void RenderBoolean(int x,int y,CHAT *c)
{

if ( g_isCharacterBuff((&c->Owner->Object), eBuff_CrywolfNPCHide ) )
{
return;
}

if ( c->Owner!=Hero && battleCastle::IsBattleCastleStart()==true && g_isCharacterBuff((&c->Owner->Object), eBuff_Cloaking) )
{
if ( ( Hero->EtcPart==PARTS_ATTACK_KING_TEAM_MARK || Hero->EtcPart==PARTS_ATTACK_TEAM_MARK ))
{
if(!( c->Owner->EtcPart==PARTS_ATTACK_KING_TEAM_MARK || c->Owner->EtcPart==PARTS_ATTACK_TEAM_MARK ))
{
return;
}
}
else if ( ( Hero->EtcPart==PARTS_ATTACK_KING_TEAM_MARK2 || Hero->EtcPart==PARTS_ATTACK_TEAM_MARK2 ))
{
if(!( c->Owner->EtcPart==PARTS_ATTACK_KING_TEAM_MARK2 || c->Owner->EtcPart==PARTS_ATTACK_TEAM_MARK2 ))
{
return;
}
}
else if ( ( Hero->EtcPart==PARTS_ATTACK_KING_TEAM_MARK3 || Hero->EtcPart==PARTS_ATTACK_TEAM_MARK3 ))
{
if(!( c->Owner->EtcPart==PARTS_ATTACK_KING_TEAM_MARK3 || c->Owner->EtcPart==PARTS_ATTACK_TEAM_MARK3 ))
{
return;
}
}
else if ( ( Hero->EtcPart==PARTS_DEFENSE_KING_TEAM_MARK || Hero->EtcPart==PARTS_DEFENSE_TEAM_MARK ))
{
if(!( c->Owner->EtcPart==PARTS_DEFENSE_KING_TEAM_MARK || c->Owner->EtcPart==PARTS_DEFENSE_TEAM_MARK ))
{
return;
}
}
}
if (c->Owner->GuildMarkIndex != -1 && c->Owner->Object.Type == MODEL_PLAYER)
{
// Guardar el estado actual del blending
GLboolean blendEnabled;
glGetBooleanv(GL_BLEND, &blendEnabled);

//Configura el blending y la textura para el emblema
EnableAlphaTest();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

//Crea y renderiza el emblema
CreateGuildMark(c->Owner->GuildMarkIndex, true);
RenderBitmap(
BITMAP_GUILD,
(float)x - 18.0f,
(float)y + 0.0f,
16.0f, 16.0f,
0.0f, 0.0f,
1.0f, 1.0f,
true, true,
1.0f
);

//Restaura el estado de OpenGL solo si no estaba activado originalmente
if (!blendEnabled) {
glDisable(GL_BLEND);
}
}
g_pRenderText->SetBgColor(0, 0, 0, 0);  // Fondo completamente transparente

EnableAlphaTest();
glColor3f(1.f,1.f,1.f);

if (FontHeight > 32) FontHeight = 32;

POINT RenderPos = { x, y };
SIZE RenderBoxSize = { c->Width, c->Height };
int iLineHeight = FontHeight/g_fScreenRate_y;

if(IsShopInViewport(c->Owner))
{
SIZE TextSize;
g_pRenderText->SetFont(g_hFontBold);
g_pRenderText->SetBgColor(GetShopBGColor(c->Owner));

g_pRenderText->SetTextColor(GetShopTextColor(c->Owner));
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, GlobalText[1104], 0, iLineHeight, RT3_SORT_LEFT, &TextSize);
RenderPos.x += TextSize.cx;

g_pRenderText->SetTextColor(GetShopText2Color(c->Owner));
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->szShopTitle, RenderBoxSize.cx-TextSize.cx, iLineHeight, RT3_SORT_LEFT, &TextSize);
g_pRenderText->SetFont(g_hFont);

RenderPos.x = x;
RenderPos.y += iLineHeight;
}
/*else if(::IsStrifeMap(gMapManager.WorldActive) && Hero->m_byGensInfluence != c->Owner->m_byGensInfluence && !::IsGMCharacter())
{
if(!c->Owner->m_nContributionPoint)
return;

if(KIND_PLAYER == c->Owner->Object.Kind && MODEL_PLAYER == c->Owner->Object.Type)
{
int _TempX = (int)(c->x + c->Width*0.5f+20.0f);
switch(c->Owner->m_byGensInfluence)
{
case 1:
g_pNewUIGensRanking->RanderMark(_TempX, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
return;
case 2:
g_pNewUIGensRanking->RanderMark(_TempX, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
return;
default:
break;
}
}
}*/

bool bGmMode = false;

if (g_isCharacterBuff((&c->Owner->Object), eBuff_GMEffect) || (c->Owner->CtlCode == CTLCODE_20OPERATOR) || (c->Owner->CtlCode == CTLCODE_08OPERATOR))
{
bGmMode = true;
g_pRenderText->SetBgColor(30, 30, 30, 200);
g_pRenderText->SetTextColor(200, 255, 255, 255);
}

if( c->Owner == Hero )
{
g_pRenderText->SetBgColor(60, 100, 0, 150);
g_pRenderText->SetTextColor(200, 255, 0, 255);
}
else if( c->Owner->GuildMarkIndex == Hero->GuildMarkIndex )
{
g_pRenderText->SetBgColor(GetGuildRelationShipBGColor(GR_UNION));
g_pRenderText->SetTextColor(GetGuildRelationShipTextColor(GR_UNION));
}
else
{
g_pRenderText->SetBgColor(GetGuildRelationShipBGColor(c->Owner->GuildRelationShip));
g_pRenderText->SetTextColor(GetGuildRelationShipTextColor(c->Owner->GuildRelationShip));
}

if( c->Union && c->Union[0] )
{
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Union, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
}
if( c->Guild && c->Guild[0] )
{
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Guild, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
}

if (bGmMode)
{
g_pRenderText->SetTextColor(100, 250, 250, 255);
}
else
{
SetPlayerColor(c->Color);
}

if ( c->x <= MouseX && MouseX < (int)(c->x+c->Width*640/WindowWidth) &&
c->y <= MouseY && MouseY < (int)(c->y+c->Height*480/WindowHeight) &&
InputEnable && Hero->SafeZone && strcmp(c->ID,Hero->ID)!=NULL &&
(DWORD)WorldTime%24 < 12)
{
unsigned int Temp = g_pRenderText->GetBgColor();
g_pRenderText->SetBgColor(g_pRenderText->GetTextColor());
g_pRenderText->SetTextColor(Temp);
}

if (bGmMode)
{
g_pRenderText->SetFont(g_hFontBold);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->ID, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
g_pRenderText->SetFont(g_hFont);
}
else
{
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->ID, RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;
}

if(c->GuildColor==0)
g_pRenderText->SetBgColor(10, 30, 50, 150);
else if(c->GuildColor==1)
g_pRenderText->SetBgColor(30, 50, 0, 150);
else if(bGmMode)
g_pRenderText->SetBgColor(30, 30, 30, 200);
else
g_pRenderText->SetBgColor(50, 0, 0, 150);

DWORD dwTextColor[2];
BYTE byAlpha[2] = { 255, 255 };
if((c->LifeTime[0] > 0 && c->LifeTime[0] < 10))
byAlpha[0] = 128;
if((c->LifeTime[1] > 0 && c->LifeTime[1] < 10))
byAlpha[1] = 128;

if (bGmMode)
{
dwTextColor[0] = RGBA(250, 200, 50, byAlpha[0]);
dwTextColor[1] = RGBA(250, 200, 50, byAlpha[1]);
}
else
{
dwTextColor[0] = RGBA(230, 220, 200, byAlpha[0]);
dwTextColor[1] = RGBA(230, 220, 200, byAlpha[1]);
}

if(c->LifeTime[1] > 0)
{
g_pRenderText->SetTextColor(dwTextColor[1]);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Text[1], RenderBoxSize.cx, iLineHeight, RT3_SORT_LEFT);
RenderPos.y += iLineHeight;

g_pRenderText->SetTextColor(dwTextColor[0]);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Text[0], RenderBoxSize.cx, iLineHeight);
}
else if(c->LifeTime[0] > 0)
{
g_pRenderText->SetTextColor(dwTextColor[0]);
g_pRenderText->RenderText(RenderPos.x, RenderPos.y, c->Text[0], RenderBoxSize.cx, iLineHeight);
}

/*if (KIND_PLAYER == c->Owner->Object.Kind && MODEL_PLAYER == c->Owner->Object.Type)
{
const int nGensMarkHeight = 18;
int nGensMarkPosY = (RenderPos.y - y - nGensMarkHeight) / 2 + y;

if(c->LifeTime[1] > 0)
RenderPos.y -= iLineHeight;

if (1 == c->Owner->m_byGensInfluence)
g_pNewUIGensRanking->RanderMark(x, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
else if (2 == c->Owner->m_byGensInfluence)
g_pNewUIGensRanking->RanderMark(x, y, c->Owner->m_byGensInfluence, c->Owner->m_byRankIndex, SEASON3B::CNewUIGensRanking::MARK_BOOLEAN, (float)RenderPos.y);
}*/

}


Creditos
Dexign


#79
Source Mu / Re:Window movable - Tela flutu...
Último mensaje por Dakosmu - Mar 23, 2025, 11:45 PM
v0.8 - last update - Special for @dizzys because he asked
the rest is up to you to practice and replicate

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión



// Vincula os botões de navegação do painel Layout
this->BindObject(eLayout_BACK, 31658, 17, 18, -1, -1);
this->BindObject(eLayout_FORWARD, 31659, 17, 18, -1, -1);


#pragma once

class CLayout
{
public:
    CLayout();

    // Atualiza o estado do painel (toggle F4 e drag and drop)
    void UpdateLayoutPanelWindow();

    int DrawToolTip(int X, int Y, LPCSTR Text, ...);

    // Desenha o painel flutuante na posição atual
    void DrawLayoutPanelWindow();
};

extern CLayout gLayout;


#include "stdafx.h"
#include "layout.h"
#include "Interface.h"
#include "Central.h"
#include "Defines.h"
#include "Import.h"
#include "CustomFont.h"
#include "Defines2.h"
#include <vector>
#include <string>
#include <fstream>
#include <windows.h> // Para DWORD, GetTickCount(), VK_F4, etc.

// Inicializa o gLayout e as variáveis de drag dentro da classe
CLayout::CLayout()
{
    // Construtor vazio. Caso necessite, adicione inicializações aqui.
}

CLayout gLayout;

void CLayout::UpdateLayoutPanelWindow()
{
    // Variável estática para controlar o estado da tecla F4
    static bool isF4Pressed = false;
    bool currentF4State = (GetAsyncKeyState(VK_F4) & 0x8000) != 0;

    if (currentF4State && !isF4Pressed)
    {
        // Alterna a flag de exibição do painel
        gInterface.Data[eLayout_MAIN].OnShow = !gInterface.Data[eLayout_MAIN].OnShow;
        isF4Pressed = true;
    }
    else if (!currentF4State)
    {
        isF4Pressed = false;
    }
}

int CLayout::DrawToolTip(int X, int Y, LPCSTR Text, ...)
{
    char Buff[2048];
    int BuffLen = sizeof(Buff);
    ZeroMemory(Buff, BuffLen);

    va_list args;
    va_start(args, Text);
    int Len = vsprintf_s(Buff, BuffLen, Text, args);
    va_end(args);

    return pDrawToolTip(X, Y, Buff);
}

// Variáveis globais para controle de páginas
int currentPage = 0;
int maxPages = 5; // Número total de páginas disponíveis
DWORD lastButtonClickTime = 0; // Tempo do último clique nos botões
const DWORD clickDelay = 300; // Delay entre cliques em milissegundos

// Variáveis globais para controle do drag e da posição do painel
bool   m_isDragging = false;
POINT  m_dragStartPoint;
float m_windowPosX = (MAX_WIN_WIDTH - 230.0f) / 2;
float m_windowPosY = (MAX_WIN_HEIGHT - 240.0f) / 2;

// Variável para controlar o tempo do último clique no botão de menu
DWORD lastMenuButtonClickTime = 0;
const DWORD menuClickDelay = 300; // Delay entre cliques em milissegundos

// Variável para controlar o tempo do último clique no botão de opções
DWORD lastOptionButtonClickTime = 0;
const DWORD optionClickDelay = 300; // Delay entre cliques em milissegundos

// ID do objeto de interface para o botão de menu
short eLayoutButtonMenu = 12350; // Usando um ID não usado
// ID do objeto de interface para o botão de opções
short eLayoutButtonOption = 12351; // Usando um ID não usado

void CLayout::DrawLayoutPanelWindow()
{
    // Se o painel não estiver para ser exibido, sai da função
    if (!gInterface.Data[eLayout_MAIN].OnShow)
        return;

    // Garante o foco do cursor
    pSetCursorFocus = true;

    // Variáveis para controle de clique e tempo
    bool isLeftButtonDown = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0;
    DWORD currentTime = GetTickCount();

    // Dimensões fixas do painel
    const float MainWidth = 230.0f;
    const float MainHeight = 240.0f;

    // Lógica para drag and drop
    if (pCheckMouseOver(m_windowPosX, m_windowPosY, MainWidth, MainHeight) || m_isDragging)
    {
        if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
        {
            if (!m_isDragging)
            {
                m_isDragging = true;
                m_dragStartPoint.x = pCursorX;
                m_dragStartPoint.y = pCursorY;
            }
            else
            {
                float deltaX = pCursorX - m_dragStartPoint.x;
                float deltaY = pCursorY - m_dragStartPoint.y;

                m_windowPosX += deltaX;
                m_windowPosY += deltaY;

                if (m_windowPosX < 0)
                    m_windowPosX = 0;
                else if (m_windowPosX > MAX_WIN_WIDTH - MainWidth)
                    m_windowPosX = MAX_WIN_WIDTH - MainWidth;

                if (m_windowPosY < 0)
                    m_windowPosY = 0;
                else if (m_windowPosY > MAX_WIN_HEIGHT - MainHeight)
                    m_windowPosY = MAX_WIN_HEIGHT - MainHeight;

                m_dragStartPoint.x = pCursorX;
                m_dragStartPoint.y = pCursorY;
            }
        }
        else
        {
            m_isDragging = false;
        }
    }
    else
    {
        m_isDragging = false;
    }

    // Desenha o painel flutuante na posição atual
    gCentral.PrintDropBox(m_windowPosX, m_windowPosY, MainWidth, MainHeight, 0, 0);

    // Define a posição base para o texto
    float StartX = m_windowPosX;
    float StartY = m_windowPosY;

    // --- Botão de menu ---
    // Mostrar o botão apenas na página 5 (índice 4)
    if (currentPage == 4)
    {
        // Definindo as dimensões e posição do botão menu
        float menuButtonWidth = 107.1f; // Mesma largura do botão Menu Option
        float menuButtonHeight = 29.0f; // Mesma altura do botão Menu Option
        float menuButtonX = m_windowPosX + (MainWidth / 2) - (menuButtonWidth / 2);
        float menuButtonY = m_windowPosY + 5.0f; // Posicionado mais acima

        // Vinculando o objeto de botão de menu (apenas uma vez)
        static bool buttonBound = false;
        if (!buttonBound) {
            gInterface.BindObject(eLayoutButtonMenu, 0x7A5E, menuButtonWidth, menuButtonHeight, -1, -1);
            gInterface.BindObject(eLayoutButtonOption, 0x7A5E, menuButtonWidth, menuButtonHeight, -1, -1);
            buttonBound = true;
        }

        // Desenhando o botão do menu
        bool isHovered = pCheckMouseOver(menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight);

        // Verificando se está sobre o botão
        if (isHovered)
        {
            if (isLeftButtonDown && (currentTime - lastMenuButtonClickTime > menuClickDelay))
            {
                // Desenhando o botão com estilo de clique
                pDrawButton(0x7A5E, menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight, 0, 58);

                // Marca o tempo do clique
                lastMenuButtonClickTime = currentTime;

                // Reproduz som ao clicar
                PlayBuffer(25, 0, 0);

                // Fecha o painel de layout
                gInterface.Data[eLayout_MAIN].OnShow = false;

                // aqui abre menu option
                if (!gInterface.CheckMenuWindow())
                {
                    gInterface.CloseCustomWindow();
                    gInterface.OpenMenuWindow();
                }
            }
            else
            {
                // Desenhando o botão com estilo de hover
                pDrawButton(0x7A5E, menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight, 0, 29);
                this->DrawToolTip(menuButtonX + 5, menuButtonY - 15, "Abrir Menu");
            }
        }
        else
        {
            // Desenhando o botão normal
            pDrawButton(0x7A5E, menuButtonX, menuButtonY, menuButtonWidth, menuButtonHeight, 0, 0);
        }

        // Desenha o texto "MENU" no botão
        gInterface.DrawFormat(eWhite, menuButtonX, menuButtonY + 9, menuButtonWidth, 3, "MENU");

        // ----- Botão Option -----
        // Posicionando o botão Option abaixo do botão Menu
        float optionButtonWidth = 107.1f;
        float optionButtonHeight = 29.0f;
        float optionButtonX = m_windowPosX + (MainWidth / 2) - (optionButtonWidth / 2);
        float optionButtonY = menuButtonY + menuButtonHeight + 5.0f; // 5 pixels abaixo do botão menu

        // Desenhando o botão de opções
        bool isOptionHovered = pCheckMouseOver(optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight);

        // Verificando se está sobre o botão
        if (isOptionHovered)
        {
            if (isLeftButtonDown && (currentTime - lastOptionButtonClickTime > optionClickDelay))
            {
                // Desenhando o botão com estilo de clique
                pDrawButton(0x7A5E, optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight, 0, 58);

                // Marca o tempo do clique
                lastOptionButtonClickTime = currentTime;

                // Reproduz som ao clicar
                PlayBuffer(25, 0, 0);

                // Aqui você pode adicionar a funcionalidade que deseja quando o botão for clicado
                // Por exemplo, abrir uma janela de configurações ou opções
                // Por enquanto, apenas fecha o layout como exemplo
                //gInterface.Data[eLayout_MAIN].OnShow = false;
            }
            else
            {
                // Desenhando o botão com estilo de hover
                pDrawButton(0x7A5E, optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight, 0, 29);
                this->DrawToolTip(optionButtonX + 5, optionButtonY - 15, "Configurações");
            }
        }
        else
        {
            // Desenhando o botão normal
            pDrawButton(0x7A5E, optionButtonX, optionButtonY, optionButtonWidth, optionButtonHeight, 0, 0);
        }

        // Desenha o texto "OPTION" no botão
        gInterface.DrawFormat(eWhite, optionButtonX, optionButtonY + 9, optionButtonWidth, 3, "OPTION");
    }

    // Cria vetores de linhas de texto para cada página

    // Página 1
    std::vector<std::string> textos1;
    textos1.push_back("SEJA BEM VINDO AO MUONLINE");
    textos1.push_back("O continente de MU era glorioso e vasto,");
    textos1.push_back("Quando Kundun surgiu, trazendo o caos mortal.");
    textos1.push_back("Heróis lutaram com força e magia.");
    textos1.push_back("Criaturas sombrias espalharam terror.");

    // Página 2
    std::vector<std::string> textos2;
    textos2.push_back("GUIA DE CLASSES");
    textos2.push_back("SM: Mestre da magia elemental.");
    textos2.push_back("BK: Guerreiro poderoso em combate corpo a corpo.");
    textos2.push_back("Elf: Arqueira ágil com habilidades de suporte.");
    textos2.push_back("MG: Híbrido de força física e poderes mágicos.");
    textos2.push_back("as trevas estavam corruptas");

    // Página 3
    std::vector<std::string> textos3;
    textos3.push_back("MAPAS DE MU ONLINE");
    textos3.push_back("Lorencia: Cidade inicial e principal.");
    textos3.push_back("Noria: Lar dos elfos e seres místicos.");
    textos3.push_back("Davias: Deserto habitado por criaturas perigosas.");
    textos3.push_back("Atlans: Reino subaquático de monstros exóticos.");
    textos3.push_back("as vezes podemos alcançar");

    // Página 4
    std::vector<std::string> textos4;
    textos4.push_back("EVENTOS ESPECIAIS");
    textos4.push_back("Blood Castle: Desafie os guardiões.");
    textos4.push_back("Devil Square: Arena de monstros.");
    textos4.push_back("Chaos Castle: Sobreviva contra monstros.");
    textos4.push_back("Golden Invasion: Lute contra monstros dourados.");
    textos4.push_back("venha vamos correr para alcançar");

    // Página 5
    std::vector<std::string> textos5;

    std::vector<std::vector<std::string>> textosPages;
    textosPages.push_back(textos1);
    textosPages.push_back(textos2);
    textosPages.push_back(textos3);
    textosPages.push_back(textos4);
    textosPages.push_back(textos5);

    // Vetor com os tamanhos (em pontos) para cada linha
    std::vector<int> fontSizes;
    fontSizes.push_back(20);
    fontSizes.push_back(16);
    fontSizes.push_back(16);
    fontSizes.push_back(16);
    fontSizes.push_back(16);

    // Para este exemplo, as linhas da página serão sempre desenhadas com "Segoe UI" (ou outra fonte caso desejado)
    // Se for necessário utilizar fontes diferentes para cada linha, crie um vetor adicional (veja exemplos anteriores)

    // Define o espaçamento vertical entre as linhas
    float linhaAltura = 30.0f;

    // Escolhe o texto da página atual
    std::vector<std::string> textos = textosPages[currentPage];

    // Para cada linha, cria e aplica uma fonte personalizada com o tamanho correspondente e desenha o texto
    for (size_t i = 0; i < textos.size(); i++)
    {
        HFONT hCustomFont = CreateFontA(
            -fontSizes[i],   // Tamanho da fonte (em pontos)
            0,               // Largura: ajuste automático
            0,               // Escapamento
            0,               // Orientação
            FW_BOLD,         // Peso: negrito
            FALSE,           // Não itálico
            FALSE,           // Sem sublinhado
            FALSE,           // Sem tachado
            DEFAULT_CHARSET,
            OUT_TT_PRECIS,
            CLIP_DEFAULT_PRECIS,
            CLEARTYPE_QUALITY,
            DEFAULT_PITCH | FF_DONTCARE,
            "Segoe UI"       // Nome da fonte
        );

        if (hCustomFont)
        {
            pSetFont(pTextThis(), (int)hCustomFont);
            pDrawText(pTextThis(), StartX - 16, StartY + 10 + i * linhaAltura,
                textos[i].c_str(), 260, 0, (LPINT)3, 0);
            DeleteObject(hCustomFont);
        }
    }

    // Botões de navegação (avançar e voltar)
    float buttonWidth = 20.0f;
    float buttonHeight = 20.0f;

    float backButtonX = m_windowPosX + 10.0f;
    float backButtonY = m_windowPosY + MainHeight - 30.0f;

    float forwardButtonX = m_windowPosX + MainWidth - 30.0f;
    float forwardButtonY = m_windowPosY + MainHeight - 30.0f;

    // Botão de voltar (se não estiver na primeira página)
    if (currentPage > 0)
    {
        gInterface.DrawGUI(eLayout_BACK, backButtonX, backButtonY);

        if (pCheckMouseOver(backButtonX, backButtonY, buttonWidth, buttonHeight))
        {
            this->DrawToolTip(backButtonX + 5, backButtonY - 15, "Anterior");

            if (isLeftButtonDown && (currentTime - lastButtonClickTime > clickDelay))
            {
                currentPage--;
                lastButtonClickTime = currentTime;
                PlayBuffer(25, 0, 0);
            }
        }
    }

    // Botão de avançar (se não estiver na última página)
    if (currentPage < maxPages - 1)
    {
        gInterface.DrawGUI(eLayout_FORWARD, forwardButtonX, forwardButtonY);

        if (pCheckMouseOver(forwardButtonX, forwardButtonY, buttonWidth, buttonHeight))
        {
            this->DrawToolTip(forwardButtonX + 5, forwardButtonY - 15, "Próximo");

            if (isLeftButtonDown && (currentTime - lastButtonClickTime > clickDelay))
            {
                currentPage++;
                lastButtonClickTime = currentTime;
                PlayBuffer(25, 0, 0);
            }
        }
    }

    // Desenha o indicador de página com uma fonte fixa para não ser alterado ao passar o mouse sobre as setas
    HFONT hFixedFont = CreateFontA(
        -16,                     // Tamanho fixo da fonte
        0,
        0,
        0,
        FW_BOLD,
        FALSE,
        FALSE,
        FALSE,
        DEFAULT_CHARSET,
        OUT_TT_PRECIS,
        CLIP_DEFAULT_PRECIS,
        CLEARTYPE_QUALITY,
        DEFAULT_PITCH | FF_DONTCARE,
        "Segoe UI"              // Fonte fixa ("Segoe UI")
    );

    if (hFixedFont)
    {
        pSetFont(pTextThis(), (int)hFixedFont);
        char pageText[50];
        sprintf_s(pageText, "Página %d/%d", currentPage + 1, maxPages);
        pDrawText(pTextThis(), m_windowPosX + MainWidth / 2 - 40, m_windowPosY + MainHeight - 30,
            pageText, 80, 0, (LPINT)3, 0);
        DeleteObject(hFixedFont);
    }

    // --- Botão de fechar ---
    float closeButtonX = m_windowPosX + MainWidth - 20;
    float closeButtonY = m_windowPosY - 10;

    gInterface.DrawGUI(eMenu_CLOSE, closeButtonX, closeButtonY);

    if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29))
    {
        this->DrawToolTip(closeButtonX + 5, closeButtonY + 25, "Close");
    }

    if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29) && (GetAsyncKeyState(VK_LBUTTON) & 0x8000))
    {
        gInterface.Data[eLayout_MAIN].OnShow = false;
    }
}

#80
Source Mu / Re:Window movable - Tela flutu...
Último mensaje por Dakosmu - Mar 23, 2025, 11:27 PM
v0.7 - with pages

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión



    // Vincula os botões de navegação do painel Layout
    this->BindObject(eLayout_BACK, 31658, 17, 18, -1, -1);
    this->BindObject(eLayout_FORWARD, 31659, 17, 18, -1, -1);


#include "stdafx.h"
#include "layout.h"
#include "Interface.h"
#include "Central.h"
#include "Defines.h"
#include "Import.h"
#include "CustomFont.h"
#include "Defines2.h"
#include <vector>
#include <string>
#include <fstream>
#include <windows.h> // Para DWORD, GetTickCount(), VK_F4, etc.

// Inicializa o gLayout e as variáveis de drag dentro da classe
CLayout::CLayout()
{
    // Construtor vazio. Caso necessite, adicione inicializações aqui.
}

CLayout gLayout;

void CLayout::UpdateLayoutPanelWindow()
{
    // Variável estática para controlar o estado da tecla F4
    static bool isF4Pressed = false;
    bool currentF4State = (GetAsyncKeyState(VK_F4) & 0x8000) != 0;

    if (currentF4State && !isF4Pressed)
    {
        // Alterna a flag de exibição do painel
        gInterface.Data[eLayout_MAIN].OnShow = !gInterface.Data[eLayout_MAIN].OnShow;
        isF4Pressed = true;
    }
    else if (!currentF4State)
    {
        isF4Pressed = false;
    }
}

int CLayout::DrawToolTip(int X, int Y, LPCSTR Text, ...)
{
    char Buff[2048];
    int BuffLen = sizeof(Buff);
    ZeroMemory(Buff, BuffLen);

    va_list args;
    va_start(args, Text);
    int Len = vsprintf_s(Buff, BuffLen, Text, args);
    va_end(args);

    return pDrawToolTip(X, Y, Buff);
}

// Variáveis globais para controle de páginas
int currentPage = 0;
int maxPages = 4; // Número total de páginas disponíveis
DWORD lastButtonClickTime = 0; // Tempo do último clique nos botões
const DWORD clickDelay = 300; // Delay entre cliques em milissegundos

// Variáveis globais para controle do drag e da posição do painel
bool   m_isDragging = false;
POINT  m_dragStartPoint;
float m_windowPosX = (MAX_WIN_WIDTH - 230.0f) / 2;
float m_windowPosY = (MAX_WIN_HEIGHT - 240.0f) / 2;

void CLayout::DrawLayoutPanelWindow()
{
    // Se o painel não estiver para ser exibido, sai da função
    if (!gInterface.Data[eLayout_MAIN].OnShow)
        return;

    // Garante o foco do cursor
    pSetCursorFocus = true;

    // Dimensões fixas do painel
    const float MainWidth = 230.0f;
    const float MainHeight = 240.0f;

    // Lógica para drag and drop
    if (pCheckMouseOver(m_windowPosX, m_windowPosY, MainWidth, MainHeight) || m_isDragging)
    {
        if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
        {
            if (!m_isDragging)
            {
                m_isDragging = true;
                m_dragStartPoint.x = pCursorX;
                m_dragStartPoint.y = pCursorY;
            }
            else
            {
                float deltaX = pCursorX - m_dragStartPoint.x;
                float deltaY = pCursorY - m_dragStartPoint.y;

                m_windowPosX += deltaX;
                m_windowPosY += deltaY;

                if (m_windowPosX < 0)
                    m_windowPosX = 0;
                else if (m_windowPosX > MAX_WIN_WIDTH - MainWidth)
                    m_windowPosX = MAX_WIN_WIDTH - MainWidth;

                if (m_windowPosY < 0)
                    m_windowPosY = 0;
                else if (m_windowPosY > MAX_WIN_HEIGHT - MainHeight)
                    m_windowPosY = MAX_WIN_HEIGHT - MainHeight;

                m_dragStartPoint.x = pCursorX;
                m_dragStartPoint.y = pCursorY;
            }
        }
        else
        {
            m_isDragging = false;
        }
    }
    else
    {
        m_isDragging = false;
    }

    // Desenha o painel flutuante na posição atual
    gCentral.PrintDropBox(m_windowPosX, m_windowPosY, MainWidth, MainHeight, 0, 0);

    // Define a posição base para o texto
    float StartX = m_windowPosX;
    float StartY = m_windowPosY;

    // Cria vetores de linhas de texto para cada página

    // Página 1
    std::vector<std::string> textos1;
    textos1.push_back("SEJA BEM VINDO AO MUONLINE");
    textos1.push_back("O continente de MU era glorioso e vasto,");
    textos1.push_back("Quando Kundun surgiu, trazendo o caos mortal.");
    textos1.push_back("Heróis lutaram com força e magia.");
    textos1.push_back("Criaturas sombrias espalharam terror.");

    // Página 2
    std::vector<std::string> textos2;
    textos2.push_back("GUIA DE CLASSES");
    textos2.push_back("SM: Mestre da magia elemental.");
    textos2.push_back("BK: Guerreiro poderoso em combate corpo a corpo.");
    textos2.push_back("Elf: Arqueira ágil com habilidades de suporte.");
    textos2.push_back("MG: Híbrido de força física e poderes mágicos.");
    textos2.push_back("as trevas estavam corruptas");

    // Página 3
    std::vector<std::string> textos3;
    textos3.push_back("MAPAS DE MU ONLINE");
    textos3.push_back("Lorencia: Cidade inicial e principal.");
    textos3.push_back("Noria: Lar dos elfos e seres místicos.");
    textos3.push_back("Davias: Deserto habitado por criaturas perigosas.");
    textos3.push_back("Atlans: Reino subaquático de monstros exóticos.");
    textos3.push_back("as vezes podemos alcançar");

    // Página 4
    std::vector<std::string> textos4;
    textos4.push_back("EVENTOS ESPECIAIS");
    textos4.push_back("Blood Castle: Desafie os guardiões.");
    textos4.push_back("Devil Square: Arena de monstros.");
    textos4.push_back("Chaos Castle: Sobreviva contra monstros.");
    textos4.push_back("Golden Invasion: Lute contra monstros dourados.");
    textos4.push_back("venha vamos correr para alcançar");

    std::vector<std::vector<std::string>> textosPages;
    textosPages.push_back(textos1);
    textosPages.push_back(textos2);
    textosPages.push_back(textos3);
    textosPages.push_back(textos4);

    // Vetor com os tamanhos (em pontos) para cada linha
    std::vector<int> fontSizes;
    fontSizes.push_back(20);
    fontSizes.push_back(16);
    fontSizes.push_back(16);
    fontSizes.push_back(16);
    fontSizes.push_back(16);

    // Para este exemplo, as linhas da página serão sempre desenhadas com "Segoe UI" (ou outra fonte caso desejado)
    // Se for necessário utilizar fontes diferentes para cada linha, crie um vetor adicional (veja exemplos anteriores)

    // Define o espaçamento vertical entre as linhas
    float linhaAltura = 30.0f;

    // Escolhe o texto da página atual
    std::vector<std::string> textos = textosPages[currentPage];

    // Para cada linha, cria e aplica uma fonte personalizada com o tamanho correspondente e desenha o texto
    for (size_t i = 0; i < textos.size(); i++)
    {
        HFONT hCustomFont = CreateFontA(
            -fontSizes[i],   // Tamanho da fonte (em pontos)
            0,               // Largura: ajuste automático
            0,               // Escapamento
            0,               // Orientação
            FW_BOLD,         // Peso: negrito
            FALSE,           // Não itálico
            FALSE,           // Sem sublinhado
            FALSE,           // Sem tachado
            DEFAULT_CHARSET,
            OUT_TT_PRECIS,
            CLIP_DEFAULT_PRECIS,
            CLEARTYPE_QUALITY,
            DEFAULT_PITCH | FF_DONTCARE,
            "Segoe UI"       // Nome da fonte
        );

        if (hCustomFont)
        {
            pSetFont(pTextThis(), (int)hCustomFont);
            pDrawText(pTextThis(), StartX - 16, StartY + 10 + i * linhaAltura,
                textos[i].c_str(), 260, 0, (LPINT)3, 0);
            DeleteObject(hCustomFont);
        }
    }

    // Botões de navegação (avançar e voltar)
    float buttonWidth = 20.0f;
    float buttonHeight = 20.0f;

    float backButtonX = m_windowPosX + 10.0f;
    float backButtonY = m_windowPosY + MainHeight - 30.0f;

    float forwardButtonX = m_windowPosX + MainWidth - 30.0f;
    float forwardButtonY = m_windowPosY + MainHeight - 30.0f;

    bool isLeftButtonDown = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0;
    DWORD currentTime = GetTickCount();

    // Botão de voltar (se não estiver na primeira página)
    if (currentPage > 0)
    {
        gInterface.DrawGUI(eLayout_BACK, backButtonX, backButtonY);

        if (pCheckMouseOver(backButtonX, backButtonY, buttonWidth, buttonHeight))
        {
            this->DrawToolTip(backButtonX + 5, backButtonY - 15, "Anterior");

            if (isLeftButtonDown && (currentTime - lastButtonClickTime > clickDelay))
            {
                currentPage--;
                lastButtonClickTime = currentTime;
                PlayBuffer(25, 0, 0);
            }
        }
    }

    // Botão de avançar (se não estiver na última página)
    if (currentPage < maxPages - 1)
    {
        gInterface.DrawGUI(eLayout_FORWARD, forwardButtonX, forwardButtonY);

        if (pCheckMouseOver(forwardButtonX, forwardButtonY, buttonWidth, buttonHeight))
        {
            this->DrawToolTip(forwardButtonX + 5, forwardButtonY - 15, "Próximo");

            if (isLeftButtonDown && (currentTime - lastButtonClickTime > clickDelay))
            {
                currentPage++;
                lastButtonClickTime = currentTime;
                PlayBuffer(25, 0, 0);
            }
        }
    }

    // Desenha o indicador de página com uma fonte fixa para não ser alterado ao passar o mouse sobre as setas
    HFONT hFixedFont = CreateFontA(
        -16,                     // Tamanho fixo da fonte
        0,
        0,
        0,
        FW_BOLD,
        FALSE,
        FALSE,
        FALSE,
        DEFAULT_CHARSET,
        OUT_TT_PRECIS,
        CLIP_DEFAULT_PRECIS,
        CLEARTYPE_QUALITY,
        DEFAULT_PITCH | FF_DONTCARE,
        "Segoe UI"              // Fonte fixa ("Segoe UI")
    );

    if (hFixedFont)
    {
        pSetFont(pTextThis(), (int)hFixedFont);
        char pageText[50];
        sprintf_s(pageText, "Página %d/%d", currentPage + 1, maxPages);
        pDrawText(pTextThis(), m_windowPosX + MainWidth / 2 - 40, m_windowPosY + MainHeight - 30,
            pageText, 80, 0, (LPINT)3, 0);
        DeleteObject(hFixedFont);
    }

    // --- Botão de fechar ---
    float closeButtonX = m_windowPosX + MainWidth - 20;
    float closeButtonY = m_windowPosY - 10;

    gInterface.DrawGUI(eMenu_CLOSE, closeButtonX, closeButtonY);

    if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29))
    {
        this->DrawToolTip(closeButtonX + 5, closeButtonY + 25, "Close");
    }

    if (pCheckMouseOver(closeButtonX, closeButtonY, 36, 29) && (GetAsyncKeyState(VK_LBUTTON) & 0x8000))
    {
        gInterface.Data[eLayout_MAIN].OnShow = false;
    }
}


Creditos
T-LEGENDARY
🡱 🡳