mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(ugc): color_brightness and transparent_colors
color_brightness (percent, default 100: unchanged) scales the models' vertex colors, not the icons', for servers where the made models look brighter than they should. transparent_colors names color ids drawn transparent whatever Materials.xml says: 129 (Tr. Bright Bluish Violet with Glitter) has alpha 255 there, so it came out opaque; a named color gets transparent_opacity. Both default to off, so models come out byte for byte as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,6 +79,15 @@ namespace {
|
||||
settings.build.palette = Game::config->GetValue("color_palette") == "brickdb" ? UgcModel::ePalette::BRICKDB : UgcModel::ePalette::LU_TOOLBOX;
|
||||
settings.build.colorVariation = std::clamp(Setting<float>("color_variation", 5.0f), 0.0f, 100.0f);
|
||||
settings.build.transparentOpacity = std::clamp(Setting<float>("transparent_opacity", 58.82f), 0.0f, 100.0f);
|
||||
settings.build.brightness = std::clamp(Setting<float>("color_brightness", 100.0f), 0.0f, 200.0f);
|
||||
{
|
||||
std::stringstream stream(Game::config->GetValue("transparent_colors"));
|
||||
std::string id;
|
||||
while (std::getline(stream, id, ',')) {
|
||||
std::erase_if(id, [](unsigned char c) { return std::isspace(c); });
|
||||
if (const auto color = GeneralUtils::TryParse<uint32_t>(id)) settings.build.transparentColors.insert(*color);
|
||||
}
|
||||
}
|
||||
const auto lods = ParseLods(Game::config->GetValue("lods").empty() ? "0,2" : Game::config->GetValue("lods"));
|
||||
if (!lods.empty()) settings.lods = lods;
|
||||
settings.lodDistances.lod0 = Setting<float>("lod_distance_0", 0.0f);
|
||||
|
||||
Reference in New Issue
Block a user