Skip to content

Commit d2a6b2e

Browse files
levinli303claude
andcommitted
Add support for celestia://settime?julianDay= URL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5a625d8 commit d2a6b2e

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

CelestiaWinUI/MainWindow.xaml.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,29 @@ namespace winrt::CelestiaWinUI::implementation
12601260
co_return false;
12611261
}
12621262

1263+
if (url.Host() == L"settime")
1264+
{
1265+
if (auto parsed = url.QueryParsed(); parsed != nullptr)
1266+
{
1267+
if (auto julianDayStr = parsed.GetFirstValueByName(L"julianDay"); !julianDayStr.empty())
1268+
{
1269+
wchar_t* end = nullptr;
1270+
double julianDay = std::wcstod(julianDayStr.c_str(), &end);
1271+
if (end != julianDayStr.c_str())
1272+
{
1273+
renderer.EnqueueTask([weak_this{ get_weak() }, julianDay]()
1274+
{
1275+
auto strong_this{ weak_this.get() };
1276+
if (strong_this == nullptr || strong_this->isClosed) return;
1277+
strong_this->appCore.Simulation().JulianDay(julianDay);
1278+
});
1279+
co_return true;
1280+
}
1281+
}
1282+
}
1283+
co_return false;
1284+
}
1285+
12631286
co_return false;
12641287
}
12651288

0 commit comments

Comments
 (0)