MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / onDebugDraw

Method onDebugDraw

src/logic/PlayerController.cpp:238–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238void 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
282void PlayerController::unequipItem(Daedalus::GameState::ItemHandle item)
283{

Callers 1

drawWorldFunction · 0.45

Calls 2

getItemMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected