mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
achievement_menu: added minimum header size, improved separators
(and some extra junk I was researching)
This commit is contained in:
parent
d2a3818700
commit
e76cbff3ea
4 changed files with 47 additions and 13 deletions
|
|
@ -85,6 +85,7 @@
|
||||||
#include "SWA/Movie/MovieDisplayer.h"
|
#include "SWA/Movie/MovieDisplayer.h"
|
||||||
#include "SWA/Movie/MovieManager.h"
|
#include "SWA/Movie/MovieManager.h"
|
||||||
#include "SWA/Object/Common/DashPanel/ObjDashPanel.h"
|
#include "SWA/Object/Common/DashPanel/ObjDashPanel.h"
|
||||||
|
#include "SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
|
||||||
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SWA.inl>
|
||||||
|
|
||||||
|
namespace SWA
|
||||||
|
{
|
||||||
|
class CObjRollingBarrel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
class CElement
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SWA_INSERT_PADDING(0xEC);
|
||||||
|
xpointer<void> m_FieldEC;
|
||||||
|
SWA_INSERT_PADDING(0x20);
|
||||||
|
be<float> m_Roll;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_INSERT_PADDING(0xE8);
|
||||||
|
be<float> m_GenerationTime;
|
||||||
|
SWA_INSERT_PADDING(0x09);
|
||||||
|
bool m_FieldF5;
|
||||||
|
SWA_INSERT_PADDING(0x0A);
|
||||||
|
be<float> m_RandomRange;
|
||||||
|
be<float> m_Field104;
|
||||||
|
};
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CObjRollingBarrel::CElement, m_FieldEC, 0xEC);
|
||||||
|
SWA_ASSERT_OFFSETOF(CObjRollingBarrel::CElement, m_Roll, 0x110);
|
||||||
|
|
||||||
|
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_GenerationTime, 0xE8);
|
||||||
|
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_FieldF5, 0xF5);
|
||||||
|
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_RandomRange, 0x100);
|
||||||
|
SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_Field104, 0x104);
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
|
#include <api/SWA.h>
|
||||||
#include <user/config.h>
|
#include <user/config.h>
|
||||||
#include <SWA/CharacterUtility/CharacterProxy.h>
|
|
||||||
#include <hid/hid.h>
|
#include <hid/hid.h>
|
||||||
|
#include <app.h>
|
||||||
|
|
||||||
// CObjFlame::CObjFlame
|
// SWA::CObjFlame::CObjFlame
|
||||||
// A field is not zero initialized,
|
// A field is not zero initialized,
|
||||||
// causing collisions to constantly get created
|
// causing collisions to constantly get created
|
||||||
// and slow down the game.
|
// and slow down the game.
|
||||||
|
|
@ -28,7 +29,7 @@ void ObjBigBarrelAllocMidAsmHook(PPCRegister& r3)
|
||||||
r3.u32 += sizeof(ObjBigBarrelEx);
|
r3.u32 += sizeof(ObjBigBarrelEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CObjBigBarrel::CObjBigBarrel
|
// SWA::CObjBigBarrel::CObjBigBarrel
|
||||||
PPC_FUNC_IMPL(__imp__sub_8271AC08);
|
PPC_FUNC_IMPL(__imp__sub_8271AC08);
|
||||||
PPC_FUNC(sub_8271AC08)
|
PPC_FUNC(sub_8271AC08)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ static void DrawHeaderContainer(const char* text)
|
||||||
{
|
{
|
||||||
auto drawList = ImGui::GetBackgroundDrawList();
|
auto drawList = ImGui::GetBackgroundDrawList();
|
||||||
auto fontSize = Scale(24);
|
auto fontSize = Scale(24);
|
||||||
|
auto minTextSize = Scale(294.575989);
|
||||||
auto textSize = g_fntNewRodinUB->CalcTextSizeA(fontSize, FLT_MAX, 0, text);
|
auto textSize = g_fntNewRodinUB->CalcTextSizeA(fontSize, FLT_MAX, 0, text);
|
||||||
auto cornerRadius = 23;
|
auto cornerRadius = 23;
|
||||||
auto textMarginX = Scale(16) + (Scale(cornerRadius) / 2);
|
auto textMarginX = Scale(16) + (Scale(cornerRadius) / 2);
|
||||||
|
|
@ -99,13 +100,12 @@ static void DrawHeaderContainer(const char* text)
|
||||||
: Lerp(0, 1, colourMotion);
|
: Lerp(0, 1, colourMotion);
|
||||||
|
|
||||||
ImVec2 min = { g_aspectRatioOffsetX + Scale(containerMarginX), g_aspectRatioOffsetY + Scale(136) };
|
ImVec2 min = { g_aspectRatioOffsetX + Scale(containerMarginX), g_aspectRatioOffsetY + Scale(136) };
|
||||||
ImVec2 max = { min.x + textMarginX * 2 + textSize.x + Scale(5), g_aspectRatioOffsetY + Scale(196) };
|
ImVec2 max = { std::max(min.x + minTextSize, min.x + textMarginX * 2 + textSize.x + Scale(5)), g_aspectRatioOffsetY + Scale(196) };
|
||||||
|
|
||||||
DrawPauseHeaderContainer(min, max, alpha);
|
DrawPauseHeaderContainer(min, max, alpha);
|
||||||
|
|
||||||
SetTextSkew((min.y + max.y) / 2.0f, Scale(3.0f));
|
SetTextSkew((min.y + max.y) / 2.0f, Scale(3.0f));
|
||||||
|
|
||||||
// TODO: Apply bevel.
|
|
||||||
DrawTextWithOutline
|
DrawTextWithOutline
|
||||||
(
|
(
|
||||||
g_fntNewRodinUB,
|
g_fntNewRodinUB,
|
||||||
|
|
@ -564,15 +564,12 @@ static void DrawContentContainer()
|
||||||
// Draw separators.
|
// Draw separators.
|
||||||
for (int i = 1; i <= 3; i++)
|
for (int i = 1; i <= 3; i++)
|
||||||
{
|
{
|
||||||
auto lineMarginLeft = Scale(35);
|
ImVec2 lineMin = { clipRectMin.x + Scale(35), clipRectMin.y + itemHeight * i + Scale(2) };
|
||||||
auto lineMarginRight = Scale(55);
|
ImVec2 lineMax = { clipRectMax.x - Scale(55), lineMin.y + Scale(1.3f) };
|
||||||
auto lineMarginY = Scale(2);
|
|
||||||
|
|
||||||
ImVec2 lineMin = { clipRectMin.x + lineMarginLeft, clipRectMin.y + itemHeight * i + lineMarginY };
|
SetAdditive(true);
|
||||||
ImVec2 lineMax = { clipRectMax.x - lineMarginRight, clipRectMin.y + itemHeight * i + lineMarginY };
|
drawList->AddRectFilled(lineMin, lineMax, IM_COL32(160, 160, 160, 60));
|
||||||
|
SetAdditive(false);
|
||||||
drawList->AddLine(lineMin, lineMax, IM_COL32(163, 163, 163, 255));
|
|
||||||
drawList->AddLine({ lineMin.x, lineMin.y + Scale(1) }, { lineMax.x, lineMax.y + Scale(1) }, IM_COL32(143, 148, 143, 255));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& tpl : g_achievements)
|
for (auto& tpl : g_achievements)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue