Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
FigmentBoy committed Mar 10, 2021
1 parent 6596467 commit e7f38e5
Show file tree
Hide file tree
Showing 425 changed files with 102,146 additions and 0 deletions.
31 changes: 31 additions & 0 deletions DialogBox.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DialogBox", "DialogBox\DialogBox.vcxproj", "{3E19C490-F84B-44FF-8058-E55C4D521E76}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Debug|x64.ActiveCfg = Debug|x64
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Debug|x64.Build.0 = Debug|x64
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Debug|x86.ActiveCfg = Debug|Win32
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Debug|x86.Build.0 = Debug|Win32
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Release|x64.ActiveCfg = Release|x64
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Release|x64.Build.0 = Release|x64
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Release|x86.ActiveCfg = Release|Win32
{3E19C490-F84B-44FF-8058-E55C4D521E76}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {77285168-1610-411D-AF35-02939776F266}
EndGlobalSection
EndGlobal
54 changes: 54 additions & 0 deletions DialogBox/Dialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include "Dialog.h"

void DialogObject::mem_init() {
uintptr_t base = (uintptr_t)GetModuleHandle(0);
DialogObject::init = reinterpret_cast<decltype(DialogObject::init)>(base + 0x6D2E0);
}

void DialogLayer::mem_init() {
uintptr_t base = (uintptr_t)GetModuleHandle(0);
DialogLayer::create = reinterpret_cast<decltype(DialogLayer::create)>(base + 0x6D470);
DialogLayer::animateIn = reinterpret_cast<decltype(DialogLayer::animateIn)>(base + 0x6E130);
}

std::string GetPlayerName() {
size_t base = reinterpret_cast<size_t>(GetModuleHandle(0));
uintptr_t AccountManager = *reinterpret_cast<std::uintptr_t*>(base + 0x3222D8);

auto name = *reinterpret_cast<std::string*>(AccountManager + 0x108);

return name;
}


CCDialogObject* DialogObject::create(std::string title, std::string text, int type, float text_scale, bool is_unskippable, _ccColor3B color) {
CCDialogObject* obj = new CCDialogObject();

int index;
int pos = 0;
std::string username;

while ((index = text.find("{user}", pos)) != std::string::npos) {
if (username.empty()) {
username = GetPlayerName();
}
text.replace(index, 6, username);

pos = index + 1;
}


while ((index = title.find("{user}", pos)) != std::string::npos) {
if (username.empty()) {
username = GetPlayerName();
}
title.replace(index, 6, username);

pos = index + 1;
}

init(obj, title, text, type, text_scale, is_unskippable, color);
obj->autorelease();

return obj;
}
23 changes: 23 additions & 0 deletions DialogBox/Dialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once
#include <cocos2d.h>
#include <string>

class CCDialogObject : public cocos2d::CCObject {
protected:
char pad[0x60];
};

using namespace cocos2d;
namespace DialogObject {
inline bool(__thiscall* init)(CCDialogObject* self, std::string title, std::string text, int type, float unknown, bool also_unknown, _ccColor3B textColor);

CCDialogObject* create(std::string title, std::string text, int type, float text_scale, bool is_unskippable, _ccColor3B color);

void mem_init();
}

namespace DialogLayer {
inline CCLayerColor* (__fastcall* create)(CCObject*, CCArray*, int);
inline CCAction* (__thiscall* animateIn)(CCLayerColor*, int);
void mem_init();
}
567 changes: 567 additions & 0 deletions DialogBox/DialogBox.vcxproj

Large diffs are not rendered by default.

Loading

0 comments on commit e7f38e5

Please sign in to comment.