| 236 | } |
| 237 | |
| 238 | void PlayerController::onDebugDraw() |
| 239 | { |
| 240 | if (isPlayerControlled()) |
| 241 | { |
| 242 | VobTypes::NpcVobInformation npc = VobTypes::asNpcVob(m_World, m_Entity); |
| 243 | Daedalus::GEngineClasses::C_Npc& scriptnpc = VobTypes::getScriptObject(npc); |
| 244 | |
| 245 | if (!getInventory().getItems().empty()) |
| 246 | { |
| 247 | // Print inventory |
| 248 | const std::list<Daedalus::GameState::ItemHandle>& items = m_Inventory.getItems(); |
| 249 | Daedalus::DATFile& datFile = m_World.getScriptEngine().getVM().getDATFile(); |
| 250 | |
| 251 | uint16_t idx = 27; |
| 252 | bgfx::dbgTextPrintf(0, idx++, 0x0f, "Inventory:"); |
| 253 | for (Daedalus::GameState::ItemHandle i : items) |
| 254 | { |
| 255 | Daedalus::GEngineClasses::C_Item idata = m_World.getScriptEngine().getGameState().getItem(i); |
| 256 | |
| 257 | std::string displayName; |
| 258 | { |
| 259 | if (!idata.description.empty()) |
| 260 | { |
| 261 | displayName = idata.description; |
| 262 | } |
| 263 | else if (!idata.name.empty()) |
| 264 | { |
| 265 | displayName = idata.name; |
| 266 | } |
| 267 | else |
| 268 | { |
| 269 | displayName = datFile.getSymbolByIndex(idata.instanceSymbol).name; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | if (idata.amount > 1) |
| 274 | bgfx::dbgTextPrintf(0, idx++, 0x0f, " %s [%d]", displayName.c_str(), idata.amount); |
| 275 | else |
| 276 | bgfx::dbgTextPrintf(0, idx++, 0x0f, " %s", displayName.c_str()); |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | void PlayerController::unequipItem(Daedalus::GameState::ItemHandle item) |
| 283 | { |