MCPcopy Create free account
hub / github.com/ddnet/ddnet / RenderMapSettingsErrorDialog

Method RenderMapSettingsErrorDialog

src/game/editor/editor_server_settings.cpp:546–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546void CEditor::RenderMapSettingsErrorDialog()
547{
548 auto &LoadedMapSettings = m_MapSettingsBackend.m_LoadedMapSettings;
549 auto &vSettingsInvalid = LoadedMapSettings.m_vSettingsInvalid;
550 auto &vSettingsValid = LoadedMapSettings.m_vSettingsValid;
551 auto &SettingsDuplicate = LoadedMapSettings.m_SettingsDuplicate;
552
553 Ui()->MapScreen();
554 CUIRect Overlay = *Ui()->Screen();
555
556 Overlay.Draw(ColorRGBA(0, 0, 0, 0.33f), IGraphics::CORNER_NONE, 0.0f);
557 CUIRect Background;
558 Overlay.VMargin(150.0f, &Background);
559 Background.HMargin(50.0f, &Background);
560 Background.Draw(ColorRGBA(0, 0, 0, 0.80f), IGraphics::CORNER_ALL, 5.0f);
561
562 CUIRect View;
563 Background.Margin(10.0f, &View);
564
565 CUIRect Title, ButtonBar, Label;
566 View.HSplitTop(18.0f, &Title, &View);
567 View.HSplitTop(5.0f, nullptr, &View); // some spacing
568 View.HSplitBottom(18.0f, &View, &ButtonBar);
569 View.HSplitBottom(10.0f, &View, nullptr); // some spacing
570
571 // title bar
572 Title.Draw(ColorRGBA(1, 1, 1, 0.25f), IGraphics::CORNER_ALL, 4.0f);
573 Title.VMargin(10.0f, &Title);
574 Ui()->DoLabel(&Title, "Map settings error", 12.0f, TEXTALIGN_ML);
575
576 // Render body
577 {
578 static CLineInputBuffered<256> s_Input;
579 static CMapSettingsBackend::CContext s_Context = m_MapSettingsBackend.NewContext(&s_Input);
580
581 // Some text
582 SLabelProperties Props;
583 CUIRect Text;
584 View.HSplitTop(30.0f, &Text, &View);
585 Props.m_MaxWidth = Text.w;
586 Ui()->DoLabel(&Text, "Below is a report of the invalid map settings found when loading the map. Please fix them before proceeding further.", 10.0f, TEXTALIGN_MC, Props);
587
588 // Mixed list
589 CUIRect List = View;
590 View.Draw(ColorRGBA(1, 1, 1, 0.25f), IGraphics::CORNER_ALL, 3.0f);
591
592 const float RowHeight = 18.0f;
593 static CScrollRegion s_ScrollRegion;
594 vec2 ScrollOffset(0.0f, 0.0f);
595 CScrollRegionParams ScrollParams;
596 ScrollParams.m_ScrollUnit = 120.0f;
597 s_ScrollRegion.Begin(&List, &ScrollOffset, &ScrollParams);
598 const float EndY = List.y + List.h;
599 List.y += ScrollOffset.y;
600
601 List.HSplitTop(20.0f, nullptr, &List);
602
603 static int s_FixingCommandIndex = -1;

Callers

nothing calls this directly

Calls 15

UiFunction · 0.85
MapFunction · 0.85
TextRenderFunction · 0.85
maximumFunction · 0.85
str_comp_nocaseFunction · 0.85
ScreenMethod · 0.80
VMarginMethod · 0.80
HMarginMethod · 0.80
MarginMethod · 0.80
HSplitTopMethod · 0.80
HSplitBottomMethod · 0.80
DoLabelMethod · 0.80

Tested by

no test coverage detected