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
This commit is contained in:
Kelsi 2026-02-18 03:50:47 -08:00
parent 1de2f4c8a0
commit dd8f04ac99
4 changed files with 29 additions and 1 deletions

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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<float>(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);