Skip to content

Commit

Permalink
[Upgrades] Initial Functionality
Browse files Browse the repository at this point in the history
- Missing some behaviour for constant replacement, followed by upgrade.
- Does not yet support relative object pricing.
- Does not yet report correct price for store discount.
- Inventory does not yet show upgrade level. (trade does)

- Other changes to make build/buy more extendable.
- Upgrade Level now stored in database so the transaction is never lost.
- Fix an issue where users would run check trees for random objects when
hovering over a sim's shadow. (could cause an exception)
- More!
  • Loading branch information
riperiperi committed Jul 16, 2019
1 parent 409ccaa commit a0c9286
Show file tree
Hide file tree
Showing 95 changed files with 3,388 additions and 922 deletions.
2 changes: 1 addition & 1 deletion TSOClient/FSO.IDE/Common/SpriteEncoderUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static Microsoft.Xna.Framework.Color[] QuantizeFrame(SPR2Frame frame, out
{
var bmps = GetPixelAlpha(frame, frame.Width, frame.Height, new Vector2());

var quantpx = (Bitmap)ImageBuffer.QuantizeImage(bmps[0], new DistinctSelectionQuantizer(), null, 255, 4);
var quantpx = (Bitmap)ImageBuffer.QuantizeImage(bmps[0], new SimplePaletteQuantizer.Quantizers.Popularity.PopularityQuantizer(), null, 255, 1);
var palt = quantpx.Palette.Entries;

var data = quantpx.LockBits(new System.Drawing.Rectangle(0, 0, quantpx.Width, quantpx.Height), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed);
Expand Down
2 changes: 1 addition & 1 deletion TSOClient/FSO.IDE/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void CreateButton_Click(object sender, EventArgs e)
dir = LotView.Model.Direction.NORTH,
level = HookedVM.Context.World.State.Level,
x = (short)(((short)Math.Floor(HookedVM.Context.World.State.CenterTile.X) << 4) + 8),
y = (short)(((short)Math.Floor(HookedVM.Context.World.State.CenterTile.Y) << 4) + 8)
y = (short)(((short)Math.Floor(HookedVM.Context.World.State.CenterTile.Y) << 4) + 8),
});
}

Expand Down
1 change: 1 addition & 0 deletions TSOClient/FSO.IDE/ObjectWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void SetTargetObject(GameObject obj)
FSOMEdit.SetActiveObject(ActiveObj);
XMLEdit.SetActiveObject(ActiveObj);
PIFFEditor.SetActiveObject(ActiveObj);
UpgradeEditor.SetActiveObject(ActiveObj);

//update top var

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ private void SaveButton_Click(object sender, EventArgs e)

private void NewButton_Click(object sender, EventArgs e)
{
/*
var ind = SelectedStringInd+1;
Content.Content.Get().Changes.BlockingResMod(new ResAction(() =>
{
ActiveConst.InsertString(ind, new STRItem());
var c = ActiveConst.Constants.ToList();
c.Add(0);
ActiveConst.Constants = c.ToArray();
}, ActiveConst));
UpdateStrings();
SelectedStringInd = StringList.Items.Count-1;
*/
}

private void RemoveButton_Click(object sender, EventArgs e)
Expand Down
742 changes: 378 additions & 364 deletions TSOClient/FSO.IDE/ResourceBrowser/UpgradeEditor.Designer.cs

Large diffs are not rendered by default.

Loading

0 comments on commit a0c9286

Please sign in to comment.