Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
Added support for 7.02 ++ on userland toolbox side.
Browse files Browse the repository at this point in the history
  • Loading branch information
OSM-Made committed Jun 5, 2021
1 parent 60180c8 commit 72beb00
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 54 deletions.
2 changes: 0 additions & 2 deletions Loader/Kernel/source/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ bool Load_SPRX(proc* proc, const char* File)
{
klog("Load_SPRX(): \"%s\"", File);



size_t n;
int err = 0;
uint64_t thr_initial = 0;
Expand Down
8 changes: 4 additions & 4 deletions Orbis Toolbox/DebugTitleIdLabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void Debug_Feature::DebugTitleIdLabel::AddTitleId(MonoObject* m_contentsGridList

if (m_contentsGridList)
{
MonoObject* ActiveItems = Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "ListPanelBase", m_contentsGridList, "ActiveItems");
MonoObject* ActiveItems = Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI_UI2, "ListPanelBase", m_contentsGridList, "ActiveItems");

for (int i = 0; i < Mono::Get_Property<int>(ReadOnlyCollection, ActiveItems, "Count"); i++)
{
Expand All @@ -42,7 +42,7 @@ void Debug_Feature::DebugTitleIdLabel::RemoveTitleId(MonoObject* m_contentsGridL

if (m_contentsGridList)
{
MonoObject* ActiveItems = Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "ListPanelBase", m_contentsGridList, "ActiveItems");
MonoObject* ActiveItems = Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI_UI2, "ListPanelBase", m_contentsGridList, "ActiveItems");

for (int i = 0; i < Mono::Get_Property<int>(ReadOnlyCollection, ActiveItems, "Count"); i++)
{
Expand All @@ -53,7 +53,7 @@ void Debug_Feature::DebugTitleIdLabel::RemoveTitleId(MonoObject* m_contentsGridL

if (m_iconImageBox)
{
MonoArray* Children = Mono::Invoke<MonoArray*>(Mono::App_exe, Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Node`1"), m_iconImageBox, "GetChildrenArray");
MonoArray* Children = Mono::Invoke<MonoArray*>(Mono::App_exe, Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Node`1"), m_iconImageBox, "GetChildrenArray");

for (int i = 0; i < mono_array_length(Children); i++)
{
Expand All @@ -71,7 +71,7 @@ void Debug_Feature::DebugTitleIdLabel::RemoveTitleId(MonoObject* m_contentsGridL
if (strcmp(Instance->vtable->klass->name, "Label"))
continue;

Mono::Invoke<void>(Mono::App_exe, Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Widget"), Instance, "RemoveFromParent");
Mono::Invoke<void>(Mono::App_exe, Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Widget"), Instance, "RemoveFromParent");
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions Orbis Toolbox/DevkitPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void Debug_Feature::DevkitPanel::Show()
MonoClass* AreaManager = Mono::Get_Class(Mono::App_exe, "Sce.Vsh.ShellUI.TopMenu", "AreaManager");
MonoObject* AreaManager_Instance = Mono::Get_Instance(Mono::App_exe, "Sce.Vsh.ShellUI.TopMenu", "AreaManager", "Instance");
MonoObject* m_devKitPanel = Mono::Get_Field<MonoObject*>(AreaManager, AreaManager_Instance, "m_devKitPanel");
MonoClass* Widget = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Widget");
MonoClass* Widget = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Widget");

// AreaManager.Instance.m_devKitPanel
// If m_devKitPanel is null we must create the panel first.
Expand All @@ -36,7 +36,7 @@ void Debug_Feature::DevkitPanel::Show()
}
else
{
MonoClass* UITimer = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UITimer");
MonoClass* UITimer = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UITimer");
MonoObject* m_updatePanelTimer = Mono::Get_Field<MonoObject*>(AreaManager, AreaManager_Instance, "m_updatePanelTimer");

// AreaManager.Instance.m_updatePanelTimer.Start()
Expand All @@ -46,7 +46,7 @@ void Debug_Feature::DevkitPanel::Show()

// AreaManager.Instance.m_devKitPanel.Show()
// Show the panel.
MonoClass* UINode = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UINode");
MonoClass* UINode = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UINode");
Mono::Invoke<void>(Mono::UI_dll, UINode, m_devKitPanel, "Show");
}

Expand All @@ -58,7 +58,7 @@ void Debug_Feature::DevkitPanel::Hide()
MonoClass* AreaManager = Mono::Get_Class(Mono::App_exe, "Sce.Vsh.ShellUI.TopMenu", "AreaManager");
MonoObject* AreaManager_Instance = Mono::Get_Instance(Mono::App_exe, "Sce.Vsh.ShellUI.TopMenu", "AreaManager", "Instance");

MonoClass* UITimer = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UITimer");
MonoClass* UITimer = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UITimer");
MonoObject* m_updatePanelTimer = Mono::Get_Field<MonoObject*>(AreaManager, AreaManager_Instance, "m_updatePanelTimer");

// AreaManager.Instance.m_updatePanelTimer.Stop()
Expand All @@ -71,7 +71,7 @@ void Debug_Feature::DevkitPanel::Hide()
MonoObject* m_devKitPanel = Mono::Get_Field<MonoObject*>(AreaManager, AreaManager_Instance, "m_devKitPanel");
if (m_devKitPanel)
{
MonoClass* UINode = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UINode");
MonoClass* UINode = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UINode");
Mono::Invoke<void>(Mono::UI_dll, UINode, m_devKitPanel, "Hide");
}

Expand All @@ -80,7 +80,7 @@ void Debug_Feature::DevkitPanel::Hide()

bool Debug_Feature::DevkitPanel::GetState()
{
MonoClass* FrameTask = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "FrameTask");
MonoClass* FrameTask = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "FrameTask");
MonoClass* AreaManager = Mono::Get_Class(Mono::App_exe, "Sce.Vsh.ShellUI.TopMenu", "AreaManager");
MonoObject* AreaManager_Instance = Mono::Get_Instance(Mono::App_exe, "Sce.Vsh.ShellUI.TopMenu", "AreaManager", "Instance");
MonoObject* m_devKitPanel = Mono::Get_Field<MonoObject*>(AreaManager, AreaManager_Instance, "m_devKitPanel");
Expand Down
4 changes: 2 additions & 2 deletions Orbis Toolbox/Game_Overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ void Game_Overlay::Init()
{
//Get Relevent Classes.
MonoClass* LayerManager = Mono::Get_Class(Mono::App_exe, "Sce.Vsh.ShellUI.AppSystem", "LayerManager");
MonoClass* ContainerScene = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "ContainerScene");
MonoClass* ContainerScene = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "ContainerScene");

//Initialize Game Scene widget
Game_Widget = new Widget();
MonoObject* Game = Mono::Invoke<MonoObject*>(Mono::App_exe, LayerManager, nullptr, "FindContainerSceneByPath", Mono::New_String("Game"));
Game_Widget->Instance = Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Scene", Game, "RootWidget");
Game_Widget->Instance = Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI_UI2, "Scene", Game, "RootWidget");

//Set location to left.
strcpy(Location, "Left");
Expand Down
6 changes: 3 additions & 3 deletions Orbis Toolbox/Label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ float Label::Get_Text_Height()

Label::Label(const char* Name)
{
Label_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Label");
Label_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Label");

//Allocates memory for our new instance of a class.
Instance = Mono::New_Object(Label_Class);
Expand All @@ -66,7 +66,7 @@ Label::Label(const char* Name)

MonoObject* NewTextShadowSettings(float R, float G, float B)
{
MonoClass* TextShadowSettings = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "TextShadowSettings");
MonoClass* TextShadowSettings = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "TextShadowSettings");

MonoObject* TextShadow_Instance = Mono::New_Object(TextShadowSettings);
mono_runtime_object_init(TextShadow_Instance);
Expand All @@ -77,7 +77,7 @@ MonoObject* NewTextShadowSettings(float R, float G, float B)

Label::Label(const char* Name, float X, float Y, const char* Text, int Size, FontStyle Style, FontWeight Weight, VerticalAlignment Vertical_Align, HorizontalAlignment Horizontal_Align, float R, float G, float B, float A)
{
Label_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Label");
Label_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Label");
//TODO: Add checks to see if it got the class.

//Allocates memory for our new instance of a class.
Expand Down
6 changes: 3 additions & 3 deletions Orbis Toolbox/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void Menu::Init()
*/

// Power Options
Add_Option("id_reload_shellui", []() -> void { Notify("%s", __FUNCTION__); });
Add_Option("id_reload_shellui", []() -> void { Notify("%s", __FUNCTION__); })->Visible = false;
Add_Option("id_reboot", []() -> void { LncUtil::SystemReboot(); });
Add_Option("id_shutdown", []() -> void { LncUtil::SystemShutdown(LncUtil::None); });
Add_Option("id_suspend", []() -> void { LncUtil::SystemShutdown(LncUtil::Eap); });
Expand Down Expand Up @@ -72,7 +72,7 @@ void Menu::Init()

End:
free(Dent_Buffer);
});
})->Visible = false;

// ShellUI Plugin Manager
Add_Option("id_plugins")->Visible = false;
Expand Down Expand Up @@ -101,7 +101,7 @@ void Menu::Init()



});
})->Visible = false;

// Note: System settings does not need to be done here
// because of the fact its managed by the system.
Expand Down
39 changes: 35 additions & 4 deletions Orbis Toolbox/Mono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ MonoImage* Mono::Accessor_Db;
MonoImage* Mono::Vsh_Lx;
MonoImage* Mono::SysfileUtilWrapper;

bool Mono::PUI2 = true;
int Mono::Software_Version;
const char* Mono::PUI;
const char* Mono::PUI_UI2;
const char* Mono::PUI_UI3;

bool Mono::Init()
{
Expand All @@ -29,13 +32,11 @@ bool Mono::Init()

MonoLog("Get Images");

PUI2 = true;
UI_dll = Get_Image("/%s/common/lib/Sce.PlayStation.PUI.dll", sceKernelGetFsSandboxRandomWord());
if (!UI_dll)
{
klog("Using Highlevel.UI2...\n");
UI_dll = Get_Image("/%s/common/lib/Sce.PlayStation.HighLevel.UI2.dll", sceKernelGetFsSandboxRandomWord());
PUI2 = false;
}
else
klog("Using PUI...\n");
Expand All @@ -47,7 +48,37 @@ bool Mono::Init()
mscorlib = Get_Image("/%s/common/lib/mscorlib.dll", sceKernelGetFsSandboxRandomWord());
Accessor_Db = Get_Image("/%s/common/lib/Sce.Vsh.Accessor.Db.dll", sceKernelGetFsSandboxRandomWord());
Vsh_Lx = Get_Image("/%s/common/lib/Sce.Vsh.Lx.dll", sceKernelGetFsSandboxRandomWord());
SysfileUtilWrapper = Get_Image("/%s/common/lib/Sce.Vsh.SysfileUtilWrapper.dll", sceKernelGetFsSandboxRandomWord());
SysfileUtilWrapper = Get_Image("/%s/common/lib/Sce.Vsh.SysfileUtilWrapper.dll", sceKernelGetFsSandboxRandomWord());

char* Version = UI::Utilities::Get_Version_String();
if (Version)
{
char Version_Short[] = { Version[0], Version[2], Version[3] };
int Software_Version = atoi(Version_Short);
klog("Software Version: %s %i\n", Version, Software_Version);

switch (Software_Version)
{
default:
Notify("Unsuported Software Version!! \"%s\"(%i)", Version, Software_Version);
break;

case 505:
PUI = "Sce.PlayStation.HighLevel.UI2";
PUI_UI2 = "Sce.PlayStation.HighLevel.UI2";
PUI_UI3 = "Sce.PlayStation.HighLevel.UI2";
break;

case 672:
case 702:
case 755:
PUI = "Sce.PlayStation.PUI";
PUI_UI2 = "Sce.PlayStation.PUI.UI2";
PUI_UI3 = "Sce.PlayStation.PUI.UI3";
break;
}
}

MonoLog("Init Complete");

return true;
Expand Down
5 changes: 4 additions & 1 deletion Orbis Toolbox/Mono.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class Mono
static MonoImage* Vsh_Lx;
static MonoImage* SysfileUtilWrapper;

static bool PUI2;
static int Software_Version;
static const char* PUI;
static const char* PUI_UI2;
static const char* PUI_UI3;

static bool Init();
static void MonoLog(const char* fmt, ...);
Expand Down
4 changes: 2 additions & 2 deletions Orbis Toolbox/Panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void Panel::Set_Layout_Rule(MonoObject* Rule)

Panel::Panel(const char* Name)
{
Panel_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Panel");
Panel_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Panel");

//Allocates memory for our new instance of a class.
Instance = Mono::New_Object(Panel_Class);
Expand All @@ -46,7 +46,7 @@ Panel::Panel(const char* Name)

Panel::Panel(const char* Name, float X, float Y, float Width, float Height, float R, float G, float B, float A, RenderingOrder Order, MonoObject* Rule)
{
Panel_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Panel");
Panel_Class = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "Panel");

//Allocates memory for our new instance of a class.
Instance = Mono::New_Object(Panel_Class);
Expand Down
10 changes: 5 additions & 5 deletions Orbis Toolbox/Settings_Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ void Settings_Menu::OnPreCreate_Hook(MonoObject* Instance, MonoObject* element,
//Update the shown value of the option.
if (Cur->Type == Type_Boolean)
Mono::Set_Property(SettingElement, element, "Value", (*(bool*)Cur->Data) ? Mono::New_String("1") : Mono::New_String("0"));
/*else if (Cur.Type == Type_Integer)
Mono::Set_Property(SettingElement, element, "Value", Mono::New_String(std::to_string(*Cur->Data.Integer).c_str()));
else if (Cur.Type == Type_Float)
Mono::Set_Property(SettingElement, element, "Value", Mono::New_String(std::to_string(*Cur->Data.Float).c_str()));*/
/*else if (Cur->Type == Type_Integer)
Mono::Set_Property(SettingElement, element, "Value", Mono::New_String(std::to_string(*(int*)Cur->Data).c_str()));
else if (Cur->Type == Type_Float)
Mono::Set_Property(SettingElement, element, "Value", Mono::New_String(std::to_string(*(float*)Cur->Data).c_str()));*/
else if (Cur->Type == Type_String)
Mono::Set_Property(SettingElement, element, "Value", Mono::New_String((const char*)Cur->Data));

Expand Down Expand Up @@ -270,7 +270,7 @@ void Settings_Menu::Init()
Detour_OnPreCreate->DetourMethod(Mono::App_exe, "Sce.Vsh.ShellUI.Settings.SettingsRoot", "SettingsRootHandler", "OnPreCreate", 2, (void*)OnPreCreate_Hook);
Detour_OnPageActivating->DetourMethod(Mono::App_exe, "Sce.Vsh.ShellUI.Settings.SettingsRoot", "SettingsRootHandler", "OnPageActivating", 2, (void*)OnPageActivating_Hook);
Detour_OnPress->DetourMethod(Mono::App_exe, "Sce.Vsh.ShellUI.Settings.SettingsRoot", "SettingsRootHandler", "OnPress", 2, (void*)OnPress_Hook);
Detour_OnRender->DetourMethod(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "Application", "Update", 0, (void*)OnRender_Hook);
Detour_OnRender->DetourMethod(Mono::UI_dll, Mono::PUI, "Application", "Update", 0, (void*)OnRender_Hook);

Log("Init Complete");
}
Expand Down
23 changes: 15 additions & 8 deletions Orbis Toolbox/UI_Utilities.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include "Common.h"
#include "UI_Utilities.h"

char* UI::Utilities::Get_Version_String()
{
MonoClass* SystemSoftwareVersionInfo = Mono::Get_Class(Mono::App_exe, "Sce.Vsh.ShellUI.AppSystem", "SystemSoftwareVersionInfo");
return mono_string_to_utf8(Mono::Get_Property<MonoString*>(SystemSoftwareVersionInfo, Mono::Get_Instance(SystemSoftwareVersionInfo, "Instance"), "DisplayVersion"));
}

void UI::Utilities::SetVersionString(const char* str)
{
MonoClass* SystemSoftwareVersionInfo = Mono::Get_Class(Mono::App_exe, "Sce.Vsh.ShellUI.AppSystem", "SystemSoftwareVersionInfo");
Expand Down Expand Up @@ -40,12 +46,12 @@ MonoObject* UI::Utilities::Get_Top_Scene()

MonoObject* UI::Utilities::Get_root_Widget()
{
return Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "Scene", Get_Top_Scene(), "RootWidget");
return Mono::Get_Property<MonoObject*>(Mono::UI_dll, Mono::PUI_UI2, "Scene", Get_Top_Scene(), "RootWidget");
}

MonoObject* UI::Utilities::Adjust_Content(int AlignOrientation, float PaddingLeft, float PaddingRight, float PaddingTop, float PaddingBottom)
{
MonoClass* AdjustContent = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "AdjustContent");
MonoClass* AdjustContent = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "AdjustContent");

//Allocates memory for our new instance of a class.
MonoObject* AdjustContent_Instance = Mono::New_Object(AdjustContent);
Expand All @@ -65,7 +71,7 @@ MonoObject* UI::Utilities::Adjust_Content(int AlignOrientation, float PaddingLef

MonoObject* UI::Utilities::Fit_To_Children()
{
MonoClass* FitToChildren = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI.UI2" : "Sce.PlayStation.HighLevel.UI2", "FitToChildren");
MonoClass* FitToChildren = Mono::Get_Class(Mono::UI_dll, Mono::PUI_UI2, "FitToChildren");

MonoObject* FitToChildren_Instance = Mono::New_Object(FitToChildren);
mono_runtime_object_init(FitToChildren_Instance);
Expand All @@ -75,7 +81,8 @@ MonoObject* UI::Utilities::Fit_To_Children()

MonoObject* UI::Utilities::IUFont(int size, int style, int weight)
{
MonoClass* UIFont = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UIFont");
//Somewhere between 6.72 and 7.02 UIFont was moved to UI2.
MonoClass* UIFont = Mono::Get_Class(Mono::UI_dll, (Mono::Software_Version <= 672) ? Mono::PUI : Mono::PUI_UI2, "UIFont");

//Allocates memory for our new instance of a class.
MonoObject* UIFont_Instance = Mono::New_Object(UIFont);
Expand Down Expand Up @@ -141,7 +148,7 @@ MonoObject* UI::Utilities::ElementData(const char* Id, const char* Title, const

MonoObject* UI::Utilities::UIColor(float R, float G, float B, float A)
{
MonoClass* UIColor = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UIColor");
MonoClass* UIColor = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UIColor");

//Allocates memory for our new instance of a class.
MonoObject* UIColor_Instance = Mono::New_Object(UIColor);
Expand All @@ -156,7 +163,7 @@ MonoObject* UI::Utilities::UIColor(float R, float G, float B, float A)

MonoObject* UI::Utilities::UIColor(float R, float G, float B)
{
MonoClass* UIColor = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UIColor");
MonoClass* UIColor = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UIColor");

//Allocates memory for our new instance of a class.
MonoObject* UIColor_Instance = Mono::New_Object(UIColor);
Expand All @@ -171,13 +178,13 @@ MonoObject* UI::Utilities::UIColor(float R, float G, float B)

float UI::Utilities::ScreenHeight()
{
MonoClass* UISystem = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UISystem");
MonoClass* UISystem = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UISystem");
return Mono::Get_Property<int>(UISystem, nullptr, "ScreenHeight");
}

float UI::Utilities::ScreenWidth()
{
MonoClass* UISystem = Mono::Get_Class(Mono::UI_dll, Mono::PUI2 ? "Sce.PlayStation.PUI" : "Sce.PlayStation.HighLevel.UI2", "UISystem");
MonoClass* UISystem = Mono::Get_Class(Mono::UI_dll, Mono::PUI, "UISystem");
return Mono::Get_Property<int>(UISystem, nullptr, "ScreenWidth");
}

Expand Down
1 change: 1 addition & 0 deletions Orbis Toolbox/UI_Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace UI
class Utilities
{
public:
static char* Get_Version_String();
static void SetVersionString(const char* str);
static void ReloadItemList();
static MonoObject* AppBrowseItem(const char* TitleId, const char* TitleName);
Expand Down
Loading

0 comments on commit 72beb00

Please sign in to comment.