Skip to content

Commit

Permalink
Fix item name with hotbar on top setting
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmMoltony committed Dec 31, 2023
1 parent 82df1ec commit 5035e40
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The next update (*beta1.7*) is planned to release in **January 2024**.

## Q of L (quality of life) Features

- Allow for UI customization (even if its super basic) (planned for beta1.7)
*nothing here yet*

## Code Improvements

Expand Down
9 changes: 7 additions & 2 deletions source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,18 @@ void Player::drawHUD(const Camera &camera, Font &font, Font &fontRu)
// draw item name
if (inventory[hotbarSelect].id != InventoryItem::ID::None)
{
int itemNameY = hotbarY - 11;
if (SettingsManager::hotbarOnTop)
{
itemNameY = 18;
}
switch (Game::instance->lang)
{
case Language::English:
font.printShadowCentered(0, hotbarY - 11, getItemName(inventory[hotbarSelect].id));
font.printShadowCentered(0, itemNameY, getItemName(inventory[hotbarSelect].id));
break;
case Language::Russian:
fontRu.printShadowCentered(0, hotbarY - 11, getItemName(inventory[hotbarSelect].id));
fontRu.printShadowCentered(0, itemNameY, getItemName(inventory[hotbarSelect].id));
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/settingsmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void SettingsManager::loadSettings(void)
else if (split[0] == "hotbarontop")
{
// hotbar on top
hotbazrOnTop = std::stoi(split[1]);
hotbarOnTop = std::stoi(split[1]);
}
else
{
Expand Down

0 comments on commit 5035e40

Please sign in to comment.