| 642 | } |
| 643 | |
| 644 | void TransferScreen::initViewSecondBase() |
| 645 | { |
| 646 | int i = 0; |
| 647 | for (auto &b : state->player_bases) |
| 648 | { |
| 649 | auto viewName = format("BUTTON_SECOND_BASE_%d", ++i); |
| 650 | auto view = form->findControlTyped<GraphicButton>(viewName); |
| 651 | view->setVisible(true); |
| 652 | if (second_base == b.second) |
| 653 | { |
| 654 | currentSecondView = view; |
| 655 | } |
| 656 | view->setData(b.second); |
| 657 | auto viewImage = drawMiniBase(*b.second, viewHighlight, viewFacility); |
| 658 | view->setImage(viewImage); |
| 659 | view->setDepressedImage(viewImage); |
| 660 | wp<GraphicButton> weakView(view); |
| 661 | view->addCallback(FormEventType::ButtonClick, |
| 662 | [this, weakView](FormsEvent *e) |
| 663 | { |
| 664 | auto base = e->forms().RaisedBy->getData<Base>(); |
| 665 | if (this->second_base != base) |
| 666 | { |
| 667 | this->changeSecondBase(base); |
| 668 | this->currentSecondView = weakView.lock(); |
| 669 | } |
| 670 | }); |
| 671 | view->addCallback(FormEventType::MouseEnter, |
| 672 | [this](FormsEvent *e) |
| 673 | { |
| 674 | auto base = e->forms().RaisedBy->getData<Base>(); |
| 675 | this->textViewSecondBase->setText(base->name); |
| 676 | this->textViewSecondBase->setVisible(true); |
| 677 | this->textViewSecondBaseStatic->setVisible(false); |
| 678 | }); |
| 679 | view->addCallback(FormEventType::MouseLeave, |
| 680 | [this](FormsEvent *) |
| 681 | { |
| 682 | // this->textViewSecondBase->setText(""); |
| 683 | this->textViewSecondBase->setVisible(false); |
| 684 | this->textViewSecondBaseStatic->setVisible(true); |
| 685 | }); |
| 686 | } |
| 687 | textViewSecondBase = form->findControlTyped<Label>("TEXT_BUTTON_SECOND_BASE"); |
| 688 | textViewSecondBase->setVisible(false); |
| 689 | } |
| 690 | |
| 691 | void TransferScreen::render() |
| 692 | { |
nothing calls this directly
no test coverage detected