Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to sub forum page

General forum

Non-course related subjects

4. Mod discussion

Show more info with shift

  • 2013-08-17 19:33:02
    I noticed quite a lot of mods have additional info in their item tooltips if you press shift.

    I came up with a solution but I am not sure if this is "good practice" since I have to fiddle directly with lwjgl
    (obviously you would have to load the keycode from some config file)

    [code]
    // in Item.addInformation()

    if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
                info.add("SHIFT!");
            }
    [/code]

    Any thoughts on that are appreciated.
  • 2013-08-17 19:40:03
    Well, you could use GuiScreen.isShiftKeyDown() if you want. In the end that simply checks if either the left or the right shift is down. The content of the method isShiftKeyDown is the following:

    return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54);
  • 2013-08-18 06:27:27
    I'll just ask here instead of making new thread:
    How do you add colored text to the tooltip?
  • 2013-08-18 08:27:38
    Just add the colorcode in front of the text,
    e.g. \u00a70 would produce black
    see Climbing the interface ladder, Lecture 4: Advanced Interfaces for all colorcodes.
  • 2013-08-18 09:04:53
    Thanks. Funny thing is i tried that before and it didn't work. I guess i must've write it wrong.
  • 2013-08-21 03:56:08
    I haven't watched Climbing the Interface Ladder yet, but couldn't you use the § that Minecraft uses for color and font ?
    (i.e. §6 would tell the Client to switch to gold colored font, and §n means underline)
  • 2013-08-21 07:52:43
    oh yeah, it actually worked :D its kind of useful when you want to add font styles like underline to it.
  • 2013-08-21 10:28:30
    \u00a7 is the unicode for §
  • 2013-08-21 14:01:07
    Well that makes sense
  • 2013-11-05 22:31:43
    I just noticed that I don't get Email notifications if somebody replies to a thread..

    Thanky you!
    Sorry for the late answer Vswe :(
  • Log in or sign up to reply to this thread