Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

Commit

Permalink
Added option to disable tooltips, fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Ionaru committed Aug 18, 2017
1 parent d1c7507 commit 0c72f11
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 72 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "1.7.10 - 1.1"
version = "1.7.10 - 1.2"
group= "com.ionaru.currency"
archivesBaseName = "currency"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL;

class ConfigurationLoader {
public class ConfigurationLoader {

private static Configuration config = null;
static boolean enableAllRecipes;
public static boolean enableAllRecipes;
public static boolean enableToolTips;

ConfigurationLoader(FMLPreInitializationEvent event) {
config = new Configuration(event.getSuggestedConfigurationFile());
Expand All @@ -23,6 +24,11 @@ private void syncConfig() {
"true", // Default value
"Whether recipes are enabled, default: true" // Comment
).getBoolean();
enableToolTips = config.get(CATEGORY_GENERAL, // Category
"enableAllTooltips", // Property name
"true", // Default value
"Whether tooltips are enabled, default: true" // Comment
).getBoolean();
} catch (Exception e) {
// Failed reading/writing, just continue
} finally {
Expand Down
142 changes: 73 additions & 69 deletions src/main/java/com/ionaru/currency/item/Money.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.ionaru.currency.item;

import java.util.List;

import com.ionaru.currency.common.ConfigurationLoader;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
Expand All @@ -26,75 +28,77 @@ public void registerIcons(IIconRegister iconRegister) {
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack,
EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if (par1ItemStack.getItem() == Currency.Penny) {
par3List.add("0.01 Credits");
} else if (par1ItemStack.getItem() == Currency.DoublePenny) {
par3List.add("0.02 Credits");
} else if (par1ItemStack.getItem() == Currency.Nickel) {
par3List.add("0.05 Credits");
} else if (par1ItemStack.getItem() == Currency.Dime) {
par3List.add("0.10 Credits");
} else if (par1ItemStack.getItem() == Currency.Quarter) {
par3List.add("0.25 Credits");
} else if (par1ItemStack.getItem() == Currency.HalfCredit) {
par3List.add("0.50 Credits");
} else if (par1ItemStack.getItem() == Currency.Credit) {
par3List.add("1 Credit");
} else if (par1ItemStack.getItem() == Currency.DoubleCredit) {
par3List.add("2 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill5) {
par3List.add("5 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill10) {
par3List.add("10 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill25) {
par3List.add("25 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill50) {
par3List.add("50 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill100) {
par3List.add("100 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill200) {
par3List.add("200 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill500) {
par3List.add("500 Credits");
} else if (par1ItemStack.getItem() == Currency.IronCard) {
par3List.add("1.000 Credits");
par3List.add("(One Thousand)");
} else if (par1ItemStack.getItem() == Currency.SteelCard) {
par3List.add("5.000 Credits");
par3List.add("(5 Thousand)");
} else if (par1ItemStack.getItem() == Currency.BronzeCard) {
par3List.add("10.000 Credits");
par3List.add("(10 Thousand)");
} else if (par1ItemStack.getItem() == Currency.SilverCard) {
par3List.add("50.000 Credits");
par3List.add("(50 Thousand)");
} else if (par1ItemStack.getItem() == Currency.GoldCard) {
par3List.add("100.000 Credits");
par3List.add("(100 Thousand)");
} else if (par1ItemStack.getItem() == Currency.PlatinumCard) {
par3List.add("500.000 Credits");
par3List.add("(500 Thousand)");
} else if (par1ItemStack.getItem() == Currency.DiamondCard) {
par3List.add("1.000.000 Credits");
par3List.add("(One Million)");
} else if (par1ItemStack.getItem() == Currency.OsmiumCard) {
par3List.add("5.000.000 Credits");
par3List.add("(5 Million)");
} else if (par1ItemStack.getItem() == Currency.TungstenCard) {
par3List.add("10.000.000 Credits");
par3List.add("(10 Million)");
} else if (par1ItemStack.getItem() == Currency.MithrilCard) {
par3List.add("50.000.000 Credits");
par3List.add("(50 Million)");
} else if (par1ItemStack.getItem() == Currency.AdamantiumCard) {
par3List.add("100.000.000 Credits");
par3List.add("(100 Million)");
} else if (par1ItemStack.getItem() == Currency.TartariteCard) {
par3List.add("500.000.000 Credits");
par3List.add("(500 Million)");
} else if (par1ItemStack.getItem() == Currency.IridiumCard) {
par3List.add("1.000.000.000 Credits");
par3List.add("(One Billion)");
if (ConfigurationLoader.enableToolTips) {
if (par1ItemStack.getItem() == Currency.Penny) {
par3List.add("0.01 Credits");
} else if (par1ItemStack.getItem() == Currency.DoublePenny) {
par3List.add("0.02 Credits");
} else if (par1ItemStack.getItem() == Currency.Nickel) {
par3List.add("0.05 Credits");
} else if (par1ItemStack.getItem() == Currency.Dime) {
par3List.add("0.10 Credits");
} else if (par1ItemStack.getItem() == Currency.Quarter) {
par3List.add("0.25 Credits");
} else if (par1ItemStack.getItem() == Currency.HalfCredit) {
par3List.add("0.50 Credits");
} else if (par1ItemStack.getItem() == Currency.Credit) {
par3List.add("1 Credit");
} else if (par1ItemStack.getItem() == Currency.DoubleCredit) {
par3List.add("2 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill5) {
par3List.add("5 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill10) {
par3List.add("10 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill25) {
par3List.add("25 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill50) {
par3List.add("50 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill100) {
par3List.add("100 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill200) {
par3List.add("200 Credits");
} else if (par1ItemStack.getItem() == Currency.CreditBill500) {
par3List.add("500 Credits");
} else if (par1ItemStack.getItem() == Currency.IronCard) {
par3List.add("1.000 Credits");
par3List.add("(One Thousand)");
} else if (par1ItemStack.getItem() == Currency.SteelCard) {
par3List.add("5.000 Credits");
par3List.add("(5 Thousand)");
} else if (par1ItemStack.getItem() == Currency.BronzeCard) {
par3List.add("10.000 Credits");
par3List.add("(10 Thousand)");
} else if (par1ItemStack.getItem() == Currency.SilverCard) {
par3List.add("50.000 Credits");
par3List.add("(50 Thousand)");
} else if (par1ItemStack.getItem() == Currency.GoldCard) {
par3List.add("100.000 Credits");
par3List.add("(100 Thousand)");
} else if (par1ItemStack.getItem() == Currency.PlatinumCard) {
par3List.add("500.000 Credits");
par3List.add("(500 Thousand)");
} else if (par1ItemStack.getItem() == Currency.DiamondCard) {
par3List.add("1.000.000 Credits");
par3List.add("(One Million)");
} else if (par1ItemStack.getItem() == Currency.OsmiumCard) {
par3List.add("5.000.000 Credits");
par3List.add("(5 Million)");
} else if (par1ItemStack.getItem() == Currency.TungstenCard) {
par3List.add("10.000.000 Credits");
par3List.add("(10 Million)");
} else if (par1ItemStack.getItem() == Currency.MithrilCard) {
par3List.add("50.000.000 Credits");
par3List.add("(50 Million)");
} else if (par1ItemStack.getItem() == Currency.AdamantiumCard) {
par3List.add("100.000.000 Credits");
par3List.add("(100 Million)");
} else if (par1ItemStack.getItem() == Currency.TartariteCard) {
par3List.add("500.000.000 Credits");
par3List.add("(500 Million)");
} else if (par1ItemStack.getItem() == Currency.IridiumCard) {
par3List.add("1.000.000.000 Credits");
par3List.add("(One Billion)");
}
}
}
}

0 comments on commit 0c72f11

Please sign in to comment.