Preprocessor purge round 6: intro text and user agent

This commit is contained in:
Tamás Bálint Misius 2023-01-04 12:42:10 +01:00
parent fdfa206a3c
commit e97fd74503
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
3 changed files with 49 additions and 44 deletions

View File

@ -52,13 +52,14 @@ namespace http
cafile = newCafile; cafile = newCafile;
capath = newCapath; capath = newCapath;
user_agent = user_agent = ByteString::Build(
"PowderToy/" MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " (" "PowderToy/", SAVE_VERSION, ".", MINOR_VERSION, " ("
IDENT_PLATFORM IDENT_PLATFORM
"; " IDENT_BUILD "; " IDENT_BUILD
"; M" MTOS(MOD_ID) "; M", MOD_ID,
"; " IDENT "; " IDENT
") TPTPP/" MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) "." MTOS(BUILD_NUM) IDENT_RELTYPE "." MTOS(SNAPSHOT_ID); ") TPTPP/", SAVE_VERSION, ".", MINOR_VERSION, ".", BUILD_NUM, IDENT_RELTYPE ".", SNAPSHOT_ID
);
worker_thread = std::thread([this]() { Worker(); }); worker_thread = std::thread([this]() { Worker(); });
initialized = true; initialized = true;

View File

@ -191,7 +191,7 @@ GameView::GameView():
buttonTip(""), buttonTip(""),
isButtonTipFadingIn(false), isButtonTipFadingIn(false),
introText(2048), introText(2048),
introTextMessage(ByteString(introTextData).FromUtf8()), introTextMessage(IntroText().FromUtf8()),
doScreenshot(false), doScreenshot(false),
screenshotIndex(1), screenshotIndex(1),

View File

@ -1,8 +1,11 @@
#pragma once #pragma once
#include "Config.h" #include "Config.h"
#include "common/String.h"
const char *const introTextData = inline ByteString IntroText()
"\bl\bU" APPNAME "\bU - Version " MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " - https://powdertoy.co.uk, irc.libera.chat #powder, https://tpt.io/discord\n" {
ByteStringBuilder sb;
sb << "\bl\bU" APPNAME "\bU - Version " << SAVE_VERSION << "." << MINOR_VERSION << " - https://powdertoy.co.uk, irc.libera.chat #powder, https://tpt.io/discord\n"
"\n" "\n"
"\n" "\n"
"\bgControl+C/V/X are Copy, Paste and cut respectively.\n" "\bgControl+C/V/X are Copy, Paste and cut respectively.\n"
@ -24,39 +27,40 @@ const char *const introTextData =
"Contributors: \bgStanislaw K Skowronek (Designed the original Powder Toy),\n" "Contributors: \bgStanislaw K Skowronek (Designed the original Powder Toy),\n"
"\bgSimon Robertshaw, Skresanov Savely, cracker64, Catelite, Bryan Hoyle, Nathan Cousins, jacksonmj,\n" "\bgSimon Robertshaw, Skresanov Savely, cracker64, Catelite, Bryan Hoyle, Nathan Cousins, jacksonmj,\n"
"\bgFelix Wallin, Lieuwe Mosch, Anthony Boot, Me4502, MaksProg, jacob1, mniip, LBPHacker\n" "\bgFelix Wallin, Lieuwe Mosch, Anthony Boot, Me4502, MaksProg, jacob1, mniip, LBPHacker\n"
"\n" "\n";
#ifndef BETA #ifndef BETA
"\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://powdertoy.co.uk/Register.html\n";
#else #else
"\brThis is a BETA, you cannot save things publicly, nor open local saves and stamps made with it in older versions.\n" sb << "\brThis is a BETA, you cannot save things publicly, nor open local saves and stamps made with it in older versions.\n"
"\brIf you are planning on publishing any saves, use the release version.\n" "\brIf you are planning on publishing any saves, use the release version.\n";
#endif #endif
"\n" sb << "\n"
"\bt" MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) "." MTOS(BUILD_NUM) " " IDENT << "\bt" << SAVE_VERSION << "." << MINOR_VERSION << "." << BUILD_NUM << " " IDENT;
#ifdef SNAPSHOT #ifdef SNAPSHOT
" SNAPSHOT " MTOS(SNAPSHOT_ID) sb << " SNAPSHOT " << SNAPSHOT_ID;
#elif MOD_ID > 0 #elif MOD_ID > 0
" MODVER " MTOS(SNAPSHOT_ID) sb << " MODVER " << SNAPSHOT_ID;
#endif #endif
#if defined(X86_SSE) || defined(X86_SSE2) || defined(X86_SSE3) #if defined(X86_SSE) || defined(X86_SSE2) || defined(X86_SSE3)
" " IDENT_BUILD sb << " " IDENT_BUILD;
#endif #endif
#ifdef LUACONSOLE #ifdef LUACONSOLE
" LUACONSOLE" sb << " LUACONSOLE";
#endif #endif
#ifdef GRAVFFT #ifdef GRAVFFT
" GRAVFFT" sb << " GRAVFFT";
#endif #endif
#ifdef REALISTIC #ifdef REALISTIC
" REALISTIC" sb << " REALISTIC";
#endif #endif
#ifdef NOHTTP #ifdef NOHTTP
" NOHTTP" sb << " NOHTTP";
#endif #endif
#ifdef DEBUG #ifdef DEBUG
" DEBUG" sb << " DEBUG";
#endif #endif
#ifdef ENFORCE_HTTPS #ifdef ENFORCE_HTTPS
" HTTPS" sb << " HTTPS";
#endif #endif
; return sb.Build();
}