MCPcopy Create free account
hub / github.com/MyGUI/mygui / notifyCommand

Method notifyCommand

UnitTests/UnitTest_Layers/MonitorPanel.cpp:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29
30 void MonitorPanel::notifyCommand(std::string_view /*_name*/, MyGUI::Any _data)
31 {
32 std::string* data = _data.castType<std::string>(false);
33 if (data != nullptr)
34 {
35 MyGUI::IResource* base_resource = MyGUI::ResourceManager::getInstance().getByName(*data, false);
36 if (base_resource != nullptr)
37 {
38 ResourceDevice* device = base_resource->castType<ResourceDevice>(false);
39 if (device != nullptr)
40 {
41 mShipImage->setItemName(device->getDeviceName());
42 mDescription->setProperty("Caption", device->getDeviceDescription());
43 mEnergy->setProperty("RangePosition", MyGUI::utility::toString(device->getValueEnergy()));
44 mExplosion->setProperty("RangePosition", MyGUI::utility::toString(device->getValueExplosion()));
45 mTarget->setProperty("RangePosition", MyGUI::utility::toString(device->getValueTarget()));
46 mHP->setProperty("RangePosition", MyGUI::utility::toString(device->getValueHP()));
47 }
48 }
49 }
50 }
51
52} // namespace demo

Callers

nothing calls this directly

Calls 8

toStringFunction · 0.85
getValueEnergyMethod · 0.80
getValueExplosionMethod · 0.80
getValueTargetMethod · 0.80
getValueHPMethod · 0.80
getByNameMethod · 0.45
setItemNameMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected