Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions data/mcswitch_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28221,7 +28221,7 @@ Address,Quality,Size,Name
0x0000007100400a80,O,000028,_ZN10FJ_FuiNode8getStageEv
0x0000007100400a9c,U,000256,_ZN10FJ_FuiNode16addEventListenerE12eFJEventTypePS_PFvS1_P8FJ_EventEb
0x0000007100400b9c,U,000004,
0x0000007100400ba0,U,000076,getChildByName__10FJ_FuiNodeFRCQ2_3std78basic_string__tm__58_cQ2_3std20char_traits__tm__2_cQ2_3std18allocator__tm__2_c
0x0000007100400ba0,O,000076,_ZN10FJ_FuiNode14getChildByNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE
0x0000007100400bec,O,000020,_ZN10FJ_FuiNode11asMovieClipEv
0x0000007100400c00,U,000044,
0x0000007100400c2c,U,000008,
Expand Down Expand Up @@ -28471,7 +28471,7 @@ Address,Quality,Size,Name
0x0000007100406e50,U,000028,
0x0000007100406e6c,U,000068,
0x0000007100406eb0,U,000096,
0x0000007100406f10,U,000028,
0x0000007100406f10,O,000028,_ZN10FJ_FuiNode12currentFrameEv
0x0000007100406f2c,O,000016,_ZN10FJ_FuiNode4setXEf
0x0000007100406f3c,U,000080,
0x0000007100406f8c,O,000016,_ZN10FJ_FuiNode4setYEf
Expand Down Expand Up @@ -29240,7 +29240,7 @@ Address,Quality,Size,Name
0x000000710042f058,U,000476,
0x000000710042f234,U,000332,_ZN11FJ_PanoramaC_gen
0x000000710042f380,U,000052,
0x000000710042f3b4,U,000132,
0x000000710042f3b4,O,000132,_ZN11FJ_Panorama15GetCurrentFrameEv
0x000000710042f438,U,000224,
0x000000710042f518,U,000008,
0x000000710042f520,U,000048,_ZN12FJ_PauseMenuC_gen
Expand Down Expand Up @@ -30440,7 +30440,7 @@ Address,Quality,Size,Name
0x00000071004881a4,U,000264,_ZN7fuiFile17resolveReferencesEPS_
0x00000071004882ac,O,000008,_ZN18fuiRenderNodeStage8addChildEP13fuiRenderNode
0x00000071004882b4,M,000280,_ZN3fui11unloadSceneEP7fuiFile
0x00000071004883cc,U,000012,
0x00000071004883cc,O,000012,_ZN3fui9setOriginEff
0x00000071004883d8,O,000048,_ZN3fui13setResolutionEi
0x0000007100488408,O,000008,_ZN3fui13getResolutionEv
0x0000007100488410,U,000104,_ZN3fui4tickEv
Expand Down Expand Up @@ -30653,7 +30653,7 @@ Address,Quality,Size,Name
0x00000071004913d4,U,000012,
0x00000071004913e0,U,000008,
0x00000071004913e8,U,000088,
0x0000007100491440,U,000012,
0x0000007100491440,O,000012,_ZN21fuiRenderNodeTimeline12currentFrameEv
0x000000710049144c,U,000240,
0x000000710049153c,U,000008,
0x0000007100491544,U,000228,
Expand Down Expand Up @@ -35327,7 +35327,7 @@ Address,Quality,Size,Name
0x000000710054bd30,U,000056,
0x000000710054bd68,U,000020,_ZN3Gui14sub_710054BD68Ei
0x000000710054bd7c,U,000420,UIComponent_Chat__render
0x000000710054bf20,U,000008,
0x000000710054bf20,O,000008,_ZN19ConsoleUIController15getScreenHeightEv
0x000000710054bf28,O,000008,_ZN19ConsoleUIController14getScreenWidthEv
0x000000710054bf30,U,000048,
0x000000710054bf60,O,000132,_ZN7UIScene6renderEiiN9C4JRender13eViewportTypeE
Expand All @@ -35345,9 +35345,9 @@ Address,Quality,Size,Name
0x000000710054c39c,U,000420,_ZN26UIComponent_MenuBackground6renderEiiN9C4JRender13eViewportTypeE
0x000000710054c540,U,000108,_ZN20UIComponent_PanoramaC1EiP7UILayer
0x000000710054c5ac,U,000120,
0x000000710054c624,U,000260,_ZN20UIComponent_Panorama4tickEv
0x000000710054c624,O,000260,_ZN20UIComponent_Panorama4tickEv
0x000000710054c728,U,000072,
0x000000710054c770,U,000384,_ZN20UIComponent_Panorama6renderEiiN9C4JRender13eViewportTypeE
0x000000710054c770,M,000384,_ZN20UIComponent_Panorama6renderEiiN9C4JRender13eViewportTypeE
0x000000710054c8f0,U,000044,_ZN20UIComponent_Panorama12handleReloadEv
0x000000710054c91c,U,000416,_ZN28UIComponent_PressStartToPlayC1EiP7UILayer
0x000000710054cabc,U,000092,_ZN9UIControl10setVisibleEb
Expand Down Expand Up @@ -35462,7 +35462,7 @@ Address,Quality,Size,Name
0x0000007100553aa8,U,000256,ConsoleUIController__TextureSubstitutionCreateCallbackFui
0x0000007100553ba8,U,000040,_ZN19ConsoleUIController37TextureSubstitutionDestroyCallbackFuiEi
0x0000007100553bd0,U,000692,_ZN19ConsoleUIController9SetupFontEv
0x0000007100553e84,U,002052,_ZN19ConsoleUIController9loadSkinsEv
0x0000007100553e84,O,002052,_ZN19ConsoleUIController9loadSkinsEv
0x0000007100554688,U,000068,_ZN19ConsoleUIController18getFontForLanguageEi
0x00000071005546cc,U,000888,_ZN19ConsoleUIController10createFontEN19ConsoleUIController5EFontE
0x0000007100554a44,U,000064,_ZN19ConsoleUIController17updateCurrentFontEv
Expand All @@ -35478,7 +35478,7 @@ Address,Quality,Size,Name
0x0000007100554dd8,U,000120,_ZN7UIGroup15ReloadAllLayersEv
0x0000007100554e50,O,000024,_ZN19ConsoleUIController30setResolutionChangeDisableFlagEN13IUIController24eRESOLUTION_DISABLE_FLAGE
0x0000007100554e68,O,000024,_ZN19ConsoleUIController32clearResolutionChangeDisableFlagEN13IUIController24eRESOLUTION_DISABLE_FLAGE
0x0000007100554e80,U,000164,
0x0000007100554e80,O,000164,_ZN19ConsoleUIController8loadSkinERKNSt3__112basic_stringIwNS0_11char_traitsIwEENS0_9allocatorIwEEEES8_i
0x0000007100554f24,U,000280,
0x000000710055503c,U,000088,
0x0000007100555094,U,000196,
Expand Down Expand Up @@ -37122,7 +37122,7 @@ Address,Quality,Size,Name
0x0000007100598e40,U,000008,_ZN26UIComponent_MenuBackground11stealsFocusEv
0x0000007100598e48,U,000008,_ZN26UIComponent_MenuBackground8hasFocusEi
0x0000007100598e50,U,000008,_ZN26UIComponent_MenuBackground16hidesLowerScenesEv
0x0000007100598e58,U,000036,_ZN20UIComponent_PanoramaD0Ev
0x0000007100598e58,O,000036,_ZN20UIComponent_PanoramaD0Ev
0x0000007100598e7c,U,000008,
0x0000007100598e84,U,000008,_ZN20UIComponent_Panorama11stealsFocusEv
0x0000007100598e8c,U,000008,_ZN20UIComponent_Panorama8hasFocusEi
Expand Down
18 changes: 9 additions & 9 deletions src/4JLibraries_Source/NX/Program/PRO_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void DefineActions() {
}

void PopupToast() {
gConsoleUIController.SetAchievementUnlocked();
g_consoleUIController.SetAchievementUnlocked();
}

bool unk() {
Expand Down Expand Up @@ -251,7 +251,7 @@ extern "C" void nnMain() {
CInput::sInstance->SetCircleCrossSwapped(true);
int screenType = 1; // TODO: shove function that gets screenType, haven't done it so far because i'm
// unsure on how to name that func
gConsoleUIController.setResolutionChangeDisableFlag(IUIController::eRESOLUTION_DISABLE_FLAG::FLAG_0);
g_consoleUIController.setResolutionChangeDisableFlag(IUIController::eRESOLUTION_DISABLE_FLAG::FLAG_0);

int screenWidth, screenHeight;
if (screenType == 1) {
Expand All @@ -262,7 +262,7 @@ extern "C" void nnMain() {
screenHeight = 720;
}

gConsoleUIController.init(screenWidth, screenHeight);
g_consoleUIController.init(screenWidth, screenHeight);
CConsoleMinecraftApp::sInstance.CommerceInit();
CConsoleMinecraftApp::sInstance.initTime();
// funny thing is that all args seems to be unused
Expand Down Expand Up @@ -358,7 +358,7 @@ extern "C" void nnMain() {
if (CGameNetworkManager::sInstance.IsLocalGame()
&& CGameNetworkManager::sInstance.GetPlayerCount() == 1) {
primaryPad = CProfile::sInstance->GetPrimaryPad();
isPaused = gConsoleUIController.IsPauseMenuDisplayed(primaryPad);
isPaused = g_consoleUIController.IsPauseMenuDisplayed(primaryPad);
} else {
isPaused = false;
}
Expand All @@ -375,18 +375,18 @@ extern "C" void nnMain() {
Minecraft::sInstance->m_soundEngine->playMusicTick();
CConsoleMinecraftApp::sInstance.GetCommerceInstance()->tick();
InfoBarManager::StartTimingCategory(InfoBarManager::eTimingCagegory::ConsoleUIControllerTick);
gConsoleUIController.tick();
g_consoleUIController.tick();
InfoBarManager::EndTimingCategory(InfoBarManager::eTimingCagegory::ConsoleUIControllerTick);
Renderer::sInstance->vtbl_7101130608_func_17();
InfoBarManager::StartTimingCategory(InfoBarManager::eTimingCagegory::ConsoleUIControllerRender);
gConsoleUIController.render();
g_consoleUIController.render();
InfoBarManager::EndTimingCategory(InfoBarManager::eTimingCagegory::ConsoleUIControllerRender);
InfoBarManager::EndTimingCategory(InfoBarManager::eTimingCagegory::InitTicking);
PIXBeginNamedEvent(0.0, "Frame present");
Renderer::sInstance->Present();
PIXEndNamedEvent();
Renderer::sInstance->Set_matrixDirty();
gConsoleUIController.CheckMenuDisplayed();
g_consoleUIController.CheckMenuDisplayed();

PIXBeginNamedEvent(0.0, "Profile load check");
if (CInput::sControllers) {
Expand Down Expand Up @@ -428,7 +428,7 @@ extern "C" void nnMain() {
CConsoleMinecraftApp::sInstance.HandleXuiActions();
if (CProfile::sInstance->IsFullVersion()) {
if (!CConsoleMinecraftApp::sHideTrialTimer) {
gConsoleUIController.ShowTrialTimer(false);
g_consoleUIController.ShowTrialTimer(false);
CConsoleMinecraftApp::sHideTrialTimer = true;
}
Vec3::resetPool();
Expand All @@ -438,7 +438,7 @@ extern "C" void nnMain() {
if (CConsoleMinecraftApp::sInstance.IsAppPaused())
CConsoleMinecraftApp::sInstance.UpdateTrialPausedTimer();
primaryPad = CProfile::sInstance->GetPrimaryPad();
gConsoleUIController.UpdateTrialTimer(primaryPad);
g_consoleUIController.UpdateTrialTimer(primaryPad);
Vec3::resetPool();
}
}
9 changes: 7 additions & 2 deletions src/4JLibraries_Source/fui/fui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ void fui::render(fuiFile* file, float a1, float a2, float a3, float a4, float a5

renderer->MatrixMode(0);
renderer->MatrixSetIdentity();
renderer->MatrixTranslate(this->m_unk5 - a1, this->m_unk6 - a2, -2000.0f);
renderer->MatrixTranslate(this->m_originX - a1, this->m_originY - a2, -2000.0f);
renderer->MatrixScale(a5, a6, 1);

renderer->StateSetScissorRect(this->m_unk5, this->m_unk6, this->m_unk5 + a3, this->m_unk6 + a4);
renderer->StateSetScissorRect(this->m_originX, this->m_originY, this->m_originX + a3, this->m_originY + a4);

file->m_renderNodeStage->gather(this->m_boolIdk);

Expand Down Expand Up @@ -144,3 +144,8 @@ void fui::removeEventListenerForNode(FJ_FuiNode* node) {
void fui::removeManagedTexture(fuiFile* file, fuiBitmap* texture) {
this->m_textureManager->removeManagedTexture(file, texture);
}

void fui::setOrigin(float x, float y) {
this->m_originX = x;
this->m_originY = y;
}
6 changes: 4 additions & 2 deletions src/4JLibraries_Source/fui/fui.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ struct fui {
void removeManagedTexture(fuiFile*, fuiBitmap*);
void setFontIndirection(const char*, const char*);

void setOrigin(float x, float y);

mat4x4 m_atrix;
char m_fPad4[16];
char m_padding[568];
float m_unk5;
float m_unk6;
float m_originX;
float m_originY;
char m_padding3[0x4];
float m_screenWidth;
float m_screenHeight;
Expand Down
5 changes: 4 additions & 1 deletion src/4JLibraries_Source/fui/fuiFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,15 @@ struct fuiData {
};

struct fuiFile {
static constexpr int SKIN_TYPE_SD = 0;
static constexpr int SKIN_TYPE_HD = 1;

fuiFile();
~fuiFile();
// NOTE: HAD TO CHANGE THE SIGNATURE BECAUSE OF THE METHOD BEING DIFFERENT
// ORIG HAD A CALLBACK METHOD INSTEAD OF DATA
static uint64_t addDataRegion(uint a1, uint a2, uchar** ptr, uint64_t* callbackData);
void load(arrayWithLength<uchar>, int);
void load(arrayWithLength<uchar> data, int skinType);
bool resolveReferences(fuiFile*);
void dumpUnresolvedReferences();
void initialiseRenderTexture(fuiBitmap*, bool);
Expand Down
4 changes: 4 additions & 0 deletions src/4JLibraries_Source/fui/fuiRenderNodeTimeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ void fuiRenderNodeTimeline::progogateBoundsFromChild() {
cur = tl->asTimeline();
} while (cur);
}

int fuiRenderNodeTimeline::currentFrame() {
return this->m_currentFrame + 1;
}
5 changes: 5 additions & 0 deletions src/4JLibraries_Source/fui/fuiRenderNodeTimeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
struct fuiRenderNodeTimeline : public fuiRenderNode {
void progogateBoundsFromChild();
void updateBoundsLocal();

int currentFrame();

void *m_padding[7];
int m_currentFrame;
};
21 changes: 21 additions & 0 deletions src/4JLibraries_Source/fui/node/FJ_FuiNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "document/FJ_Document.h"
#include "fui/fui.h"
#include "fui/fuiRenderNode.h"
#include "fui/fuiRenderNodeTimeline.h"
#include "fui/node/FJ_Base.h"
#include "fui/node/FJ_FuiNodeStage.h"

Expand Down Expand Up @@ -63,6 +64,26 @@ float FJ_FuiNode::getHeight() {
return this->m_renderNode->getHeight();
}

fuiRenderNode* FJ_FuiNode::getChildByName(const std::string &name) {
if (m_renderNode->m_fuiObjectType != eFuiObjectType_Timeline) {
return nullptr;
}

fuiRenderNode *node = m_renderNode->findNode(name.c_str());
if (node) {
return reinterpret_cast<fuiRenderNode*>(node->m_fuiNodeStage);
}

return node;
}

int FJ_FuiNode::currentFrame() {
if (this->m_renderNode->m_fuiObjectType != eFuiObjectType_Timeline)
return 1;

return static_cast<fuiRenderNodeTimeline*>(this->m_renderNode)->currentFrame();
}

void FJ_FuiNode::setWidth(float width) {
this->m_renderNode->setWidth(width);
}
Expand Down
5 changes: 5 additions & 0 deletions src/4JLibraries_Source/fui/node/FJ_FuiNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class FJ_FuiNode {
float getWidth();
float getHeight();

fuiRenderNode *getChildByName(const std::string &name);
fuiRenderNode *getChildAt(int idx);

int currentFrame();

void setWidth(float width);

int getTabIndex();
Expand Down
14 changes: 14 additions & 0 deletions src/4JLibraries_Source/fui/node/document/menu/FJ_Panorama.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#include "fui/node/document/menu/FJ_Panorama.h"

std::string FJ_Panorama::sName = "Panorama";

int FJ_Panorama::GetCurrentFrame() {
FJ_FuiNode *dayPanorama = reinterpret_cast<FJ_FuiNode*>(this->getChildByName("Panorama_Day"));

if (dayPanorama) {
FJ_FuiNode *child = reinterpret_cast<FJ_FuiNode*>(dayPanorama->getChildAt(0));

if (child) {
return child->currentFrame();
}
}

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ class FJ_Panorama : public FJ_Document {
static std::string sName;

static FJ_FuiNode* Create(fuiRenderNode*);
int GetCurrentFrame();
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "net/minecraft/client/ui/ConsoleUIController.h"

ConsoleUIController gConsoleUIController = ConsoleUIController();
ConsoleUIController g_consoleUIController = ConsoleUIController();
Loading
Loading