Unhardcode powdertoy.co.uk from most places

Namely, everywhere except in the network part (first line) of the intro text, since that should be customized more extensively by a client+server developer.
This commit is contained in:
Tamás Bálint Misius 2024-03-06 22:03:45 +01:00
parent 82bcb0ef9e
commit 7cd684ccfe
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
6 changed files with 7 additions and 6 deletions

View File

@ -118,7 +118,7 @@ void Client::Tick()
{ {
if (versionCheckRequest->StatusCode() == 618) if (versionCheckRequest->StatusCode() == 618)
{ {
AddServerNotification({ "Failed to load SSL certificates", ByteString(SCHEME) + "powdertoy.co.uk/FAQ.html" }); AddServerNotification({ "Failed to load SSL certificates", ByteString::Build(SCHEME, SERVER, "/FAQ.html") });
} }
try try
{ {

View File

@ -552,7 +552,7 @@ bool GameController::MouseUp(int x, int y, unsigned button, MouseupReason reason
} }
break; break;
case sign::Type::Thread: case sign::Type::Thread:
Platform::OpenURI(ByteString::Build(SCHEME, "powdertoy.co.uk/Discussions/Thread/View.html?Thread=", str.Substr(3, si.first - 3).ToUtf8())); Platform::OpenURI(ByteString::Build(SCHEME, SERVER, "/Discussions/Thread/View.html?Thread=", str.Substr(3, si.first - 3).ToUtf8()));
break; break;
case sign::Type::Search: case sign::Type::Search:
OpenSearch(str.Substr(3, si.first - 3)); OpenSearch(str.Substr(3, si.first - 3));

View File

@ -76,7 +76,7 @@ inline ByteString IntroText()
} }
else else
{ {
sb << "\bgTo use online features such as saving, you need to register at: \brhttps://powdertoy.co.uk/Register.html\n"; sb << "\bgTo use online features such as saving, you need to register at: \brhttps://" << SERVER << "/Register.html\n";
} }
sb << "\n\bt" << VersionInfo(); sb << "\n\bt" << VersionInfo();
return sb.Build(); return sb.Build();

View File

@ -1,5 +1,6 @@
#include "LoginModel.h" #include "LoginModel.h"
#include "LoginView.h" #include "LoginView.h"
#include "Config.h"
#include "client/Client.h" #include "client/Client.h"
#include "client/http/LoginRequest.h" #include "client/http/LoginRequest.h"
#include "client/http/LogoutRequest.h" #include "client/http/LogoutRequest.h"
@ -8,7 +9,7 @@ void LoginModel::Login(ByteString username, ByteString password)
{ {
if (username.Contains("@")) if (username.Contains("@"))
{ {
statusText = "Use your Powder Toy account to log in, not your email. If you don't have a Powder Toy account, you can create one at https://powdertoy.co.uk/Register.html"; statusText = String::Build("Use your Powder Toy account to log in, not your email. If you don't have a Powder Toy account, you can create one at https://", SERVER, "/Register.html");
loginStatus = loginIdle; loginStatus = loginIdle;
notifyStatusChanged(); notifyStatusChanged();
return; return;

View File

@ -147,7 +147,7 @@ void PreviewModel::OnSaveReady()
{ {
auto gameSave = std::make_unique<GameSave>(*saveData); auto gameSave = std::make_unique<GameSave>(*saveData);
if (gameSave->fromNewerVersion) if (gameSave->fromNewerVersion)
new ErrorMessage("This save is from a newer version", "Please update TPT in game or at https://powdertoy.co.uk"); new ErrorMessage("This save is from a newer version", String::Build("Please update TPT in game or at https://", SERVER));
saveInfo->SetGameSave(std::move(gameSave)); saveInfo->SetGameSave(std::move(gameSave));
} }
catch(ParseException &e) catch(ParseException &e)

View File

@ -151,7 +151,7 @@ void UpdateActivity::NotifyError(Task * sender)
new ConfirmPrompt("Autoupdate failed", sb.Build(), { [this] { new ConfirmPrompt("Autoupdate failed", sb.Build(), { [this] {
if constexpr (!USE_UPDATESERVER) if constexpr (!USE_UPDATESERVER)
{ {
Platform::OpenURI(ByteString(SCHEME) + "powdertoy.co.uk/Download.html"); Platform::OpenURI(ByteString::Build(SCHEME, SERVER, "/Download.html"));
} }
Exit(); Exit();
}, [this] { Exit(); } }); }, [this] { Exit(); } });