From dd8f04ac992d4caf90cc816fdf0de9ac26d5d59a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 18 Feb 2026 03:50:47 -0800 Subject: [PATCH] Add weapon stats to inventory tooltips and fix login camera pitch - propagate item damage range and delay into ItemDef during inventory rebuild - show weapon damage, speed, and DPS in inventory/character slot tooltips - fix online spawn camera pitch sign so third-person camera starts above ground --- include/game/inventory.hpp | 3 +++ src/core/application.cpp | 2 +- src/game/game_handler.cpp | 15 +++++++++++++++ src/ui/inventory_screen.cpp | 10 ++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/include/game/inventory.hpp b/include/game/inventory.hpp index c4bc7334..8be8a2b3 100644 --- a/include/game/inventory.hpp +++ b/include/game/inventory.hpp @@ -34,6 +34,9 @@ struct ItemDef { uint32_t stackCount = 1; uint32_t maxStack = 1; uint32_t bagSlots = 0; + float damageMin = 0.0f; + float damageMax = 0.0f; + uint32_t delayMs = 0; // Stats int32_t armor = 0; int32_t stamina = 0; diff --git a/src/core/application.cpp b/src/core/application.cpp index d1eaeee2..67b373a9 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2537,7 +2537,7 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float // Set camera position if (renderer->getCameraController()) { renderer->getCameraController()->setOnlineMode(true); - renderer->getCameraController()->setDefaultSpawn(spawnRender, 0.0f, 15.0f); + renderer->getCameraController()->setDefaultSpawn(spawnRender, 0.0f, -15.0f); renderer->getCameraController()->reset(); renderer->getCameraController()->startIntroPan(2.8f, 140.0f); } diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 0709a63e..d3ea187a 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -6145,6 +6145,9 @@ void GameHandler::rebuildOnlineInventory() { def.maxStack = std::max(1, infoIt->second.maxStack); def.displayInfoId = infoIt->second.displayInfoId; def.subclassName = infoIt->second.subclassName; + def.damageMin = infoIt->second.damageMin; + def.damageMax = infoIt->second.damageMax; + def.delayMs = infoIt->second.delayMs; def.armor = infoIt->second.armor; def.stamina = infoIt->second.stamina; def.strength = infoIt->second.strength; @@ -6180,6 +6183,9 @@ void GameHandler::rebuildOnlineInventory() { def.maxStack = std::max(1, infoIt->second.maxStack); def.displayInfoId = infoIt->second.displayInfoId; def.subclassName = infoIt->second.subclassName; + def.damageMin = infoIt->second.damageMin; + def.damageMax = infoIt->second.damageMax; + def.delayMs = infoIt->second.delayMs; def.armor = infoIt->second.armor; def.stamina = infoIt->second.stamina; def.strength = infoIt->second.strength; @@ -6250,6 +6256,9 @@ void GameHandler::rebuildOnlineInventory() { def.maxStack = std::max(1, infoIt->second.maxStack); def.displayInfoId = infoIt->second.displayInfoId; def.subclassName = infoIt->second.subclassName; + def.damageMin = infoIt->second.damageMin; + def.damageMax = infoIt->second.damageMax; + def.delayMs = infoIt->second.delayMs; def.armor = infoIt->second.armor; def.stamina = infoIt->second.stamina; def.strength = infoIt->second.strength; @@ -6287,6 +6296,9 @@ void GameHandler::rebuildOnlineInventory() { def.maxStack = std::max(1, infoIt->second.maxStack); def.displayInfoId = infoIt->second.displayInfoId; def.subclassName = infoIt->second.subclassName; + def.damageMin = infoIt->second.damageMin; + def.damageMax = infoIt->second.damageMax; + def.delayMs = infoIt->second.delayMs; def.armor = infoIt->second.armor; def.stamina = infoIt->second.stamina; def.strength = infoIt->second.strength; @@ -6348,6 +6360,9 @@ void GameHandler::rebuildOnlineInventory() { def.maxStack = std::max(1, infoIt->second.maxStack); def.displayInfoId = infoIt->second.displayInfoId; def.subclassName = infoIt->second.subclassName; + def.damageMin = infoIt->second.damageMin; + def.damageMax = infoIt->second.damageMax; + def.delayMs = infoIt->second.delayMs; def.armor = infoIt->second.armor; def.stamina = infoIt->second.stamina; def.strength = infoIt->second.strength; diff --git a/src/ui/inventory_screen.cpp b/src/ui/inventory_screen.cpp index 21c6cf56..d9797437 100644 --- a/src/ui/inventory_screen.cpp +++ b/src/ui/inventory_screen.cpp @@ -1471,6 +1471,16 @@ void InventoryScreen::renderItemTooltip(const game::ItemDef& item) { } } + if (item.damageMax > 0.0f) { + ImGui::Text("%.0f - %.0f Damage", item.damageMin, item.damageMax); + if (item.delayMs > 0) { + float speed = static_cast(item.delayMs) / 1000.0f; + float dps = ((item.damageMin + item.damageMax) * 0.5f) / speed; + ImGui::Text("Speed %.2f", speed); + ImGui::Text("%.1f damage per second", dps); + } + } + // Armor if (item.armor > 0) { ImGui::Text("%d Armor", item.armor);