MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / DoInventory

Method DoInventory

TombEngine/Game/gui.cpp:2262–2579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2260 }
2261
2262 void GuiController::DoInventory(ItemInfo* item)
2263 {
2264 auto& player = GetLaraInfo(*item);
2265 auto& invRing = Rings[(int)RingTypes::Inventory];
2266 auto& ammoRing = Rings[(int)RingTypes::Ammo];
2267 auto plainColor = g_GameFlow->GetSettings()->UI.PlainTextColor;
2268
2269 if (ammoRing.RingActive)
2270 {
2271 auto optionString = g_GameFlow->GetString(OptionStrings[5].c_str());
2272 g_Renderer.AddString(PHD_CENTER_X, PHD_CENTER_Y, optionString, plainColor, (int)PrintStringFlags::Blink | (int)PrintStringFlags::Center | (int)PrintStringFlags::Outline);
2273
2274 if (invRing.ObjectListMovement)
2275 return;
2276
2277 if (ammoRing.ObjectListMovement)
2278 return;
2279
2280 if (GuiIsSelected(false))
2281 {
2282 short invItem = invRing.CurrentObjectList[invRing.CurrentObjectInList].InventoryItem;
2283 short ammoItem = ammoRing.CurrentObjectList[ammoRing.CurrentObjectInList].InventoryItem;
2284
2285 if (DoObjectsCombine(invItem, ammoItem))
2286 {
2287 CombineRingFadeDir = 2;
2288 CombineTypeFlag = 1;
2289 CombineObject1 = invItem;
2290 CombineObject2 = ammoItem;
2291 SoundEffect(SFX_TR4_MENU_COMBINE, nullptr, SoundEnvironment::Always);
2292 }
2293 else if (ammoItem >= INV_OBJECT_SMALL_WATERSKIN_EMPTY &&
2294 ammoItem <= INV_OBJECT_SMALL_WATERSKIN_3L &&
2295 invItem >= INV_OBJECT_BIG_WATERSKIN_EMPTY &&
2296 invItem <= INV_OBJECT_BIG_WATERSKIN_5L)
2297 {
2298 if (PerformWaterskinCombine(item, true))
2299 {
2300 CombineTypeFlag = 2;
2301 CombineRingFadeDir = 2;
2302 SoundEffect(SFX_TR4_MENU_COMBINE, nullptr, SoundEnvironment::Always);
2303 return;
2304 }
2305
2306 SayNo();
2307 CombineRingFadeDir = 2;
2308 }
2309 else if (invItem >= INV_OBJECT_SMALL_WATERSKIN_EMPTY &&
2310 invItem <= INV_OBJECT_SMALL_WATERSKIN_3L &&
2311 ammoItem >= INV_OBJECT_BIG_WATERSKIN_EMPTY &&
2312 ammoItem <= INV_OBJECT_BIG_WATERSKIN_5L)
2313 {
2314 if (PerformWaterskinCombine(item, false))
2315 {
2316 CombineTypeFlag = 2;
2317 CombineRingFadeDir = 2;
2318 SoundEffect(SFX_TR4_MENU_COMBINE, nullptr, SoundEnvironment::Always);
2319 return;

Callers

nothing calls this directly

Calls 6

SoundEffectFunction · 0.85
SayNoFunction · 0.85
GetSettingsMethod · 0.80
GetStringMethod · 0.80
AddStringMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected