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

Method SpriteAlignerWindow

src/newgrf_debug_gui.cpp:813–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811 const Action5Type *act5_type = nullptr; ///< Sprite Area of current selected sprite.
812
813 SpriteAlignerWindow(WindowDesc &desc, WindowNumber wno) : Window(desc)
814 {
815 /* On first opening, set initial zoom to current zoom level. */
816 if (SpriteAlignerWindow::zoom == ZoomLevel::End) SpriteAlignerWindow::zoom = _gui_zoom;
817 SpriteAlignerWindow::zoom = Clamp(SpriteAlignerWindow::zoom, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max);
818
819 /* Oh yes, we assume there is at least one normal sprite! */
820 while (GetSpriteType(this->current_sprite) != SpriteType::Normal) this->current_sprite++;
821 this->SelectAction5Type();
822
823 this->CreateNestedTree();
824 this->vscroll = this->GetScrollbar(WID_SA_SCROLLBAR);
825 this->vscroll->SetCount(_newgrf_debug_sprite_picker.sprites.size());
826 this->FinishInitNested(wno);
827
828 this->SetWidgetLoweredState(WID_SA_CENTRE, SpriteAlignerWindow::centre);
829 this->SetWidgetLoweredState(WID_SA_CROSSHAIR, SpriteAlignerWindow::crosshair);
830
831 this->InvalidateData(0, true);
832 }
833
834 std::string GetWidgetString(WidgetID widget, StringID stringid) const override
835 {

Callers

nothing calls this directly

Calls 10

SelectAction5TypeMethod · 0.95
ClampFunction · 0.85
GetSpriteTypeFunction · 0.85
CreateNestedTreeMethod · 0.80
GetScrollbarMethod · 0.80
FinishInitNestedMethod · 0.80
SetWidgetLoweredStateMethod · 0.80
SetCountMethod · 0.45
sizeMethod · 0.45
InvalidateDataMethod · 0.45

Tested by

no test coverage detected