Paylaşım [Release] Discord Icon In sro_devkit

ZaKuRa

SRO Developer ' Pk2 Editor ' Designer'
.
Katılım
3 Nis 2019
Mesajlar
240
Tepkime puanı
265
Puanları
63
Yaş
28
Konum
Venezuela
Kredi
0.00[TL]
vsro
First you will create new file name in " ClientLib " IFDiscordGuide.h in Header Files , and another one IFDiscordGuide.cpp in Source Files.


1595682030680.png 1595681145097.png

Code in IFDiscordGuide.h

C#:
#pragma once
#include "IFDecoratedStatic.h"

#define GUIDE_FLORIAN2 13382

class CIFDiscordGuide : public CIFDecoratedStatic
{
    GFX_DECLARE_DYNCREATE(CIFDiscordGuide)

public:
    bool OnCreate(long ln) override;
    int OnMouseLeftUp(int a1, int x, int y) override;
    void OnCIFReady() override;
};

IFDiscordGuide.cpp . Code
C#:
#include "../../../DevKit_DLL/src/StdAfx.h"
#include "IFDiscordGuide.h"
#include "GEffSoundBody.h"
#include "GInterface.h"
#include <Windows.h>
#include <string>
#include <iostream>


GFX_IMPLEMENT_DYNCREATE(CIFDiscordGuide, CIFDecoratedStatic)

bool CIFDiscordGuide::OnCreate(long ln)
{
    printf("> " __FUNCTION__ "(%d)\n", ln);
    CIFDecoratedStatic::OnCreate(ln);

    TB_Func_13("icon\\etc\\discord_1.ddj", 0, 0);
    sub_634470("icon\\etc\\discord_2.ddj");
   
    set_N00009BD4(2);
    set_N00009BD3(500);

    CGEffSoundBody::get()->PlaySound(L"snd_quest");


    return true;
}

int CIFDiscordGuide::OnMouseLeftUp(int a1, int x, int y)
{
    printf("> " __FUNCTION__ "(%d, %d, %d)\n", a1, x, y);

    CGEffSoundBody::get()->PlaySound(L"snd_quest");
        ShellExecute(NULL, "open", "https://discordapp.com/invite/GOOSXC", NULL, NULL, SW_SHOWNORMAL);
    return 0;
}

void CIFDiscordGuide::OnCIFReady()
{
    printf("> " __FUNCTION__ "\n");

    CIFDecoratedStatic::OnCIFReady();
    sub_633990();

}

Next Step go to DevKit_DLL and open DllMain.cpp file then added this
include ,


C#:
#include "IFDiscordGuide.h""

then in // Inject all the new objects added this code

C#:
RegisterObject(&GFX_RUNTIME_CLASS(CIFDiscordGuide));

then go to AlramGuideMgrWnd.cpp in ClientLib , Source Files, added this #include


C#:
#include "IFDiscordGuide.h"

and this in same file
C#:
case GUIDE_FLORIAN2:
            pObj = CreateInstance(this, GFX_RUNTIME_CLASS(CIFDiscordGuide), rect, GUIDE_FLORIAN2, 0);
            break;


Last thing Ginterface.cpp in ClientLib , Source File

added this #include

C#:
#include "IFDiscordGuide.h"

and this code also


C#:
void CGInterface::CreateDiscordEvent() {
    CGWnd *guide = GetAlarmManager()->GetGuide(GUIDE_FLORIAN2);
}

also added this in AfterOnCreate

C#:
void CreateDiscordEvent();


also added this in GInterface.h in ClientLib


C#:
CreateDiscordEvent();

Credits: florian0 / Goosxc
 
Üst