MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnCreateCtrl

Method OnCreateCtrl

engine/Poseidon/UI/Map/UIArcade.cpp:805–1031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803}
804
805Control* DisplayArcadeUnit::OnCreateCtrl(int type, int idc, const ParamEntry& cls)
806{
807 switch (idc)
808 {
809 case IDC_ARCUNIT_TITLE:
810 {
811 CStatic* text = new CStatic(this, idc, cls);
812 if (_index < 0)
813 {
814 text->SetText(LocalizeString(IDS_ARCUNIT_TITLE2));
815 }
816 else
817 {
818 text->SetText(LocalizeString(IDS_ARCUNIT_TITLE4));
819 }
820 return text;
821 }
822 case IDC_ARCUNIT_AZIMUT_PICTURE:
823 return new CStaticAzimut(this, idc, cls, IDC_ARCUNIT_AZIMUT);
824 case IDC_ARCUNIT_SIDE:
825 {
826 CCombo* combo = new CCombo(this, idc, cls);
827 int index, sel = 0;
828 index = combo->AddString(LocalizeString(IDS_WEST));
829 combo->SetValue(index, TWest);
830 if (_unit.side == TWest)
831 {
832 sel = index;
833 }
834 index = combo->AddString(LocalizeString(IDS_EAST));
835 combo->SetValue(index, TEast);
836 if (_unit.side == TEast)
837 {
838 sel = index;
839 }
840 index = combo->AddString(LocalizeString(IDS_GUERRILA));
841 combo->SetValue(index, TGuerrila);
842 if (_unit.side == TGuerrila)
843 {
844 sel = index;
845 }
846 index = combo->AddString(LocalizeString(IDS_CIVILIAN));
847 combo->SetValue(index, TCivilian);
848 if (_unit.side == TCivilian)
849 {
850 sel = index;
851 }
852 if (_unit.player == APNonplayable)
853 {
854 index = combo->AddString(LocalizeString(IDS_LOGIC));
855 combo->SetValue(index, TLogic);
856 if (_unit.side == TLogic)
857 {
858 sel = index;
859 }
860 index = combo->AddString(LocalizeString(IDS_EMPTY));
861 combo->SetValue(index, TEmpty);
862 if (_unit.side == TEmpty)

Callers 1

LoadControlMethod · 0.45

Calls 15

LocalizeStringFunction · 0.85
saturateFunction · 0.85
AddStringMethod · 0.80
EnableCtrlMethod · 0.80
ShowCtrlMethod · 0.80
SetThumbPosMethod · 0.80
stricmpFunction · 0.50
SetTextMethod · 0.45
SetValueMethod · 0.45
SetCurSelMethod · 0.45
SetRangeMethod · 0.45
SetSpeedMethod · 0.45

Tested by

no test coverage detected