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

Method DumpControls

engine/Poseidon/UI/UITestEngine.cpp:129–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 if (!text.empty())
128 text += ' ';
129 text += fieldText;
130 }
131 }
132 return text;
133}
134
135void UITestEngine::SetSemanticControlText(IControl* ctrl, const char* text)
136{
137 if (!ctrl)
138 return;
139 if (!text || !*text)
140 {
141 ClearSemanticControlText(ctrl);
142 return;
143 }
144 ctrl->SetSemanticTestText(RString(text));
145}
146
147void UITestEngine::ClearSemanticControlText(IControl* ctrl)
148{
149 if (ctrl)
150 ctrl->ClearSemanticTestText();
151}
152
153// ── Dump Mode ──
154
155void UITestEngine::DumpControls(ControlsContainer* container, int depth)
156{
157 if (!container)
158 return;
159
160 std::string indent(depth * 2, ' ');
161 LOG_INFO(Core, "{}[UI-DUMP] IDD={} objects={} alwaysShow={}", indent, container->IDD(),
162 container->GetObjects().Size(), container->AlwaysShow() ? 1 : 0);
163
164 // Dump 3D objects
165 auto& objects = container->GetObjects();
166 LOG_INFO(Core, "{} [objects_count={}]", indent, objects.Size());
167 for (int i = 0; i < objects.Size(); i++)
168 {
169 ControlObject* obj = objects[i];
170 if (!obj)
171 {
172 LOG_INFO(Core, "{} OBJ[{}] null", indent, i);
173 continue;
174 }
175 auto* a = dynamic_cast<ControlObjectContainerAnim*>(obj);
176 auto* z = dynamic_cast<ControlObjectWithZoom*>(obj);
177 LOG_INFO(Core, "{} OBJ[{}] IDC={} visible={} isContainerAnim={} isWithZoom={}{}{}", indent, i, obj->IDC(),
178 obj->IsVisible() ? 1 : 0, a ? 1 : 0, z ? 1 : 0,
179 a ? std::string(" anim=") + std::to_string(a->IsAnimating()) +
180 " phase=" + std::to_string(a->GetPhase())
181 : "",
182 z ? std::string(" zooming=") + std::to_string(z->IsZooming()) : "");
183 }

Callers

nothing calls this directly

Calls 15

IDDMethod · 0.80
AlwaysShowMethod · 0.80
IDCMethod · 0.80
IsAnimatingMethod · 0.80
IsZoomingMethod · 0.80
SizeMethod · 0.45
IsVisibleMethod · 0.45
GetPhaseMethod · 0.45
GetCtrlMethod · 0.45
IsEnabledMethod · 0.45
XMethod · 0.45
YMethod · 0.45

Tested by

no test coverage detected