lumien231 / Custom-Main-Menu

A mod that allows you to modify the minecraft main menu
MIT License
67 stars 37 forks source link

Button not showing #40

Closed itsfolf closed 9 years ago

itsfolf commented 9 years ago

Official Site button as not showing. What is the error on this? Im view on this example: http://pastebin.com/0S6VBxUX My config: { "images": { "title": { "image": "test:textures/minecrafters.png", "posX" : -137, "posY" : 30, "width" : 512, "height" : 512, "alignment" : "top_center" } },

"buttons":
{
    "singleplayer":
    {
        "text" : "Single Player Worlds",
        "posX" : -100,
        "posY" : 48,
        "width" : 200,
        "height" : 20
    },

    "multiplayerddd":
    {
        "text" : "Server List",
        "posX" : -100,
        "posY" : 72,
        "width" : 200,
        "height" : 20
    },

    "mods":
    {
        "text" : "Active Mods",
        "posX" : -100,
        "posY" : 96,
        "width" : 200,
        "height" : 20
    },

    "options":
    {
        "text" : "Options",
        "posX" : -100,
        "posY" : 132,
        "width" : 98,
        "height" : 20
    },

    "quit":
    {
        "text" : "Quit Game",
        "posX" : 2,
        "posY" : 132,
        "width" : 98,
        "height" : 20
    },

    "refresh":
    {
        "text" : "",
        "posX" : -154,
        "posY" : 132,
        "width" : 20,
        "height" : 20
    }
},

    "Official Site":
    {
        "text" : "Official Site",
        "alignment" : "top_right",
        "texture" : "custommainmenu:textures/gui/buttonMedium.png",
        "posX" : -100,
        "posY" : 2,
        "width" : 98,
        "height" : 20,
                    "action" :
                    {
            "type" : "openLink",
                            "link" : "http://txcraftnetwork.tk/"
        }
    },

"texts":
{
    "mojangs":
    {
        "text" : "TxCraftNetwork is not affiliated with Mojang AB.",
        "posX" : 2,
        "posY" : -10,
        "color" : -1,
        "alignment" : "bottom_left"
    },

    "modpack":
    {
        "text" : "Welcome to the:",
        "posX" : -34,
        "posY" : 15,
        "color" : -1,
        "alignment" : "top_center"
    }
},

"other":
{

    "panorama":
    {
        "images" : "minecraft:textures/gui/title/background/panorama_%c.png",
        "blur" : true,
        "gradient" : true
    }
}

}

lumien231 commented 9 years ago

The official site button is not in the "buttons":{}

itsfolf commented 9 years ago

Now this giv me a error:

{ "images": { "title": { "image": "test:textures/minecrafters.png", "posX" : -137, "posY" : 30, "width" : 512, "height" : 512, "alignment" : "top_center" } },

"buttons":
{
    "singleplayer":
    {
        "text" : "Single Player Worlds",
        "posX" : -100,
        "posY" : 48,
        "width" : 200,
        "height" : 20
    },

    "multiplayerddd":
    {
        "text" : "Server List",
        "posX" : -100,
        "posY" : 72,
        "width" : 200,
        "height" : 20
    },

    "mods":
    {
        "text" : "Active Mods",
        "posX" : -100,
        "posY" : 96,
        "width" : 200,
        "height" : 20
    },

    "options":
    {
        "text" : "Options",
        "posX" : -100,
        "posY" : 132,
        "width" : 98,
        "height" : 20
    },

    "quit":
    {
        "text" : "Quit Game",
        "posX" : 2,
        "posY" : 132,
        "width" : 98,
        "height" : 20
    },

    "refresh":
    {
        "text" : "",
        "posX" : -154,
        "posY" : 132,
        "width" : 20,
        "height" : 20
    }

    "Official Site":
    {
        "text" : "Official Site",
        "alignment" : "top_right",
        "posX" : -100,
        "posY" : 2,
        "width" : 98,
        "height" : 20,
                    "action" :
                    {
            "type" : "openLink",
                            "link" : "http://txcraftnetwork.tk/"
        }
    },

"texts":
{
    "mojangs":
    {
        "text" : "TxCraftNetwork is not affiliated with Mojang AB.",
        "posX" : 2,
        "posY" : -10,
        "color" : -1,
        "alignment" : "bottom_left"
    },

    "modpack":
    {
        "text" : "Welcome to the:",
        "posX" : -34,
        "posY" : 15,
        "color" : -1,
        "alignment" : "top_center"
    }
},

"other":
{

    "panorama":
    {
        "images" : "minecraft:textures/gui/title/background/panorama_%c.png",
        "blur" : true,
        "gradient" : true
    }
}

}

lumien231 commented 9 years ago

You forgot the , after the "refresh":{}, you should put your file through a json checker before posting issues^^.

itsfolf commented 9 years ago

The error persists. Im try to use a json checker and it give me false error with working things.

itsfolf commented 9 years ago

Im try to coppy refresh button change name and coords, and the error presits, Im use a JSON validator and not have erros. What??

{ "images": { "title": { "image": "test:textures/minecrafters.png", "posX" : -137, "posY" : 30, "width" : 512, "height" : 512, "alignment" : "top_center" } },

"buttons":
{
    "singleplayer":
    {
        "text" : "Single Player Worlds",
        "posX" : -100,
        "posY" : 48,
        "width" : 200,
        "height" : 20
    },

    "multiplayerddd":
    {
        "text" : "Server List",
        "posX" : -100,
        "posY" : 72,
        "width" : 200,
        "height" : 20
    },

    "mods":
    {
        "text" : "Active Mods",
        "posX" : -100,
        "posY" : 96,
        "width" : 200,
        "height" : 20
    },

    "options":
    {
        "text" : "Options",
        "posX" : -100,
        "posY" : 132,
        "width" : 98,
        "height" : 20
    },

    "quit":
    {
        "text" : "Quit Game",
        "posX" : 2,
        "posY" : 132,
        "width" : 98,
        "height" : 20
    },

    "refresh":
    {
        "text" : "",
        "posX" : -154,
        "posY" : 132,
        "width" : 20,
        "height" : 20
    },

    "OfficialWebsite":
    {
        "text" : "",
        "posX" : -153,
        "posY" : 132,
        "width" : 30,
        "height" : 20
    }
},

"texts":
{
    "mojangs":
    {
        "text" : "TxCraftNetwork is not affiliated with Mojang AB.",
        "posX" : 2,
        "posY" : -10,
        "color" : -1,
        "alignment" : "bottom_left"
    },

    "modpack":
    {
        "text" : "Welcome to the:",
        "posX" : -34,
        "posY" : 15,
        "color" : -1,
        "alignment" : "top_center"
    }
},

"other":
{

    "panorama":
    {
        "images" : "minecraft:textures/gui/title/background/panorama_%c.png",
        "blur" : true,
        "gradient" : true
    },
}
itsfolf commented 9 years ago

What is the errrrrooor I'm going mad WTF

    "Official Website":
    {
        "text" : "Official Website",
        "posX" : -130,
        "posY" : 132,
        "width" : 30,
        "height" : 20
        "action" :
        {
            "type" : "joinServer",
                   "ip" : "mc.hypixel.net"                          
        }
    },
lumien231 commented 9 years ago

you are missing a comma after height o_O, you might wanna change your json checker.

itsfolf commented 9 years ago

Now correct, but this not join the server

itsfolf commented 9 years ago

Im change joinserver to connectToServer (not work) With openlnk not works too.

"Official Website": { "text" : "Official Website", "posX" : -130, "posY" : 132, "width" : 30, "height" : 20, "action" : { "type" : "openLink", "link" : "http://hypixel.net/"
} },

itsfolf commented 9 years ago

Solved this not is in action.

"openLink": { "text" : "Official Website", "posX" : -130, "posY" : 132, "width" : 30, "height" : 20, "link" : "http://hypixel.net/", (this work) But on the example the url go in action and works

lumien231 commented 9 years ago

Then you probably have an old cmm version where the action stuff wasn't implemented yet.

itsfolf commented 9 years ago

Im using 1.7.10 version because Im building a modpack, and 1.8 not have many mods

lumien231 commented 9 years ago

No i'm not talking about your minecraft version, what is your custom main menu version?

itsfolf commented 9 years ago

Im using 0.9 i do not know why. Updating....

itsfolf commented 9 years ago

Updated. Working.

itsfolf commented 9 years ago

Yu know how to fix the à color code bug?

lumien231 commented 9 years ago

Change the editor you use to save the file in ASCI.

itsfolf commented 9 years ago

Saving in ASCII the mod not works. Only saving in UTF-8 without BOM the mod works.

lumien231 commented 9 years ago

What error do you get when saving in ANSI? And you could also use the color property to change the color of text.

itsfolf commented 9 years ago

Ok, thx for the help :smiley: