MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / rightOverBuildingConstruct

Function rightOverBuildingConstruct

src/OpenLoco/src/Ui/ViewportInteraction.cpp:797–814  ·  view source on GitHub ↗

0x004CDE78 Note: this is only when in a constructing mode

Source from the content-addressed store, hash-verified

795 // 0x004CDE78
796 // Note: this is only when in a constructing mode
797 static bool rightOverBuildingConstruct(InteractionArg& interaction)
798 {
799 auto* tileElement = reinterpret_cast<World::TileElement*>(interaction.object);
800 auto* building = tileElement->as<BuildingElement>();
801 if (building == nullptr)
802 {
803 return false;
804 }
805
806 const auto* buildingObj = building->getObject();
807 auto args = FormatArguments::mapToolTip();
808 if (SceneManager::isEditorMode() || SceneManager::isSandboxMode() || !buildingObj->hasFlags(BuildingObjectFlags::indestructible))
809 {
810 args.push(StringIds::stringid_right_click_to_remove);
811 }
812 args.push(buildingObj->name);
813 return true;
814 }
815
816 // 0x004CE107
817 static bool rightOverHeadquarters(InteractionArg& interaction)

Callers 1

rightOverFunction · 0.85

Calls 5

isEditorModeFunction · 0.85
isSandboxModeFunction · 0.85
getObjectMethod · 0.45
hasFlagsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected