Skip to content
Open
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
10 changes: 6 additions & 4 deletions soh/soh/Enhancements/Graphics/VisualAgony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ void DrawVisualAgony(Player* player, double temp) {

int rectLeft = PosX_VSOA; // Left X Pos
int rectTop = PosY_VSOA; // Top Y Pos
int rectWidth = 24; // Texture Width
int rectHeight = 24; // Texture Heigh
int DefaultIconA = 50; // Default icon alpha (55 on 255)
f32 visualSoAScale = MAX(CVarGetFloat(CVAR_COSMETIC("HUD.VisualSoA.Scale"), 1.0f), 0.25f);
int rectWidth = 24 * visualSoAScale; // Texture Width
int rectHeight = 24 * visualSoAScale; // Texture Height
int texStep = (1 << 10) / visualSoAScale;
int DefaultIconA = 50; // Default icon alpha (55 on 255)

OPEN_DISPS(gPlayState->state.gfxCtx);
gDPPipeSync(OVERLAY_DISP++);
Expand Down Expand Up @@ -117,7 +119,7 @@ void DrawVisualAgony(Player* player, double temp) {
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2,
(rectTop + rectHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
(rectTop + rectHeight) << 2, G_TX_RENDERTILE, 0, 0, texStep, texStep);
CLOSE_DISPS(gPlayState->state.gfxCtx);
}

Expand Down
32 changes: 25 additions & 7 deletions soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1588,16 +1588,32 @@ void DrawPositionSlider(const std::string CvarName, int MinY, int MaxY, int MinX
}

void DrawScaleSlider(const std::string CvarName, float DefaultValue) {
std::string InvisibleLabel = "##" + CvarName;
std::string CvarLabel = CvarName + ".Scale";
// Disabled for now. feature not done and several fixes needed to be merged.
// UIWidgets::EnhancementSliderFloat("Scale : %dx", InvisibleLabel.c_str(), CvarLabel.c_str(),
// 0.1f, 3.0f,"",DefaultValue,true);
float scale = CVarGetFloat(CvarLabel.c_str(), DefaultValue);

ImGui::PushID(CvarLabel.c_str());
ImGui::Text("Scale: %.2fx", scale);
UIWidgets::CVarSliderFloat("", CvarLabel.c_str(),
UIWidgets::FloatSliderOptions()
.Min(0.25f)
.Max(4.0f)
.DefaultValue(DefaultValue)
.Format("%.2fx")
.LabelPosition(UIWidgets::LabelPositions::Near)
.Size(ImVec2(250.0f, 0.0f))
.Color(THEME_COLOR));
ImGui::SameLine();
if (UIWidgets::Button("Reset", UIWidgets::ButtonOptions().Size(ImVec2(60.0f, 0.0f)).Color(THEME_COLOR))) {
CVarClear(CvarLabel.c_str());
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
ShipInit::Init(CvarLabel.c_str());
}
ImGui::PopID();
}

void Draw_Table_Dropdown(const char* Header_Title, const char* Table_ID, const char* Column_Title,
const char* Slider_Title, const char* Slider_ID, int MinY, int MaxY, int MinX, int MaxX,
float Default_Value) {
float Default_Value, bool DrawScale = true) {
UIWidgets::PushStyleHeader(THEME_COLOR);
if (ImGui::CollapsingHeader(Header_Title)) {
if (ImGui::BeginTable(Table_ID, 1, FlagsTable)) {
Expand All @@ -1606,7 +1622,9 @@ void Draw_Table_Dropdown(const char* Header_Title, const char* Table_ID, const c
DrawUseMarginsSlider(Slider_Title, Slider_ID);
DrawPositionsRadioBoxes(Slider_ID);
DrawPositionSlider(Slider_ID, MinY, MaxY, MinX, MaxX);
DrawScaleSlider(Slider_ID, Default_Value);
if (DrawScale) {
DrawScaleSlider(Slider_ID, Default_Value);
}
ImGui::EndTable();
}
}
Expand Down Expand Up @@ -1794,7 +1812,7 @@ void Draw_Placements() {
CVAR_COSMETIC("HUD.Minimap"), static_cast<int>(ImGui::GetWindowViewport()->Size.y / 3) * -1,
static_cast<int>(ImGui::GetWindowViewport()->Size.y / 3),
static_cast<int>(ImGui::GetWindowViewport()->Size.x) * -1,
static_cast<int>(ImGui::GetWindowViewport()->Size.x / 2), 1.0f);
static_cast<int>(ImGui::GetWindowViewport()->Size.x / 2), 1.0f, false);
Draw_Table_Dropdown("Small Keys counter position", "tablesmolekeys", "Small Keys counter settings",
"Small Keys counter", CVAR_COSMETIC("HUD.SmallKey"), 0,
static_cast<int>(ImGui::GetWindowViewport()->Size.y / 3), -1,
Expand Down
16 changes: 11 additions & 5 deletions soh/src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,11 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) {
if (titleCtx->alpha != 0) {
width = titleCtx->width;
height = titleCtx->height;
f32 titleScale = MAX(CVarGetFloat(titleCtx->isBossCard ? CVAR_COSMETIC("HUD.TitleCard.Boss.Scale")
: CVAR_COSMETIC("HUD.TitleCard.Map.Scale"),
1.0f),
0.25f);
s32 titleTexStep = (1 << 10) / titleScale;
s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVarGetInteger(CVAR_COSMETIC("TitleCard.Boss.PosX"), 0)
: CVarGetInteger(CVAR_COSMETIC("TitleCard.Map.PosX"), 0));
s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVarGetInteger(CVAR_COSMETIC("TitleCard.Boss.PosY"), 0)
Expand Down Expand Up @@ -1165,9 +1170,9 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) {
}
}

titleX = (TitleCard_PosX * 4) - (width * 2);
titleY = (TitleCard_PosY * 4) - (height * 2);
doubleWidth = width * 2;
titleX = (TitleCard_PosX * 4) - (s32)(width * 2 * titleScale);
titleY = (TitleCard_PosY * 4) - (s32)(height * 2 * titleScale);
doubleWidth = width * 2 * titleScale;

OPEN_DISPS(play->state.gfxCtx);

Expand All @@ -1179,8 +1184,9 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) {
gDPLoadTextureBlock(OVERLAY_DISP++, (uintptr_t)titleCtx->texture, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD);
gSPWideTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4),
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
gSPWideTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4,
titleY + (s32)(height * 4 * titleScale), G_TX_RENDERTILE, 0, 0, titleTexStep,
titleTexStep);

height = titleCtx->height - height;

Expand Down
10 changes: 4 additions & 6 deletions soh/src/code/z_lifemeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,8 @@ void HealthMeter_Draw(PlayState* play) {
s32 curCombineModeSet = 0;
u8* curBgImgLoaded = NULL;
s32 ddHeartCountMinusOne = gSaveContext.isDoubleDefenseAcquired ? totalHeartCount - 1 : -1;
f32 HeartsScale = 0.7f;
if (CVarGetInteger(CVAR_COSMETIC("HUD.HeartsCount.PosType"), 0) != ORIGINAL_LOCATION) {
HeartsScale = CVarGetFloat(CVAR_COSMETIC("HUD.HeartsCount.Scale"), 0.7f);
}
f32 HeartsScale = MAX(CVarGetFloat(CVAR_COSMETIC("HUD.HeartsCount.Scale"), 0.7f), 0.25f);
f32 heartsScaleRatio = HeartsScale / 0.7f;
static u32 epoch = 0;
epoch++;

Expand Down Expand Up @@ -630,11 +628,11 @@ void HealthMeter_Draw(PlayState* play) {
}
}

offsetX += 10.0f;
offsetX += 10.0f * heartsScaleRatio;
s32 lineLength = CVarGetInteger(CVAR_COSMETIC("HUD.Hearts.LineLength"), 10);
if (lineLength != 0 && (i + 1) % lineLength == 0) {
offsetX = PosX_anchor;
offsetY += 10.0f;
offsetY += 10.0f * heartsScaleRatio;
}

FrameInterpolation_RecordCloseChild();
Expand Down
Loading
Loading