CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    A Pink button theme

    Kotlin/Java
    4
    10
    342
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Larissa
      Larissa last edited by Larissa

      MixinGuiButton

      package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
      
      import net.ccbluex.liquidbounce.ui.font.AWTFontRenderer;
      import net.ccbluex.liquidbounce.ui.font.Fonts;
      import net.ccbluex.liquidbounce.utils.render.RenderUtils;
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.gui.FontRenderer;
      import net.minecraft.client.gui.Gui;
      import net.minecraft.client.gui.GuiButton;
      import net.minecraft.client.renderer.GlStateManager;
      import net.minecraft.util.ResourceLocation;
      import net.minecraftforge.fml.relauncher.Side;
      import net.minecraftforge.fml.relauncher.SideOnly;
      import org.spongepowered.asm.mixin.Final;
      import org.spongepowered.asm.mixin.Mixin;
      import org.spongepowered.asm.mixin.Overwrite;
      import org.spongepowered.asm.mixin.Shadow;
      
      import java.awt.*;
      
      
      @Mixin(GuiButton.class)
      @SideOnly(Side.CLIENT)
      public abstract class MixinGuiButton extends Gui {
      
         @Shadow
         public boolean visible;
      
         @Shadow
         public int xPosition;
      
         @Shadow
         public int yPosition;
      
         @Shadow
         public int width;
      
         @Shadow
         public int height;
      
         @Shadow
         protected boolean hovered;
      
         @Shadow
         public boolean enabled;
      
         @Shadow
         protected abstract void mouseDragged(Minecraft mc, int mouseX, int mouseY);
      
         @Shadow
         public String displayString;
      
         @Shadow
         @Final
         protected static ResourceLocation buttonTextures;
         private float cut;
         private float alpha;
      
         @Overwrite
         public void drawButton(Minecraft mc, int mouseX, int mouseY) {
            if (visible) {
               final FontRenderer fontRenderer =
                  mc.getLanguageManager().isCurrentLocaleUnicode() ? mc.fontRendererObj : Fonts.font35;
               hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition &&
                          mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
      
               final int delta = RenderUtils.deltaTime;
      
               if (enabled && hovered) {
                  cut += 0.05F * delta;
      
                  if (cut >= 4) cut = 4;
      
                  alpha += 0.3F * delta;
      
                  if (alpha >= 210) alpha = 210;
               } else {
                  cut -= 0.05F * delta;
      
                  if (cut <= 0) cut = 0;
      
                  alpha -= 0.3F * delta;
      
                  if (alpha <= 120) alpha = 120;
               }
      
               Gui.drawRect(this.xPosition + (int) this.cut, this.yPosition,
                       this.xPosition + this.width - (int) this.cut, this.yPosition + this.height,
                       this.enabled ? new Color(1F, 0.8F, 1F, this.alpha / 255F).getRGB() :
                               new Color(1F, 0.7F, 1F, 1F).getRGB());
               RenderUtils.drawBorderedRect(this.xPosition + (int) this.cut, this.yPosition,
                       this.xPosition + this.width - (int) this.cut, this.yPosition + this.height,3F, new Color(255,200,255,255).getRGB(), new Color(255, 190, 255, 50).getRGB());
               RenderUtils.drawBorderedRect(this.xPosition + (int) this.cut, this.yPosition,
                       this.xPosition + this.width - (int) this.cut, this.yPosition + this.height,1F, new Color(30,30,30,180).getRGB(), new Color(255, 180, 255, 0).getRGB());
      
               mc.getTextureManager().bindTexture(buttonTextures);
               mouseDragged(mc, mouseX, mouseY);
      
               AWTFontRenderer.Companion.setAssumeNonVolatile(true);
      
               fontRenderer.drawStringWithShadow(displayString,
                       (float) ((this.xPosition + this.width / 2) -
                               fontRenderer.getStringWidth(displayString) / 2),
                       this.yPosition + (this.height - 5) / 2F, 14737632);
      
               AWTFontRenderer.Companion.setAssumeNonVolatile(false);
      
               GlStateManager.resetColor();
            }
         }
      }
      

      and MixinButtonExt

      package net.ccbluex.liquidbounce.injection.forge.mixins.gui;
      
      import net.ccbluex.liquidbounce.ui.font.Fonts;
      import net.ccbluex.liquidbounce.utils.render.RenderUtils;
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.gui.FontRenderer;
      import net.minecraft.client.gui.GuiButton;
      import net.minecraft.client.renderer.GlStateManager;
      import net.minecraftforge.fml.client.config.GuiButtonExt;
      import net.minecraftforge.fml.relauncher.Side;
      import net.minecraftforge.fml.relauncher.SideOnly;
      import org.spongepowered.asm.mixin.Mixin;
      import org.spongepowered.asm.mixin.Overwrite;
      
      import java.awt.*;
      
      @Mixin(GuiButtonExt.class)
      @SideOnly(Side.CLIENT)
      public abstract class MixinGuiButtonExt extends GuiButton {
         private float cut;
         private float alpha;
      
         public MixinGuiButtonExt(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) {
            super(p_i1020_1_, p_i1020_2_, p_i1020_3_, p_i1020_4_);
         }
      
         public MixinGuiButtonExt(int p_i46323_1_, int p_i46323_2_, int p_i46323_3_, int p_i46323_4_,
                                  int p_i46323_5_, String p_i46323_6_) {
            super(p_i46323_1_, p_i46323_2_, p_i46323_3_, p_i46323_4_, p_i46323_5_, p_i46323_6_);
         }
      
         @Overwrite
         public void drawButton(Minecraft mc, int mouseX, int mouseY) {
            if (visible) {
               final FontRenderer fontRenderer =
                  mc.getLanguageManager().isCurrentLocaleUnicode() ? mc.fontRendererObj : Fonts.font35;
               hovered = (mouseX >= this.xPosition && mouseY >= this.yPosition &&
                          mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height);
      
               final int delta = RenderUtils.deltaTime;
      
               if (enabled && hovered) {
                  cut += 0.05F * delta;
      
                  if (cut >= 4) cut = 4;
      
                  alpha += 0.3F * delta;
      
                  if (alpha >= 210) alpha = 210;
               } else {
                  cut -= 0.05F * delta;
      
                  if (cut <= 0) cut = 0;
      
                  alpha -= 0.3F * delta;
      
                  if (alpha <= 120) alpha = 120;
               }
               RenderUtils.drawCircleRect(this.xPosition + (int) this.cut, this.yPosition,
                            this.xPosition + this.width - (int) this.cut, this.yPosition + this.height,
                            2f,this.enabled ? new Color(0F, 0F, 0F, this.alpha / 255F).getRGB() :
                            new Color(0.5F, 0.5F, 0.5F, 0.5F).getRGB(),true);
      
               mc.getTextureManager().bindTexture(buttonTextures);
               mouseDragged(mc, mouseX, mouseY);
      
               fontRenderer.drawStringWithShadow(displayString,
                                                 (float) ((this.xPosition + this.width / 2) -
                                                          fontRenderer.getStringWidth(displayString) / 2),
                                                 this.yPosition + (this.height - 5) / 2F, 14737632);
               GlStateManager.resetColor();
            }
         }
      }
      

      just copy it and replace😁😁😁❤️❤️

      4C04C1E5-8D76-4F2E-90F5-71BD279BA909.png F9A3B193-2A01-4C31-903C-BEE2CCB53095.png 72993B4E-55CD-4F18-A8D4-347E1D040F2E.png A9048A6F-0DA1-4803-9E78-6846EE1952A5.png

      kumri owo 1 Reply Last reply Reply Quote 4
      • kumri owo
        kumri owo @Larissa last edited by kumri owo

        @larissa Pretty Good!, I think a bit more shading on the buttons will be nice! :axolove:

        kumri owo Larissa 3 Replies Last reply Reply Quote 0
        • kumri owo
          kumri owo @kumri owo last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Larissa
            Larissa @kumri owo last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • Larissa
              Larissa @kumri owo last edited by

              @cutiehacker okay!

              kumri owo 1 Reply Last reply Reply Quote 3
              • kumri owo
                kumri owo @Larissa last edited by

                @larissa If you want to, I imagine it might be a bit hard you can make the corners rounded

                kumri owo 1 Reply Last reply Reply Quote 0
                • kumri owo
                  kumri owo @kumri owo last edited by

                  @cutiehacker Also where did. you get that image? I like it a lot!

                  1 Reply Last reply Reply Quote 0
                  • wxdbie
                    wxdbie last edited by

                    sexy:axohearteyes:

                    kumri owo 1 Reply Last reply Reply Quote 0
                    • kumri owo
                      kumri owo @wxdbie last edited by

                      @wxdbie ikr

                      1 Reply Last reply Reply Quote 0
                      • W
                        wifewalkp last edited by

                        nice theme

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        About
                        • Terms of Service
                        • Privacy Policy
                        • Status
                        • Contact Us
                        Downloads
                        • Releases
                        • Source code
                        • License
                        Docs
                        • Tutorials
                        • CustomHUD
                        • AutoSettings
                        • ScriptAPI
                        Community
                        • Forum
                        • Guilded
                        • YouTube
                        • Twitter
                        • D.Tube