Guest User

Untitled

a guest
Feb 28th, 2025
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.67 KB | None | 0 0
  1.     // Default font if no specific font is assigned
  2.     private const string DefaultFont = "Calibri";
  3.  
  4.     private void method_15(bool bool_4 = false)
  5.     {
  6.         if (!Boolean_0) return;
  7.  
  8.         // Obtener etiquetas de gradiente y jitter
  9.         string gradientTag = (bool_4 || Int32_0 <= 0) ? "" : UTM_StaticData.GetGradientTag(Int32_0.ToString());
  10.         string jitterTag = (bool_4 || Int32_0 <= 0) ? "" : UTM_StaticData.GetJitterTag(Int32_0.ToString());
  11.  
  12.         // Construir el texto base
  13.         string text = gradientTag + jitterTag + String_1;
  14.  
  15.         // Aplicar efecto de color y negrita
  16.         if (!string.IsNullOrEmpty(NickType))
  17.         {
  18.             text = $"<c={NickType}><b>{text}</b></c>";
  19.         }
  20.         else
  21.         {
  22.             text = "<b>" + text + "</b>";
  23.         }
  24.  
  25.         // ✅ Apply text effects (color/negrita) según NickTypeTitle
  26.         if (!string.IsNullOrEmpty(NickEffect))
  27.         {
  28.             text = $"<j={NickEffect}><b>{text}</b></j>";
  29.         }
  30.         else
  31.         {
  32.             text = "<b>" + text + "</b>";
  33.         }
  34.  
  35.         // Aplicar tamaño de texto
  36.         UnionTextMesh_0.size = 18;
  37.  
  38.         // Limpiar texto si es necesario
  39.         if (Boolean_2)
  40.             text = "";
  41.  
  42.         // Asignar y reconstruir el texto si ha cambiado
  43.         if (text != UnionTextMesh_0.Text)
  44.         {
  45.             UnionTextMesh_0.Text = text;
  46.             UnionTextMesh_0.Rebuild();
  47.         }
  48.  
  49.         // Aplicar la fuente: si NickFont tiene valor y está en el bundle, se asigna directamente.
  50.         if (!string.IsNullOrEmpty(NickFont))
  51.         {
  52.             if (FontManager.LoadedFonts.TryGetValue(NickFont, out UTMFontData nickFontData))
  53.             {
  54.                 UnionTextMesh_0.font = nickFontData.font;
  55.                 Debug.Log($"[INFO] Applied Nick font: {nickFontData.font.name} for {NickFont}");
  56.             }
  57.             else
  58.             {
  59.                 Debug.LogWarning($"[WARNING] Font '{NickFont}' not found in bundle. Using default.");
  60.             }
  61.         }
  62.         else
  63.         {
  64.             // Si NickFont no está definido, se sigue la lógica anterior (por ejemplo, usar DefaultFont o UserFonts).
  65.             string assignedFont = DefaultFont;
  66.  
  67.             if (FontManager.LoadedFonts.TryGetValue(assignedFont, out UTMFontData selectedFontData))
  68.             {
  69.                 UnionTextMesh_0.font = selectedFontData.font;
  70.                 Debug.Log($"[INFO] Applied font: {selectedFontData.font.name} for {assignedFont}");
  71.             }
  72.             else
  73.             {
  74.                 Debug.LogWarning($"[WARNING] Font '{assignedFont}' not found. Using default.");
  75.             }
  76.         }
  77.     }
Advertisement
Add Comment
Please, Sign In to add comment