MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ToggleSelectedState

Method ToggleSelectedState

src/network/network_content.cpp:898–913  ·  view source on GitHub ↗

Toggle the state of a content info and check its dependencies */

Source from the content-addressed store, hash-verified

896
897/** Toggle the state of a content info and check its dependencies */
898void ClientNetworkContentSocketHandler::ToggleSelectedState(const ContentInfo &ci)
899{
900 switch (ci.state) {
901 case ContentInfo::State::Selected:
902 case ContentInfo::State::Autoselected:
903 this->Unselect(ci.id);
904 break;
905
906 case ContentInfo::State::Unselected:
907 this->Select(ci.id);
908 break;
909
910 default:
911 break;
912 }
913}
914
915/**
916 * Reverse lookup the dependencies of (direct) parents over a given child.

Callers 3

OnClickMethod · 0.80
OnKeyPressMethod · 0.80
OnReceiveContentInfoMethod · 0.80

Calls 2

UnselectMethod · 0.95
SelectMethod · 0.95

Tested by

no test coverage detected