Spell HUD rewrite and retexturing:

- Replaces the old hardcoded drawing methods with a new json-based system with support for multiple inbuilt and resource pack-defined skins.
- Adds a config option for choosing the spell HUD skin, along with a custom config GUI screen allowing the user to select from a list of available skins with a preview of the currently selected skin.
- Replaces the HUD texture file with a spell_hud subfolder, containing all the necessary textures and json files for the 12 inbuilt skins.
- Adds a subtle sound effect and scroling animation when switching spells
- Reorganises the control event code into a single handler class and converts this class and the spell HUD class to static event handlers.
- Fixes the HUD position option which got broken in the previous spell HUD commit
This commit is contained in:
Electroblob
2018-07-02 22:33:09 +01:00
parent b7cd3db8bc
commit af01beb583
42 changed files with 1393 additions and 223 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,50 @@
{
"default": {
"texture": "ebwizardry:gui/spell_hud/default",
"metadata": "ebwizardry:gui/spell_hud/default"
},
"classic": {
"texture": "ebwizardry:gui/spell_hud/classic",
"metadata": "ebwizardry:gui/spell_hud/classic"
},
"vanilla_style": {
"texture": "ebwizardry:gui/spell_hud/vanilla_style",
"metadata": "ebwizardry:gui/spell_hud/vanilla_style"
},
"redwood": {
"texture": "ebwizardry:gui/spell_hud/redwood",
"metadata": "ebwizardry:gui/spell_hud/redwood"
},
"silverwood": {
"texture": "ebwizardry:gui/spell_hud/silverwood",
"metadata": "ebwizardry:gui/spell_hud/silverwood"
},
"stone": {
"texture": "ebwizardry:gui/spell_hud/stone",
"metadata": "ebwizardry:gui/spell_hud/stone"
},
"sandstone": {
"texture": "ebwizardry:gui/spell_hud/sandstone",
"metadata": "ebwizardry:gui/spell_hud/sandstone"
},
"jungle": {
"texture": "ebwizardry:gui/spell_hud/jungle",
"metadata": "ebwizardry:gui/spell_hud/jungle"
},
"spell_book": {
"texture": "ebwizardry:gui/spell_hud/spell_book",
"metadata": "ebwizardry:gui/spell_hud/spell_book"
},
"minimal": {
"texture": "ebwizardry:gui/spell_hud/minimal",
"metadata": "ebwizardry:gui/spell_hud/minimal"
},
"no_icon": {
"texture": "ebwizardry:gui/spell_hud/no_icon",
"metadata": "ebwizardry:gui/spell_hud/no_icon"
},
"skyrim_style": {
"texture": "ebwizardry:gui/spell_hud/skyrim_style",
"metadata": "ebwizardry:gui/spell_hud/skyrim_style"
}
}
@@ -0,0 +1,33 @@
{
"name": "Classic",
"description": "The original spell HUD, for that nostalgic feel!",
"width": 128,
"height": 36,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 17
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 42,
"y": 0,
"length": 82,
"height": 6,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

@@ -0,0 +1,33 @@
{
"name": "Default",
"description": "The default, oak wood look of the spell HUD.",
"width": 128,
"height": 50,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 18
},
"spell_cascade_offset": {
"x": 2,
"y": 8
},
"cooldown_bar": {
"x": 42,
"y": 2,
"length": 79,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,33 @@
{
"name": "Jungle",
"description": "For the most intrepid explorers!",
"width": 128,
"height": 37,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 18
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 41,
"y": 2,
"length": 82,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@@ -0,0 +1,33 @@
{
"name": "Minimal",
"description": "A modern, sleek, minimalist look.",
"width": 128,
"height": 36,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 39,
"y": 16
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 36,
"y": 1,
"length": 86,
"height": 2,
"mirror": {
"x": true,
"y": true
},
"show_when_full": false
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@@ -0,0 +1,33 @@
{
"name": "No Icon",
"description": "A variation on the default skin that doesn't show the spell icon.",
"width": 96,
"height": 37,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": -999,
"y": -999
},
"text_inset": {
"x": 10,
"y": 18
},
"spell_cascade_offset": {
"x": 2,
"y": 8
},
"cooldown_bar": {
"x": 10,
"y": 2,
"length": 79,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,33 @@
{
"name": "Redwood",
"description": "A variation on the default skin with red-coloured wood and a purple-pink cooldown bar.",
"width": 128,
"height": 50,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 18
},
"spell_cascade_offset": {
"x": 2,
"y": 8
},
"cooldown_bar": {
"x": 42,
"y": 2,
"length": 79,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

@@ -0,0 +1,33 @@
{
"name": "Sandstone",
"description": "Explore ancient ruins with this desert-themed skin!",
"width": 128,
"height": 37,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 18
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 41,
"y": 2,
"length": 82,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@@ -0,0 +1,33 @@
{
"name": "Silverwood",
"description": "A variation on the default skin with silver-coloured wood and a blue cooldown bar.",
"width": 128,
"height": 50,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 18
},
"spell_cascade_offset": {
"x": 2,
"y": 8
},
"cooldown_bar": {
"x": 42,
"y": 2,
"length": 79,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

@@ -0,0 +1,33 @@
{
"name": "Skyrim-style",
"description": "A HUD skin in the styling of The Elder Scrolls V, for that Skyrim feel!",
"width": 128,
"height": 38,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 3,
"y": 3
},
"text_inset": {
"x": 42,
"y": 19
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 44,
"y": 2,
"length": 79,
"height": 3,
"mirror": {
"x": true,
"y": false
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,33 @@
{
"name": "Spell book",
"description": "Knowledge is power, or so they say.",
"width": 128,
"height": 38,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 41,
"y": 20
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 41,
"y": 3,
"length": 79,
"height": 3,
"mirror": {
"x": true,
"y": true
},
"show_when_full": false
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@@ -0,0 +1,33 @@
{
"name": "Stone",
"description": "A HUD skin hewn from solid rock, with a red cooldown bar.",
"width": 128,
"height": 37,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 42,
"y": 18
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 41,
"y": 2,
"length": 82,
"height": 3,
"mirror": {
"x": false,
"y": true
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

@@ -0,0 +1,33 @@
{
"name": "Vanilla-style",
"description": "A vanilla Minecraft-styled skin, for the purists out there.",
"width": 128,
"height": 36,
"mirror": {
"x": true,
"y": true
},
"spell_icon_inset": {
"x": 2,
"y": 2
},
"text_inset": {
"x": 40,
"y": 18
},
"spell_cascade_offset": {
"x": 0,
"y": 8
},
"cooldown_bar": {
"x": 40,
"y": 0,
"length": 81,
"height": 5,
"mirror": {
"x": false,
"y": false
},
"show_when_full": true
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB