MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / createOrganisationControl

Method createOrganisationControl

game/ui/components/controlgenerator.cpp:655–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653}
654
655sp<Control> ControlGenerator::createOrganisationControl(GameState &state,
656 const OrganisationInfo &info)
657{
658 if (!singleton.initialised)
659 {
660 singleton.init(state);
661 }
662
663 auto frame = singleton.citySelect[info.selected ? 2 : 0];
664 auto baseControl = mksp<Graphic>(frame);
665 baseControl->Size = frame->size;
666 // FIXME: There's an extra 1 pixel here that's annoying
667 baseControl->Size.x -= 1;
668 baseControl->Name = "ORG_FRAME_" + info.organisation->name;
669 baseControl->setData(info.organisation);
670
671 auto orgIcon = baseControl->createChild<Graphic>(info.organisation->icon);
672 orgIcon->AutoSize = true;
673 orgIcon->Location = {1, 1};
674 orgIcon->Name = "ORG_ICON_" + info.organisation->name;
675 orgIcon->ToolTipText = tr(info.organisation->name);
676
677 return baseControl;
678}
679
680sp<Control> ControlGenerator::createOrganisationControl(GameState &state, sp<Organisation> org)
681{

Callers

nothing calls this directly

Calls 3

trFunction · 0.85
setDataMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected