MCPcopy Create free account
hub / github.com/chrxh/alien / processSettings

Method processSettings

source/Gui/StatisticsWindow.cpp:258–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void StatisticsWindow::processSettings()
259{
260 ImGui::Spacing();
261 ImGui::Spacing();
262 if (_settingsOpen) {
263 AlienImGui::MovableSeparator(AlienImGui::MovableSeparatorParameters().additive(false), _settingsHeight);
264 }
265
266 _settingsOpen =
267 AlienImGui::BeginTreeNode(AlienImGui::TreeNodeParameters().name("Settings").rank(AlienImGui::TreeNodeRank::High).defaultOpen(_settingsOpen));
268 if (_settingsOpen) {
269 if (ImGui::BeginChild("##addons", {scale(0), 0})) {
270 ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - scale(RightColumnWidth));
271 if (_plotMode == 0) {
272 AlienImGui::SliderFloat(
273 AlienImGui::SliderFloatParameters()
274 .name("Time horizon")
275 .min(1.0f)
276 .max(TimelineLiveStatistics::MaxLiveHistory)
277 .format("%.1f s")
278 .textWidth(RightColumnWidth),
279 &_timeHorizonForLiveStatistics);
280 }
281 if (_plotMode == 1) {
282 AlienImGui::SliderFloat(
283 AlienImGui::SliderFloatParameters().name("Time horizon").min(1.0f).max(100.0f).format("%.0f percent").textWidth(RightColumnWidth),
284 &_timeHorizonForLongtermStatistics);
285 }
286
287 AlienImGui::SliderFloat(
288 AlienImGui::SliderFloatParameters().name("Plot height").min(MinPlotHeight).max(1000.0f).format("%.0f").textWidth(RightColumnWidth),
289 &_plotHeight);
290 AlienImGui::Switcher(AlienImGui::SwitcherParameters().name("Scale").textWidth(RightColumnWidth).values({"Linear", "Logarithmic"}), _plotScale);
291 }
292 ImGui::EndChild();
293 }
294 AlienImGui::EndTreeNode();
295}
296
297void StatisticsWindow::processTimelineStatistics()
298{

Callers

nothing calls this directly

Calls 6

TreeNodeParametersClass · 0.85
scaleFunction · 0.85
SwitcherParametersClass · 0.85
formatMethod · 0.80

Tested by

no test coverage detected