Skip to content

Commit

Permalink
Made GUI clearer on no launcher (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee authored Dec 22, 2023
1 parent a1591f3 commit 72cb6a1
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- An item collection screen will now be shown, when the user starts with random items.
- When softlock prevention is active, then the first two crumble blocks in Super Missile Chamber will be shoot blocks instead.
- Clearer GUI symbols, when expansions have been collected, but not their corresponding launcher.

### Changed
- When softlock prevention is active, then in the EMP Escape route room, instead of the bottom row of speedbooster blocks being gone, now every pillar but the leftmost one is gone.
Expand Down
82 changes: 78 additions & 4 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,15 @@ void AddAllSpritesFromDir(string dirPath)
{ Name = gmData.Strings.MakeString("tlWarpWaterfall"), Texture = gmData.TexturePageItems[nameToPageItemDict["tlWarpWaterfall"]] });


gmData.Sprites.ByName("sGUIMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIMissile"]] });
gmData.Sprites.ByName("sGUISMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUISMissile"]] });
gmData.Sprites.ByName("sGUIPBomb").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIPBomb"]] });
gmData.Sprites.ByName("sGUIMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIMissileSelected"]] });
gmData.Sprites.ByName("sGUISMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUISMissileSelected"]] });
gmData.Sprites.ByName("sGUIPBomb").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIPBombSelected"]] });
gmData.Sprites.ByName("sGUIMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIMissileNormal"]] });
gmData.Sprites.ByName("sGUISMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUISMissileNormal"]] });
gmData.Sprites.ByName("sGUIPBomb").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIPBombNormal"]] });
gmData.Sprites.ByName("sGUIMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIMissileNormalGreen"]] });
gmData.Sprites.ByName("sGUISMissile").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUISMissileNormalGreen"]] });
gmData.Sprites.ByName("sGUIPBomb").Textures.Add(new UndertaleSprite.TextureEntry { Texture = gmData.TexturePageItems[nameToPageItemDict["sGUIPBombNormalGreen"]] });

// Replace existing door sprites
gmData.Sprites.ByName("sDoorA5Locks").Textures[0].Texture = gmData.TexturePageItems[nameToPageItemDict["sDoorBlue"]];
Expand Down Expand Up @@ -1317,8 +1323,29 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
UndertaleCode? chStepFireCode = gmData.Code.ByName("gml_Script_chStepFire");
chStepFireCode.ReplaceGMLInCode("&& global.pbombs > 0", "&& global.pbombs > 0 && global.PBombLauncher");

// Change GUI For toggle, use a red item sprite instead of green, for hold use a red instead of yellow
// Change GUI For toggle, use a red item sprite instead of green, for hold use a red instead of yellow. For not selected, use a crossed out one.
// Replace Missile GUI
drawGuiCode.ReplaceGMLInCode(
"""
if (global.currentweapon != 1 || oCharacter.state == 23 || oCharacter.state == 24 || oCharacter.state == 27 || oCharacter.state == 54 || oCharacter.state == 55 || oCharacter.sjball)
draw_sprite(sGUIMissile, 0, ((0 + xoff) + 1), 4)
""",
"""
if (((global.currentweapon != 1 || oCharacter.state == 23 || oCharacter.state == 24 || oCharacter.state == 27 || oCharacter.state == 54 || oCharacter.state == 55 || oCharacter.sjball) && (!global.missileLauncher)))
draw_sprite(sGUIMissile, 4, ((0 + xoff) + 1), 4)
else if (((global.currentweapon != 1 || oCharacter.state == 23 || oCharacter.state == 24 || oCharacter.state == 27 || oCharacter.state == 54 || oCharacter.state == 55 || oCharacter.sjball) && (global.missileLauncher)))
draw_sprite(sGUIMissile, 0, ((0 + xoff) + 1), 4)
""");
drawGuiCode.ReplaceGMLInCode("""
if (oCharacter.armmsl == 0)
draw_sprite(sGUIMissile, 1, ((0 + xoff) + 1), 4)
""", """
if (oCharacter.armmsl == 0 && global.missileLauncher)
draw_sprite(sGUIMissile, 1, ((0 + xoff) + 1), 4)
else if (oCharacter.armmsl == 0 && !global.missileLauncher)
draw_sprite(sGUIMissile, 5, ((0 + xoff) + 1), 4)
""");
drawGuiCode.ReplaceGMLInCode("""
if (oCharacter.armmsl == 1)
draw_sprite(sGUIMissile, 2, ((0 + xoff) + 1), 4)
Expand All @@ -1336,9 +1363,32 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
draw_sprite(sGUIMissile, 1, ((0 + xoff) + 1), 4)
else if (global.currentweapon == 1 && !global.missileLauncher)
draw_sprite(sGUIMissile, 3, ((0 + xoff) + 1), 4)
else if (global.currentweapon != 1 && !global.missileLauncher)
draw_sprite(sGUIMissile, 4, ((0 + xoff) + 1), 4)
""");

// Replace Super GUI
drawGuiCode.ReplaceGMLInCode(
"""
if (global.currentweapon != 2 || oCharacter.state == 23 || oCharacter.state == 24 || oCharacter.state == 27 || oCharacter.state == 54 || oCharacter.state == 55 || oCharacter.sjball)
draw_sprite(sGUISMissile, 0, (xoff + 1), 4)
""",
"""
if ((global.currentweapon != 2 || oCharacter.state == 23 || oCharacter.state == 24 || oCharacter.state == 27 || oCharacter.state == 54 || oCharacter.state == 55 || oCharacter.sjball) && !global.SMissileLauncher)
draw_sprite(sGUISMissile, 4, (xoff + 1), 4)
else if ((global.currentweapon != 2 || oCharacter.state == 23 || oCharacter.state == 24 || oCharacter.state == 27 || oCharacter.state == 54 || oCharacter.state == 55 || oCharacter.sjball) && global.SMissileLauncher)
draw_sprite(sGUISMissile, 0, (xoff + 1), 4)
""");
drawGuiCode.ReplaceGMLInCode("""
if (oCharacter.armmsl == 0)
draw_sprite(sGUISMissile, 1, (xoff + 1), 4)
""", """
if (oCharacter.armmsl == 0 && global.SMissileLauncher)
draw_sprite(sGUISMissile, 1, (xoff + 1), 4)
else if (oCharacter.armmsl == 0 && !global.SMissileLauncher)
draw_sprite(sGUISMissile, 5, (xoff + 1), 4)
""");
drawGuiCode.ReplaceGMLInCode("""
if (oCharacter.armmsl == 1)
draw_sprite(sGUISMissile, 2, (xoff + 1), 4)
Expand All @@ -1356,9 +1406,31 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
draw_sprite(sGUISMissile, 1, (xoff + 1), 4)
else if (global.currentweapon == 2 && !global.SMissileLauncher)
draw_sprite(sGUISMissile, 3, (xoff + 1), 4)
else if (global.currentweapon != 2 && !global.SMissileLauncher)
draw_sprite(sGUISMissile, 4, (xoff + 1), 4)
""");

// Replace PB GUI
drawGuiCode.ReplaceGMLInCode(
"""
if (oCharacter.state != 23 && oCharacter.state != 24 && oCharacter.state != 27 && oCharacter.state != 54 && oCharacter.state != 55 && oCharacter.sjball == 0)
draw_sprite(sGUIPBomb, 0, (xoff + 1), 4)
""",
"""
if ((global.PBombLauncher) && oCharacter.state != 23 && oCharacter.state != 24 && oCharacter.state != 27 && oCharacter.state != 54 && oCharacter.state != 55 && oCharacter.sjball == 0)
draw_sprite(sGUIPBomb, 0, (xoff + 1), 4)
else if ((!global.PBombLauncher) && oCharacter.state != 23 && oCharacter.state != 24 && oCharacter.state != 27 && oCharacter.state != 54 && oCharacter.state != 55 && oCharacter.sjball == 0)
draw_sprite(sGUIPBomb, 4, (xoff + 1), 4)
""");
drawGuiCode.ReplaceGMLInCode("""
if (oCharacter.armmsl == 0)
draw_sprite(sGUIPBomb, 1, (xoff + 1), 4)
""", """
if (oCharacter.armmsl == 0 && global.PBombLauncher)
draw_sprite(sGUIPBomb, 1, (xoff + 1), 4)
else if (oCharacter.armmsl == 0 && !global.PBombLauncher)
draw_sprite(sGUIPBomb, 5, (xoff + 1), 4)
""");
drawGuiCode.ReplaceGMLInCode("""
if (oCharacter.armmsl == 1)
draw_sprite(sGUIPBomb, 2, (xoff + 1), 4)
Expand All @@ -1376,6 +1448,8 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
draw_sprite(sGUIPBomb, 1, (xoff + 1), 4)
else if (global.currentweapon == 3 && !global.PBombLauncher)
draw_sprite(sGUIPBomb, 3, (xoff + 1), 4)
else if (global.currentweapon != 3 && !global.PBombLauncher)
draw_sprite(sGUIPBomb, 4, (xoff + 1), 4)
""");

// Fix weapon selection with toggle
Expand Down
3 changes: 2 additions & 1 deletion YAMS-LIB/sprites/Attribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ the `LICENSE-GRAPHICS` file for the full license details.
Authors are as follows:

- Everything in the `doors` folder was made by [AbyssalCreature](https://github.com/AbyssalCreature)
- Everything in the `misc` folder was made by [AbyssalCreature](https://github.com/AbyssalCreature)
- Everything in the `misc` folder, with the exception of the `hud` subfolder, was made by [AbyssalCreature](https://github.com/AbyssalCreature)
- The `hud` subfolder in the `misc` folder was made by [Miepee](https://github.com/Miepee).
- The DNA, Nothing, Power Bomb Launcher, Shiny Screw Attack, Shiny Hi-Jump, Shiny Ice beam, Shiny Missile, Super Missile
Launcher and Unknown
sprites (`items/dna`, `items/nothing`, `items/pbLauncher`, `items/screwAttackShiny`, `items/shinyHijump`, `items/shinyIcebeam`, `items/shinyMissile`, `items/superMissileLauncher`
Expand Down
Binary file added YAMS-LIB/sprites/misc/hud/sGUIMissileNormal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added YAMS-LIB/sprites/misc/hud/sGUIMissileNormalGreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added YAMS-LIB/sprites/misc/hud/sGUIPBombNormal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added YAMS-LIB/sprites/misc/hud/sGUIPBombNormalGreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added YAMS-LIB/sprites/misc/hud/sGUISMissileNormal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit 72cb6a1

Please sign in to comment.