This is a new API I developed today for another project (the "Aether II" mod). Although this was originally intended as a method to implement my Aether main menu into the game without editing base classes, it quickly turned into a project of its own to allow other mods to have their own Main Menu, because I wanted to allow other modders in the community to also make their own without any conflicts.
FEATURES:
Allows other mods to create their own Main Menu without editing any base classes.
Allows modders to maintain compatibility with other mods while also having their own unique Main Menu.
Gives the user the freedom to manage and choose which Main Menu they want for their game, without any hassles of choosing a "Final" option.
Has an in-built Jukebox system with a music player. This allows users to play whichever song they like, even their own custom songs!
Modders can choose a specific menu theme song to use for their Main Menu.
Edits no base classes!
The best thing about this API is that it edits no base classes whatsoever, but it does require the Forge API in order to use it. However, since Forge is pretty much standard as of late, I think this is a fair design choice.
HOW IT WORKS:
The screen shown above launches the first time the user starts the game with the API installed.
When a Main Menu is chosen, the choice is saved to a properties file, which on next start up would automatically launch the mod into that chosen Main Menu.
All Main Menus created with this API has a mandatory "Menu List" button (which cannot be overridden) that the user can click on to go back to the above screen and choose a different menu.
The "Menu List" button has configurable positioning for Main Menu creators.
Each menu also has the option to enable a Jukebox button, to easily play music.
I have included three default menu types, including "Minecraft", "Left Minecraft" and "Aether I":
DOWNLOAD
Here is where you can download the API. The Main Menu API requires Forge for 1.5.1, and the API itself is currently only available for Minecraft 1.5.1.
UPDATE - V1.1:
- Fixed a crash that occurred in the menu when your sound was turned off. Crucial update.
In order to install this API, first install Forge into your Minecraft game. Follow the instructions on the Forge thread on how to install Forge.
Once Forge is installed, installing the API is as simple as going into your .minecraft/mods/ folder, and dragging and dropping the "MainMenuAPIv1.0_Beta_MC1.5.1.zip" file you downloaded into it.
Start up your game and you should be greeted with a menu list!
FOR MODDERS USING SRC
After you have decompiled and installed Forge into your MCP workspace, add the files within the "Main Menu API - SRC MC 1.5.1.rar" file into your "MCP/src/minecraft/" folder.
FOR MODDERS:
For those who are interested in making their own menu for their mod, here is a guideline you can use to go ahead with creating one:
The structure of the mod works with "Menu Bases". These Menu Bases allow you to utilize the compatibility and functionality of the API. The Menu Base of your mod is what will act as your Main Menu.
To create your own menu, simply create a class the extends the API's "MenuBase" class. In many aspects, the MenuBase class acts like any other GuiScreen class, so if you know anything about how to create GUIs, this should be a fairly easy transition for you.
There are a variety of methods you can override within your Menu Base. Some important ones you might want to consider are:
getName() - This method specifies the name of the Menu Base, and will be displayed in the Menu list at the start of the game. Override this method and return the name of the Menu Base.
getVersion() - This method gives your Menu Base a "version number". This is displayed underneath the menu's name, but it can be other things other than a version number.
getIconPath() - This method specifies the location of your icon image file for display in the menu list.
getJukeboxBackgroundPath() - This method specifies the location of your background image file for rendering the background of the jukebox area.
useJukebox() - This method specifies whether or not your Menu Base enables the Jukebox system/button.
getMusicFileName() - If you would like to specify a specific song for your menu, you can override this method with the name of the song (file extension not needed). If you would like to add your own custom song, place it in /resources/streaming/.
getJukeboxButtonX()/getJukeboxButtonY() - These methods specify the location of the Jukebox button.
getListButtonX()/getListButtonY() - These methods specify the location of the Menu List button.
Please remember when creating your Menu Base to ALWAYS use super for methods such as initGui(), onGuiClosed(), mouseClicked(), drawScreen(), etc. These carry crucial code structures that enable features such as the Jukebox and Menu List. Without using super.initGui() etc etc, your Menu Base may break.
Once you have created your Menu Base and it looks nice and neat, the next thing you must do is register it in your mod class file, perhaps in your load() method. In order to register a menu base, here's an example:
Use that line, except replace "Minecraft" with the name of your Menu Base, and "MenuBaseMinecraft.class" with the class of your Menu Base.
Once this is done, you can start up the game and check out your Menu in the menu list!
Here is a quick example of the layout of a Menu Base:
package net.aetherteam.mainmenu_api;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiButtonLanguage;
import net.minecraft.client.gui.GuiConfirmOpenLink;
import net.minecraft.client.gui.GuiLanguage;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiOptions;
import net.minecraft.client.gui.GuiScreenOnlineServers;
import net.minecraft.client.gui.GuiSelectWorld;
import net.minecraft.client.gui.GuiYesNo;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.util.StringTranslate;
import net.minecraft.world.demo.DemoWorldServer;
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.WorldInfo;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.glu.GLU;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import cpw.mods.fml.client.GuiModList;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class MenuBaseExample extends MenuBase
{
public void initGui()
{
super.initGui(); // REMEMBER TO USE SUPER
// ADD BUTTONS HERE
//
// Example: buttonList.add(new GuiButton(0, 50, 50, 80, 20, "Make A Menu Base");
}
protected void actionPerformed(GuiButton par1GuiButton)
{
// EXECUTE CODE BASED ON BUTTON ID
if (par1GuiButton.id == 0)
{
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
}
}
public void drawScreen(int par1, int par2, float par3)
{
// ADD YOUR RENDERING CODE HERE
super.drawScreen(par1, par2, par3); // REMEMBER TO USE SUPER
}
public int getListButtonX()
{
return width - 110;
}
public int getListButtonY()
{
return 4;
}
public int getJukeboxButtonX()
{
return width - 24;
}
public int getJukeboxButtonY()
{
return 4;
}
public String getName()
{
return "Example Menu";
}
public String getVersion()
{
return "1.0.0";
}
public String getMusicFileName()
{
return "Strad";
}
public String getIconPath()
{
return "/net/aetherteam/mainmenu_api/icons/minecraft.png";
}
}
Other than that, if you are having any troubles you can look in some of the other Menu Bases provided in the API, such as MenuBaseMinecraft, MenuBaseLeftMinecraft, and MenuBaseAether. They should give you a vague idea of how to make your own Menu Base.
API USAGE FOR MODDERS
Modders are allowed to pre-package this API with their mod, but if you would like to support the API's development, you are free to send your users to download the API at this page instead of pre-packaging it. The decision is up to you! Whether you pre-package the API or not, please include a link to this thread when using this API!
Nice job, I'm glad to see that it's finished! Also, about the Aether I menu: Is this just a menu inspired by the Aether's menu, or does this come with the Aether I installed?
i am sondrex but you can call me sondrex76 if somebody know a forum admin can you tell me i realy want to talk with them about why i got banned for no reason at all.
Server Owner, Minecraft Expert.
You can join my server @ emnet.mcpro.co
You can find my website @ em-s.enjin.com
You can find a great host @ mcprohosting.com
- MC 1.5.1 -
Hey guys!
This is a new API I developed today for another project (the "Aether II" mod). Although this was originally intended as a method to implement my Aether main menu into the game without editing base classes, it quickly turned into a project of its own to allow other mods to have their own Main Menu, because I wanted to allow other modders in the community to also make their own without any conflicts.
FEATURES:
The best thing about this API is that it edits no base classes whatsoever, but it does require the Forge API in order to use it. However, since Forge is pretty much standard as of late, I think this is a fair design choice.
I have included three default menu types, including "Minecraft", "Left Minecraft" and "Aether I":
DOWNLOAD
Here is where you can download the API. The Main Menu API requires Forge for 1.5.1, and the API itself is currently only available for Minecraft 1.5.1.
UPDATE - V1.1:
- Fixed a crash that occurred in the menu when your sound was turned off. Crucial update.
Forge API Download
Main Menu API v1.1 - SRC * - ( Alternate Download Link )
INSTALLATION INSTRUCTIONS
For those who are interested in making their own menu for their mod, here is a guideline you can use to go ahead with creating one:
Other than that, if you are having any troubles you can look in some of the other Menu Bases provided in the API, such as MenuBaseMinecraft, MenuBaseLeftMinecraft, and MenuBaseAether. They should give you a vague idea of how to make your own Menu Base.
API USAGE FOR MODDERS
Modders are allowed to pre-package this API with their mod, but if you would like to support the API's development, you are free to send your users to download the API at this page instead of pre-packaging it. The decision is up to you! Whether you pre-package the API or not, please include a link to this thread when using this API!
~ Kingbdogz ~
...but that's just like, my opinion, man.
Great job on this API! I'm sure it will be useful for many people/modders.
Website: http://lightningpig333.com
Woah woah!
You've waited a week for the main menu change... ?
Anyway, lookin' sexy. I haven't updated to 1.5.1 though, still waiting on other mods.
(And now that this is done, hopefully the main event will some soon after!)
You can join my server @ emnet.mcpro.co
You can find my website @ em-s.enjin.com
You can find a great host @ mcprohosting.com
Download My New Mod HERE:
http://www.minecraftforum.net/topic/2099817-wip-164-forge-mcreator-gun-battle-mod/