diff --git a/MCGalaxy/Commands/building/CmdPalette.cs b/MCGalaxy/Commands/building/CmdPalette.cs index 98a47c0b7..adac95aa9 100644 --- a/MCGalaxy/Commands/building/CmdPalette.cs +++ b/MCGalaxy/Commands/building/CmdPalette.cs @@ -144,6 +144,25 @@ namespace MCGalaxy.Commands.Building { return block == Block.custom_block ? extBlock : (byte)block; } + + void HandleEntries(Player p, string[] args) { + if (args.Length < 2 || args.Length > 3) { Help(p); return; } + + ImagePalette palette = ImagePalette.Find(args[1]); + if (palette == null) { + Player.Message(p, "Palette {0} does not exist.", args[1]); return; + } + + string modifer = args.Length > 2 ? args[2] : ""; + MultiPageOutput.Output(p, palette.Entries, (e, i) => FormatEntry(e, i, p.level), + "palette entries", "entries", modifer, true); + } + + static string FormatEntry(PaletteEntry e, int index, Level lvl) { + byte block = e.Block, extBlock = 0; + if (block >= Block.CpeCount) { extBlock = block; block = Block.CpeCount; } + return lvl.BlockName(block, extBlock) + " - " + Utils.Hex(e.R, e.G, e.B); + } public override void Help(Player p) { Player.Message(p, "%T/palette create/delete [name]"); @@ -152,6 +171,8 @@ namespace MCGalaxy.Commands.Building { Player.Message(p, "%HAdds a block to a palette's entries."); Player.Message(p, "%T/palette remove [name] [block]"); Player.Message(p, "%HRemoves a block from a palette's entries."); + Player.Message(p, "%T/palette entries [name]"); + Player.Message(p, "%HLists the entries of that palette."); Player.Message(p, "%HPalettes: &f{0}", ImagePalette.Palettes.Join(pal => pal.Name)); } } diff --git a/MCGalaxy/Drawing/Image/ImagePrintDrawOp.cs b/MCGalaxy/Drawing/Image/ImagePrintDrawOp.cs index 20dfd4f3e..c14e55a4e 100644 --- a/MCGalaxy/Drawing/Image/ImagePrintDrawOp.cs +++ b/MCGalaxy/Drawing/Image/ImagePrintDrawOp.cs @@ -40,9 +40,7 @@ namespace MCGalaxy.Drawing.Ops { IPaletteMatcher selector; public override void Perform(Vec3S32[] marks, Brush brush, Action output) { - selector = null; - CalcState(Direction); - + CalcState(Direction); selector = new RgbPaletteMatcher(); CalcLayerColors(); @@ -50,6 +48,20 @@ namespace MCGalaxy.Drawing.Ops { getter.Init(); getter.Iterate(output, OutputPixel); } + selector = null; + + // Put all the blocks in shadow + if (DualLayer) { + ushort y = (ushort)(Origin.Y + Source.Height); + for (int i = 0; i < Source.Width; i++) { + ushort x = (ushort)(Origin.X + dx.X * i); + ushort z = (ushort)(Origin.Z + dx.Z * i); + output(Place(x, y, z, Block.rock, 0)); + + x = (ushort)(x + adj.X); z = (ushort)(z + adj.Z); + output(Place(x, y, z, Block.rock, 0)); + } + } Source.Dispose(); Source = null;