In this build...
- Health and mana regeneration fixed.
- You can now flood Hell again.
- Minimaps act nicer near the edges of maps.
Give it a whirl.
After installing, it appears in your Start Menu under Michael Russell > RomTerraria.
July 13, 2011
July 8, 2011
Test Version of RomTerraria 2.0
Because it's such a pain in the rear to keep people on the same version of RomTerraria, I've got a ClickOnce version up for testing.
Everything should work in it except the profanity filter, which I'm rewriting.
Click here to give it a shot.
New features:
- New UI.
- Texture and font pack support.
- Counteract water evaporation in Hell.
After installing, it appears in your Start Menu under Michael Russell > RomTerraria.
Everything should work in it except the profanity filter, which I'm rewriting.
Click here to give it a shot.
New features:
- New UI.
- Texture and font pack support.
- Counteract water evaporation in Hell.
After installing, it appears in your Start Menu under Michael Russell > RomTerraria.
July 2, 2011
Use ZIP Files To Hold Your XNA Content
Quick entry for now, more in-depth one coming soon. Requires SharpZipLib.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using ICSharpCode.SharpZipLib.Zip;
using System.IO;
namespace RomTerraria
{
public class ZipContentManager : ContentManager
{
private ZipFile zipFile = null;
public ZipContentManager(IServiceProvider services, string zipFile) : base(services, "")
{
this.zipFile = new ZipFile(zipFile);
}
protected override System.IO.Stream OpenStream(string assetName)
{
var entry = zipFile.GetEntry(assetName.Replace('\\','/') + ".xnb");
if (entry != null)
{
return zipFile.GetInputStream(entry);
}
return null;
}
}
}
June 23, 2011
Key Events in XNA 4.0
One of the top requested features for XNA since release was the ability to intercept key press events instead of just the key up/down events so that people could do text input easily.
Still can't do it in XNA 4.0, but here's a way of working around it by adding a message filter. Please be aware that they may break this in the future if they don't use Windows Forms for their form in XNA 5.
First, the keyboard filter class...
...and now to wire it up so you can get those KeyPressed events. In your Initialize() function...
This code isn't flawless, but is working well enough for my purposes.
Still can't do it in XNA 4.0, but here's a way of working around it by adding a message filter. Please be aware that they may break this in the future if they don't use Windows Forms for their form in XNA 5.
First, the keyboard filter class...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace RomSteady.Xna.GameEngine.Input
{
public class KeyboardMessageFilter : IMessageFilter
{
[DllImport("user32.dll")]
static extern bool TranslateMessage(ref Message lpMsg);
const int WM_CHAR = 0x0102;
const int WM_KEYDOWN = 0x0100;
public bool PreFilterMessage(ref Message m)
{
if (m.Msg == WM_KEYDOWN)
{
TranslateMessage(ref m);
}
else if (m.Msg == WM_CHAR)
{
if (KeyPressed != null)
KeyPressed.Invoke(this,
new KeyboardMessageEventArgs()
{
Character = Convert.ToChar((int)m.WParam)
});
}
return false;
}
public event EventHandlerKeyPressed;
}
public class KeyboardMessageEventArgs : EventArgs
{
public char Character;
}
}
...and now to wire it up so you can get those KeyPressed events. In your Initialize() function...
...
var keyboardFilter = new KeyboardMessageFilter();
keyboardFilter.KeyPressed +=
new EventHandler(keyboardFilter_KeyPressed);
System.Windows.Forms.Application.AddMessageFilter(keyboardFilter);
...
This code isn't flawless, but is working well enough for my purposes.
Subscribe to:
Posts (Atom)