Guest User

revert.patch

a guest
May 21st, 2026
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.66 KB | Source Code | 0 0
  1. diff --git a/src/common/engine/i_interface.cpp b/src/common/engine/i_interface.cpp
  2. index 57720360ea..cd6b8ea3f2 100644
  3. --- a/src/common/engine/i_interface.cpp
  4. +++ b/src/common/engine/i_interface.cpp
  5. @@ -70,8 +70,6 @@ CVAR(Int, defaultnethostteam, 255, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
  6.  CVAR(Int, defaultnetjointeam, 255, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
  7.  CVAR(Bool, defaultnetextratic, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
  8.  CVAR(String, defaultnetsavefile, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
  9. -CVAR(String, ui_colors, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
  10. -CVAR(Float, ui_color_mix, .35, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
  11.  
  12.  EXTERN_CVAR(Bool, ui_generic)
  13.  EXTERN_CVAR(Int, vid_preferbackend)
  14. @@ -84,9 +82,6 @@ CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOB
  15.     if (sysCallbacks.LanguageChanged) sysCallbacks.LanguageChanged(self);
  16.  }
  17.  
  18. -FARG(pride, "Launcher", "Show pride colors", "",
  19. -    "Show pride colors in launcher.");
  20. -
  21.  // Some of this info has to be passed and managed from the front end since it's game-engine specific.
  22.  FStartupSelectionInfo::FStartupSelectionInfo(const TArray<WadStuff>& wads, FArgs& args, int startFlags) : Wads(&wads), Args(&args), DefaultStartFlags(startFlags)
  23.  {
  24. @@ -137,9 +132,6 @@ FStartupSelectionInfo::FStartupSelectionInfo(const TArray<WadStuff>& wads, FArgs
  25.     DefaultNetAddress = defaultnetaddress;
  26.     DefaultNetJoinPort = defaultnetjoinport;
  27.     DefaultNetJoinTeam = defaultnetjointeam;
  28. -
  29. -   prideColors = Args->CheckParm(FArg_pride)? "list": ui_colors;
  30. -   prideMix = ui_color_mix;
  31.  }
  32.  
  33.  // Return whatever IWAD the user selected.
  34. diff --git a/src/common/engine/i_interface.h b/src/common/engine/i_interface.h
  35. index ce157cd5d5..b86e4656a0 100644
  36. --- a/src/common/engine/i_interface.h
  37. +++ b/src/common/engine/i_interface.h
  38. @@ -98,8 +98,6 @@ struct FStartupSelectionInfo
  39.     bool DefaultFullscreen = true;
  40.     int DefaultFileLoadBehaviour = 0;
  41.     bool notifyNewRelease = true;
  42. -   FName prideColors = {};
  43. -   float prideMix = 0;
  44.  
  45.     // Net game info
  46.     int DefaultNetIWAD = 0;
  47. diff --git a/src/d_main.cpp b/src/d_main.cpp
  48. index d4a925a8c2..1b89f12582 100644
  49. --- a/src/d_main.cpp
  50. +++ b/src/d_main.cpp
  51. @@ -278,7 +278,7 @@ FARG(nointro, "Loading", "Skips intro video", "",
  52.  FARG(episode, "Loading", "Starts the game on the first map of an episode", "1",
  53.     "Like -warp, bu starts the game on the first map of the specified episode");
  54.  
  55. -FARG(showlauncher, "Launcher", "Forces the startup launcher to show, even if disabled through other means.", "",
  56. +FARG(showlauncher, "Loading", "Forces the startup launcher to show, even if disabled through other means.", "",
  57.     "Forces the startup launcher to show, even if disabled through other means.");
  58.  
  59.  FARG(version, "Other", "Print version", "",
  60. diff --git a/src/utility/colorspace.cpp b/src/utility/colorspace.cpp
  61. index 208129f72a..7d7a080610 100644
  62. --- a/src/utility/colorspace.cpp
  63. +++ b/src/utility/colorspace.cpp
  64. @@ -34,23 +34,6 @@ Color rgb(ColorP r, ColorP g, ColorP b)
  65.     return { SRGB, r, g, b };
  66.  }
  67.  
  68. -Color rgb(uint32_t rgb24)
  69. -{
  70. -   ColorP r = ((rgb24>>16)&0xff)/255.0;
  71. -   ColorP g = ((rgb24>>8 )&0xff)/255.0;
  72. -   ColorP b = ((rgb24    )&0xff)/255.0;
  73. -   return rgb(r, g, b);
  74. -}
  75. -
  76. -uint32_t rgb24(const Color& c)
  77. -{
  78. -   Color C {c};
  79. -   memcpy(&C, &c, sizeof(c));
  80. -   _2rgb(C);
  81. -   uint8_t r = C.rgb.r*255, g = C.rgb.g*255, b = C.rgb.b*255;
  82. -   return r<<16 | g<<8 | b;
  83. -};
  84. -
  85.  Color rgb(const Color& c)
  86.  {
  87.     Color C {c};
  88. diff --git a/src/utility/colorspace.h b/src/utility/colorspace.h
  89. index 4041f7eb72..f7fee2229a 100644
  90. --- a/src/utility/colorspace.h
  91. +++ b/src/utility/colorspace.h
  92. @@ -77,7 +77,4 @@ void oklab2oklch(Color& lab);
  93.  
  94.  Color mix(const Color& a, const Color& b, ColorP mix);
  95.  
  96. -Color rgb(uint32_t c);
  97. -uint32_t rgb24(const Color& c);
  98. -
  99.  }
  100. diff --git a/src/widgets/launcherbanner.cpp b/src/widgets/launcherbanner.cpp
  101. index 39c2c07af3..2348d54535 100644
  102. --- a/src/widgets/launcherbanner.cpp
  103. +++ b/src/widgets/launcherbanner.cpp
  104. @@ -15,123 +15,19 @@
  105.  **
  106.  */
  107.  
  108. -#include <chrono>
  109. -
  110.  #include <zwidget/core/image.h>
  111.  #include <zwidget/widgets/imagebox/imagebox.h>
  112.  #include <zwidget/widgets/textlabel/textlabel.h>
  113.  
  114. -#include "basics.h"
  115.  #include "launcherbanner.h"
  116. -#include "name.h"
  117. -#include "printf.h"
  118.  #include "themedata.h"
  119. -#include "colorspace.h"
  120. -#include "zstring.h"
  121.  
  122. -std::vector<Color::Color> getColors(FName id)
  123. +LauncherBanner::LauncherBanner(Widget* parent) : Widget(parent)
  124.  {
  125. -   using namespace std::chrono;
  126. -   struct Flag {
  127. -       FName flagid;
  128. -       uint32_t data[19]; // alternate {space, color}. if space is 0, that is the end of the flag.
  129. -   };
  130. -   struct Flag tints[] = { // sorted alphabetically
  131. -       { "agender",      { 1, 0x000000, 1, 0xBCC4C7, 1, 0xFFFFFF, 1, 0xB7F684, 1, 0xFFFFFF, 1, 0xBCC4C7, 1, 0x000000, 0 }},
  132. -       { "aroace",       { 1, 0xE28C00, 1, 0xECCD00, 1, 0xFFFFFF, 1, 0x62AEDC, 1, 0x203856, 0 }},
  133. -       { "aroflux",      {1, 0xe7516a, 1, 0xd86d65, 1, 0xb7a55d, 1, 0xa3c95a, 1, 0x92e454, 0 }},
  134. -       { "aromantic",    { 1, 0x3DA542, 1, 0xA7D379, 1, 0xFFFFFF, 1, 0xA9A9A9, 1, 0x000000, 0 }},
  135. -       { "asexual",      { 1, 0x000000, 1, 0xA3A3A3, 1, 0xFFFFFF, 1, 0x800080, 0 }},
  136. -       { "bear",         { 1, 0x613704, 1, 0xD46300, 1, 0xFDDC62, 1, 0xFDE5B7, 1, 0xFFFFFF, 1, 0x545454, 1, 0x000000, 0 }},
  137. -       { "bisexual",     { 2, 0xD60270, 1, 0x9B4F96, 2, 0x0038A8, 0 }},
  138. -       { "demisexual",   { 5, 0xFFFFFF, 1, 0x6E0070, 1, 0x000000, 1, 0x6E0070, 5, 0xD2D2D2, 0 }},
  139. -       { "gay",          { 1, 0x078D70, 1, 0x26CEAA, 1, 0x98E8C1, 1, 0xFFFFFF, 1, 0x7BADE2, 1, 0x5049CC, 1, 0x3D1A78, 0 }},
  140. -       { "genderfluid",  { 1, 0xFF76A4, 1, 0xFFFFFF, 1, 0xC011D7, 1, 0x000000, 1, 0x2F3CBE, 0 }},
  141. -       { "genderqueer",  { 1, 0xB57EDC, 1, 0xFFFFFF, 1, 0x4A8123, 0 }},
  142. -       { "intersex",     { 5, 0xFFD800, 1, 0x7902AA, 5, 0xFFD800, 0 }},
  143. -       { "lesbian",      { 1, 0xD52D00, 1, 0xEF7627, 1, 0xFF9A56, 1, 0xFFFFFF, 1, 0xD162A4, 1, 0xB55690, 1, 0xA30262, 0 }},
  144. -       { "nonbinary",    { 1, 0xFCF434, 1, 0xFFFFFF, 1, 0x9C59D1, 1, 0x2C2C2C, 0 }},
  145. -       { "omnisexual",   { 1, 0xFE9ACE, 1, 0xFF53BF, 1, 0x200044, 1, 0x6760FE, 1, 0x8EA6FF, 0 }},
  146. -       { "pansexual",    { 1, 0xFF218C, 1, 0xFFD800, 1, 0x21B1FF, 0 }},
  147. -       { "philadelphia", { 1, 0x000000, 1, 0x784F17, 1, 0xD12229, 1, 0xF68A1E, 1, 0xFDE01A, 1, 0x007940, 1, 0x24408E, 1, 0x732982, 0 }},
  148. -       { "polysexual",   { 1, 0xF714BA, 1, 0x01D66A, 1, 0x1594F6, 0 }},
  149. -       { "queer",        { 1, 0x000000, 1, 0x99D9EA, 1, 0x00A2E8, 1, 0xB5E61D, 1, 0xFFFFFF, 1, 0xFFC90E, 1, 0xFD6666, 1, 0xFFAEC9, 1, 0x000000, 0 }},
  150. -       { "rainbow",      { 1, 0xE40303, 1, 0xFF8C00, 1, 0xFFED00, 1, 0x008026, 1, 0x004CFF, 1, 0x732982, 0 }},
  151. -       { "transgender",  { 1, 0x5BCEFA, 1, 0xF5A9B8, 1, 0xFFFFFF, 1, 0xF5A9B8, 1, 0x5BCEFA, 0 }},
  152. -   };
  153. -   std::vector<Color::Color> colors;
  154. -
  155. -   size_t flag;
  156. -   if (id == "random" || id == "list")
  157. -   {
  158. -       auto now = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
  159. -       flag = now % std::size(tints);
  160. -
  161. -       if (id == "list")
  162. -       {
  163. -           FString avail = "Available flag colors: random";
  164. -           for (auto &f: tints)
  165. -           {
  166. -               FString n = f.flagid.GetChars();
  167. -               n.ToLower();
  168. -               avail.AppendFormat(", %s", n.GetChars());
  169. -           }
  170. -           FString n = tints[flag].flagid.GetChars();
  171. -           n.ToLower();
  172. -           avail.AppendFormat("\nSelecting: %s", n.GetChars());
  173. -           Printf("%s\nOpen an issue on our github if your flag is missing\n", avail.GetChars());
  174. -       }
  175. -   }
  176. -   else
  177. -   {
  178. -       for (flag = 0; flag < std::size(tints); flag++)
  179. -       {
  180. -           if (tints[flag].flagid == id) break;
  181. -       }
  182. -   }
  183. -
  184. -   if (flag < std::size(tints))
  185. -   {
  186. -       for (unsigned i = 0; tints[flag].data[i] != 0; i+=2)
  187. -       {
  188. -           for (int j = tints[flag].data[i]; j >= 0; j--)
  189. -           {
  190. -               colors.push_back(Color::rgb(tints[flag].data[i+1]));
  191. -           }
  192. -       }
  193. -   }
  194. -
  195. -   return colors;
  196. -}
  197. -
  198. -LauncherBanner::LauncherBanner(Widget* parent, FName colors, float mix) : Widget(parent)
  199. -{
  200. -   bool useColors = colors != "";
  201. -   auto bg = Theme::getHeader(COLOR_BACKGROUND);
  202. -   if (useColors)
  203. -   {
  204. -       auto base = Color::rgb(0xFFFFFF);
  205. -       if (mix <= 0)
  206. -       {
  207. -           useColors = false;
  208. -           base = Color::rgb(bg.r, bg.g, bg.b);
  209. -           mix = -mix;
  210. -       }
  211. -       mix = clamp<float>(mix, 0, 1);
  212. -       for (auto &c: getColors(colors))
  213. -       {
  214. -           auto a = std::make_unique<Widget>(this);
  215. -           auto b = std::make_unique<Widget>(this);
  216. -           a->SetStyleColor("background-color", Colorf::fromRgb(Color::rgb24(c)));
  217. -           b->SetStyleColor("background-color", Colorf::fromRgb(Color::rgb24(Color::mix(base, c, mix))));
  218. -           stripes.push_back({std::move(a), std::move(b)});
  219. -       }
  220. -   }
  221. -
  222.     Logo = new ImageBox(this);
  223. -   auto imgsrc = (useColors || Theme::getMode() == LIGHT) ? "ui/banner-light.png": "ui/banner-dark.png";
  224. +   auto imgsrc = Theme::getMode() == LIGHT ? "ui/banner-light.png": "ui/banner-dark.png";
  225.     Logo->SetImage(Image::LoadResource(imgsrc));
  226. -   this->SetStyleColor("background-color", bg);
  227. +   this->SetStyleColor("background-color", Theme::getHeader(COLOR_BACKGROUND));
  228.  }
  229.  
  230.  double LauncherBanner::GetPreferredHeight()
  231. @@ -141,13 +37,5 @@ double LauncherBanner::GetPreferredHeight()
  232.  
  233.  void LauncherBanner::OnGeometryChanged()
  234.  {
  235. -   auto W = GetWidth(), H = Logo->GetPreferredHeight();
  236. -   auto w = Logo->GetPreferredWidth();
  237. -   auto h = H/stripes.size();
  238. -   for (unsigned i = 0; i < stripes.size(); i++)
  239. -   {
  240. -       std::get<0>(stripes[i]).get()->SetFrameGeometry(0, floor(h*i), W, ceil(h));
  241. -       std::get<1>(stripes[i]).get()->SetFrameGeometry((W-w)/2, floor(h*i), w, ceil(h));
  242. -   }
  243. -   Logo->SetFrameGeometry(0, 0, W, H);
  244. +   Logo->SetFrameGeometry(0.0, 0.0, GetWidth(), Logo->GetPreferredHeight());
  245.  }
  246. diff --git a/src/widgets/launcherbanner.h b/src/widgets/launcherbanner.h
  247. index 14ba1d3d4a..cfa1c23d9e 100644
  248. --- a/src/widgets/launcherbanner.h
  249. +++ b/src/widgets/launcherbanner.h
  250. @@ -19,25 +19,18 @@
  251.  
  252.  #include <zwidget/core/widget.h>
  253.  
  254. -#include <memory>
  255. -#include <vector>
  256. -
  257. -#include "name.h"
  258. -
  259.  class ImageBox;
  260.  class TextLabel;
  261.  
  262.  class LauncherBanner : public Widget
  263.  {
  264.  public:
  265. -   LauncherBanner(Widget* parent, FName colors, float mix);
  266. +   LauncherBanner(Widget* parent);
  267.  
  268.     double GetPreferredHeight() override;
  269.  
  270.  private:
  271.     void OnGeometryChanged() override;
  272.  
  273. -   std::vector<std::tuple<std::unique_ptr<Widget>,std::unique_ptr<Widget>>> stripes;
  274. -
  275.     ImageBox* Logo = nullptr;
  276.  };
  277. diff --git a/src/widgets/launcherwindow.cpp b/src/widgets/launcherwindow.cpp
  278. index 2ef85b8c17..00393ea2fe 100644
  279. --- a/src/widgets/launcherwindow.cpp
  280. +++ b/src/widgets/launcherwindow.cpp
  281. @@ -50,7 +50,7 @@ LauncherWindow::LauncherWindow(FStartupSelectionInfo& info) : Widget(nullptr, Wi
  282.  {
  283.     SetWindowTitle(GAMENAME);
  284.  
  285. -   Banner = new LauncherBanner(this, info.prideColors, info.prideMix);
  286. +   Banner = new LauncherBanner(this);
  287.     Pages = new TabWidget(this);
  288.     Buttonbar = new LauncherButtonbar(this);
  289.  
  290.  
Add Comment
Please, Sign In to add comment