| 653 | } |
| 654 | |
| 655 | sp<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 | |
| 680 | sp<Control> ControlGenerator::createOrganisationControl(GameState &state, sp<Organisation> org) |
| 681 | { |