Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
* Added HUD indication of no cartridges
* Fixed intro inbox messages
  • Loading branch information
hamstar0 committed Jun 2, 2018
1 parent a2a6ef5 commit 624960f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
17 changes: 17 additions & 0 deletions BetterPaintMod.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using BetterPaint.Items;
using BetterPaint.Painting;
using HamstarHelpers.DebugHelpers;
using HamstarHelpers.TmlHelpers;
using HamstarHelpers.Utilities.Config;
using HamstarHelpers.Utilities.Messages;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -63,6 +66,20 @@ public override void Load() {
BetterPaintMod.Instance = this;

this.LoadConfig();

TmlLoadHelpers.AddPostWorldLoadEachPromise( () => {
string intro1 = "1 of 5 - Eager to try out better painting? You'll need a Paint Blaster, crafted via Clentaminator, Flamethrower, and Paint Sprayer at a Tinkerer's Workshop.";
string intro2 = "2 of 5 - To make paint, you'll need a Paint Mixer, crafted via Dye Vat" + ( this.Config.PaintMixerRecipeBlendOMatic ? ", Blend-O-Matic, " : " " ) + "and Extractinator at a Tinkerer's Workshop.";
string intro3 = "3 of 5 - To paint, you'll need Color Cartridges, crafted via colored Paints (any " + this.Config.PaintRecipePaints + ") and Gel (" + this.Config.PaintRecipeGels + ") at a Paint Mixer.";
string post_intro = "4 of 5 - Use the Control Panel (single player only) to configure settings, including whether the Painter NPC should sell Better Paint items, if crafting isn't your cup of tea.";
string pander = "5 of 5 - If you enjoy this mod and want to see more, please give your support at: https://www.patreon.com/hamstar0";
InboxMessages.SetMessage( "BetterPaintIntro1", intro1, false );
InboxMessages.SetMessage( "BetterPaintIntro2", intro2, false );
InboxMessages.SetMessage( "BetterPaintIntro3", intro3, false );
InboxMessages.SetMessage( "BetterPaintPostIntro", post_intro, false );
InboxMessages.SetMessage( "BetterPaintPander", pander, false );
} );
}

private void LoadConfig() {
Expand Down
9 changes: 0 additions & 9 deletions BetterPaintPlayer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using BetterPaint.Items;
using BetterPaint.NetProtocols;
using HamstarHelpers.Utilities.Messages;
using HamstarHelpers.Utilities.Network;
using Terraria;
using Terraria.ModLoader;
Expand All @@ -18,14 +17,6 @@ public override void OnEnterWorld( Player player ) {
} else if( Main.netMode == 1 ) {
PacketProtocol.QuickRequestToServer<ModSettingsProtocol>();
}

string intro = "Eager to try out better painting? You'll need a Paint Blaster, crafted via Clentaminator, Flamethrower, and Paint Sprayer at a Tinkerer's Workshop. To make blaster paint, you'll need a Paint Mixer, crafted via Dye Vat" + ( mymod.Config.PaintMixerRecipeBlendOMatic ? ", Blend-O-Matic, " : " " ) + "and Extractinator at a Tinkerer's Workshop. To paint, you'll need Color Cartridges, crafted via colored Paints (any " + mymod.Config.PaintRecipePaints + ") and Gel (" + mymod.Config.PaintRecipeGels + ") at a Paint Mixer.";
string post_intro = "Use the Control Panel (single player only) to configure settings, including whether the Painter NPC should sell Better Paint items, if crafting isn't your cup of tea.";
string pander = "If you enjoy this mod and want to see more, please give your support at: https://www.patreon.com/hamstar0";

InboxMessages.SetMessage( "BetterPaintIntro", intro, false );
InboxMessages.SetMessage( "BetterPaintPostIntro", post_intro, false );
InboxMessages.SetMessage( "BetterPaintPander", pander, false );
}


Expand Down
11 changes: 9 additions & 2 deletions Items/PaintBlasterHUD/PaintBlasterHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,15 @@ public void DrawHUD( BetterPaintMod mymod, SpriteBatch sb, PaintBlasterItem mybl
if( Main.mouseY >= y && Main.mouseY < ( y + PaintBlasterHUD.AmmoCan.Height ) ) {
string percent_str = capacity_percent.ToString( "P", CultureInfo.InvariantCulture );

Utils.DrawBorderStringFourWay( sb, Main.fontMouseText, percent_str, Main.mouseX-40, Main.mouseY+20, Color.White, Color.Black, default(Vector2), 1f );
//sb.DrawString( Main.fontMouseText, percent_str, new Vector2(Main.mouseX, Main.mouseY), Color.White );
Utils.DrawBorderStringFourWay( sb, Main.fontMouseText, percent_str, Main.mouseX-40, Main.mouseY+16, Color.White, Color.Black, default(Vector2), 1f );
}
}
} else {
if( Main.mouseX >= x && Main.mouseX < ( x + PaintBlasterHUD.AmmoCan.Width ) ) {
if( Main.mouseY >= y && Main.mouseY < ( y + PaintBlasterHUD.AmmoCan.Height ) ) {
string str = "Color Cartridge needed";

Utils.DrawBorderStringFourWay( sb, Main.fontMouseText, str, Main.mouseX - 160, Main.mouseY + 16, Color.White, Color.Black, default( Vector2 ), 1f );
}
}
}
Expand Down
1 change: 0 additions & 1 deletion Items/PaintBlasterUI/PaintBlasterUI_Draw.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using HamstarHelpers.HudHelpers;
using HamstarHelpers.PlayerHelpers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
Expand Down
3 changes: 0 additions & 3 deletions Items/PaintBlasterUI/PaintBlasterUI_DrawBrushes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
using HamstarHelpers.Utilities.AnimatedColor;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Graphics;
using System;
using Terraria;
using Terraria.ID;


namespace BetterPaint.Items {
Expand Down

0 comments on commit 624960f

Please sign in to comment.