diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/FreeHeroes2/FH2ConfigurationBIN.uexml b/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/FreeHeroes2/FH2ConfigurationBIN.uexml new file mode 100644 index 00000000..92ce983d --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/FreeHeroes2/FH2ConfigurationBIN.uexml @@ -0,0 +1,25 @@ + + + + + + + + *.bin + + + + 0CC50000 + + + + + + + + + + + + + diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/NewWorldComputing/NWCFont.uexml b/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/NewWorldComputing/NWCFont.uexml index b9667c66..b76065bb 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/NewWorldComputing/NWCFont.uexml +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/Associations/NewWorldComputing/NWCFont.uexml @@ -3,17 +3,17 @@ - + *.fnt - + - + diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/BINDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/BINDataFormat.cs new file mode 100644 index 00000000..8c0af06f --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/BINDataFormat.cs @@ -0,0 +1,179 @@ +// +// BINDataFormat.cs +// +// Author: +// beckermj <> +// +// Copyright (c) 2023 ${CopyrightHolder} +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +using UniversalEditor.ObjectModels.PropertyList; + +namespace UniversalEditor.DataFormats.FreeHeroes2Configuration +{ + public class BINDataFormat : DataFormat + { + // fs << static_cast( CURRENT_FORMAT_VERSION ) << opt_game << opt_world << opt_battle << opt_addons << pos_radr << pos_bttn << pos_icon << pos_stat; + + private static DataFormatReference _dfr = null; + protected override DataFormatReference MakeReferenceInternal() + { + if (_dfr == null) + { + _dfr = base.MakeReferenceInternal(); + _dfr.Capabilities.Add(typeof(PropertyListObjectModel), DataFormatCapabilities.All); + } + return _dfr; + } + + protected override void LoadInternal(ref ObjectModel objectModel) + { + PropertyListObjectModel plom = (objectModel as PropertyListObjectModel); + if (plom == null) + throw new ObjectModelNotSupportedException(); + + Accessor.Reader.Endianness = IO.Endianness.BigEndian; + ushort formatVersion = Accessor.Reader.ReadUInt16(); + if (formatVersion != 3269) + { + Console.Error.WriteLine("unknown format version {0}, we might crash!", formatVersion); + } + + uint usGame = Accessor.Reader.ReadUInt32(); + FH2GameFlags game = (FH2GameFlags)(usGame | 0x10000000); + FH2WorldFlags world = (FH2WorldFlags)(Accessor.Reader.ReadUInt32() | 0x20000000); + FH2BattleFlags battle = (FH2BattleFlags)(Accessor.Reader.ReadUInt32() | 0x40000000); + FH2AddonFlags addon = (FH2AddonFlags)(Accessor.Reader.ReadUInt32() | 0x30000000); + + ushort radarX = Accessor.Reader.ReadUInt16(); + ushort radarY = Accessor.Reader.ReadUInt16(); + ushort buttonX = Accessor.Reader.ReadUInt16(); + ushort buttonY = Accessor.Reader.ReadUInt16(); + ushort iconX = Accessor.Reader.ReadUInt16(); + ushort iconY = Accessor.Reader.ReadUInt16(); + ushort statusX = Accessor.Reader.ReadUInt16(); + ushort statusY = Accessor.Reader.ReadUInt16(); + + Group grpGame = new Group("game"); + + AddProperty(grpGame, "also confirm autosave", game, FH2GameFlags.GAME_ALSO_CONFIRM_AUTOSAVE); + AddProperty(grpGame, "autosave at beginning of day", game, FH2GameFlags.GAME_AUTOSAVE_BEGIN_DAY); + AddProperty(grpGame, "autosave", game, FH2GameFlags.GAME_AUTOSAVE_ON); + + Group grpGameBattle = new Group("battle"); + AddProperty(grpGameBattle, "show damage", game, FH2GameFlags.GAME_BATTLE_SHOW_DAMAGE); + AddProperty(grpGameBattle, "show grid", game, FH2GameFlags.GAME_BATTLE_SHOW_GRID); + AddProperty(grpGameBattle, "show mouse shadow", game, FH2GameFlags.GAME_BATTLE_SHOW_MOUSE_SHADOW); + AddProperty(grpGameBattle, "show move shadow", game, FH2GameFlags.GAME_BATTLE_SHOW_MOVE_SHADOW); + grpGame.Items.Add(grpGameBattle); + + Group grpCastle = new Group("castle"); + AddProperty(grpCastle, "flash building", game, FH2GameFlags.GAME_CASTLE_FLASH_BUILDING); + grpGame.Items.Add(grpCastle); + + AddProperty(grpGame, "continue after victory", game, FH2GameFlags.GAME_CONTINUE_AFTER_VICTORY); + AddProperty(grpGame, "dynamic interface", game, FH2GameFlags.GAME_DYNAMIC_INTERFACE); + AddProperty(grpGame, "evil interface", game, FH2GameFlags.GAME_EVIL_INTERFACE); + AddProperty(grpGame, "hide interface", game, FH2GameFlags.GAME_HIDE_INTERFACE); + AddProperty(grpGame, "remember last focus", game, FH2GameFlags.GAME_REMEMBER_LAST_FOCUS); + AddProperty(grpGame, "confirm save rewrite", game, FH2GameFlags.GAME_SAVE_REWRITE_CONFIRM); + AddProperty(grpGame, "show sdl logo", game, FH2GameFlags.GAME_SHOW_SDL_LOGO); + AddProperty(grpGame, "show system info", game, FH2GameFlags.GAME_SHOW_SYSTEM_INFO); + AddProperty(grpGame, "use fade", game, FH2GameFlags.GAME_USE_FADE); + + Group grpPocketPC = new Group("pocketpc"); + AddProperty(grpPocketPC, "drag drop scroll", game, FH2GameFlags.POCKETPC_DRAG_DROP_SCROLL); + AddProperty(grpPocketPC, "hide cursor", game, FH2GameFlags.POCKETPC_HIDE_CURSOR); + AddProperty(grpPocketPC, "low memory", game, FH2GameFlags.POCKETPC_LOW_MEMORY); + AddProperty(grpPocketPC, "low resolution", game, FH2GameFlags.POCKETPC_LOW_RESOLUTION); + AddProperty(grpPocketPC, "tap mode", game, FH2GameFlags.POCKETPC_TAP_MODE); + grpGame.Items.Add(grpPocketPC); + + plom.Items.Add(grpGame); + + Group grpBattle = new Group("battle"); + AddProperty(grpBattle, "archmage resists bad spells", battle, FH2BattleFlags.BATTLE_ARCHMAGE_RESIST_BAD_SPELL); + AddProperty(grpBattle, "magic troop resist", battle, FH2BattleFlags.BATTLE_MAGIC_TROOP_RESIST); + AddProperty(grpBattle, "merge armies", battle, FH2BattleFlags.BATTLE_MERGE_ARMIES); + AddProperty(grpBattle, "archer object penalty", battle, FH2BattleFlags.BATTLE_OBJECTS_ARCHERS_PENALTY); + AddProperty(grpBattle, "reverse wait order", battle, FH2BattleFlags.BATTLE_REVERSE_WAIT_ORDER); + AddProperty(grpBattle, "skip increases defense", battle, FH2BattleFlags.BATTLE_SKIP_INCREASE_DEFENSE); + AddProperty(grpBattle, "soft wait troops", battle, FH2BattleFlags.BATTLE_SOFT_WAITING); + plom.Items.Add(grpBattle); + + Group grpWorld = new Group("world"); + Group grpWorldCastle = new Group("castle"); + AddProperty(grpWorldCastle, "allow recruit from well", world, FH2WorldFlags.CASTLE_ALLOW_BUY_FROM_WELL); + AddProperty(grpWorldCastle, "allow guardians", world, FH2WorldFlags.CASTLE_ALLOW_GUARDIANS); + grpWorld.Items.Add(grpWorldCastle); + + Group grpWorldHeroes = new Group("heroes"); + AddProperty(grpWorldHeroes, "allow banned secondary skills upgrade", world, FH2WorldFlags.HEROES_ALLOW_BANNED_SECSKILLS); + AddProperty(grpWorldHeroes, "auto move to target cell after battle", world, FH2WorldFlags.HEROES_AUTO_MOVE_BATTLE_DST); + AddProperty(grpWorldHeroes, "allow buy spell book from shrine", world, FH2WorldFlags.HEROES_BUY_BOOK_FROM_SHRINES); + AddProperty(grpWorldHeroes, "recruit cost dependent on level", world, FH2WorldFlags.HEROES_COST_DEPENDED_FROM_LEVEL); + AddProperty(grpWorldHeroes, "learn new spells with day", world, FH2WorldFlags.HEROES_LEARN_SPELLS_WITH_DAY); + grpWorld.Items.Add(grpWorldHeroes); + + plom.Items.Add(grpWorld); + + Group grpMetrics = new Group("metrics"); + AddMetric(grpMetrics, "radar", radarX, radarY); + AddMetric(grpMetrics, "button", buttonX, buttonY); + AddMetric(grpMetrics, "icon", iconX, iconY); + AddMetric(grpMetrics, "status", statusX, statusY); + plom.Items.Add(grpMetrics); + } + + private void AddMetric(Group group, string name, ushort x, ushort y) + { + Group grp = new Group(name); + grp.Items.AddProperty("x", x); + grp.Items.AddProperty("y", y); + group.Items.Add(grp); + } + + private void AddProperty(Group group, string name, FH2GameFlags flagSrc, FH2GameFlags flagChk) + { + AddProperty(group, name, (uint)flagSrc, (uint)flagChk); + } + private void AddProperty(Group group, string name, FH2BattleFlags flagSrc, FH2BattleFlags flagChk) + { + AddProperty(group, name, (uint)flagSrc, (uint)flagChk); + } + private void AddProperty(Group group, string name, FH2AddonFlags flagSrc, FH2AddonFlags flagChk) + { + AddProperty(group, name, (uint)flagSrc, (uint)flagChk); + } + private void AddProperty(Group group, string name, FH2WorldFlags flagSrc, FH2WorldFlags flagChk) + { + AddProperty(group, name, (uint)flagSrc, (uint)flagChk); + } + private void AddProperty(Group group, string name, uint flagSrc, uint flagChk) + { + Property prop = new Property(name); + prop.Value = ((flagSrc & flagChk) == flagChk) ? "on" : "off"; + group.Items.Add(prop); + } + + protected override void SaveInternal(ObjectModel objectModel) + { + PropertyListObjectModel plom = (objectModel as PropertyListObjectModel); + if (plom == null) + throw new ObjectModelNotSupportedException(); + + } + } +} diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2AddonFlags.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2AddonFlags.cs new file mode 100644 index 00000000..ef58d08c --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2AddonFlags.cs @@ -0,0 +1,43 @@ +// +// FH2AddonFlags.cs +// +// Author: +// beckermj <> +// +// Copyright (c) 2023 ${CopyrightHolder} +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +namespace UniversalEditor.DataFormats.FreeHeroes2Configuration +{ + [Flags()] + public enum FH2AddonFlags + { + CASTLE_MAGEGUILD_POINTS_TURN = 0x30000001, + WORLD_ARTSPRING_SEPARATELY_VISIT = 0x30000002, + CASTLE_ALLOW_RECRUITS_SPECIAL = 0x30000004, + WORLD_STARTHERO_LOSSCOND4HUMANS = 0x30000008, + WORLD_1HERO_HIRED_EVERY_WEEK = 0x30000010, + WORLD_DWELLING_ACCUMULATE_UNITS = 0x30000020, + WORLD_GUARDIAN_TWO_DEFENSE = 0x30000040, + HEROES_ARENA_ANY_SKILLS = 0x30000080, + WORLD_USE_UNIQUE_ARTIFACTS_ML = 0x30000100, + WORLD_USE_UNIQUE_ARTIFACTS_RS = 0x30000200, + WORLD_USE_UNIQUE_ARTIFACTS_PS = 0x30000400, + WORLD_USE_UNIQUE_ARTIFACTS_SS = 0x30000800, + WORLD_DISABLE_BARROW_MOUNDS = 0x30001000, + WORLD_EXT_OBJECTS_CAPTURED = 0x30004000, + CASTLE_1HERO_HIRED_EVERY_WEEK = 0x30008000 + } +} diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2BattleFlags.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2BattleFlags.cs new file mode 100644 index 00000000..fd820614 --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2BattleFlags.cs @@ -0,0 +1,36 @@ +// +// FH2BattleFlags.cs +// +// Author: +// beckermj <> +// +// Copyright (c) 2023 ${CopyrightHolder} +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +namespace UniversalEditor.DataFormats.FreeHeroes2Configuration +{ + [Flags()] + public enum FH2BattleFlags + { + BATTLE_ARCHMAGE_RESIST_BAD_SPELL = 0x40001000, + BATTLE_MAGIC_TROOP_RESIST = 0x40002000, + // UNUSED = 0x40008000, + BATTLE_SOFT_WAITING = 0x40010000, + BATTLE_REVERSE_WAIT_ORDER = 0x40020000, + BATTLE_MERGE_ARMIES = 0x40100000, + BATTLE_SKIP_INCREASE_DEFENSE = 0x40200000, + BATTLE_OBJECTS_ARCHERS_PENALTY = 0x42000000 + } +} diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2GameFlags.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2GameFlags.cs new file mode 100644 index 00000000..02aba604 --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2GameFlags.cs @@ -0,0 +1,51 @@ +// +// FH2GameFlags.cs +// +// Author: +// beckermj <> +// +// Copyright (c) 2023 ${CopyrightHolder} +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +namespace UniversalEditor.DataFormats.FreeHeroes2Configuration +{ + [Flags()] + public enum FH2GameFlags : ulong + { + GAME_AUTOSAVE_BEGIN_DAY = 0x10000010, + GAME_REMEMBER_LAST_FOCUS = 0x10000020, + GAME_SAVE_REWRITE_CONFIRM = 0x10000040, + GAME_CASTLE_FLASH_BUILDING = 0x10000080, + GAME_SHOW_SYSTEM_INFO = 0x10000100, + GAME_AUTOSAVE_ON = 0x10000200, + GAME_USE_FADE = 0x10000400, + GAME_SHOW_SDL_LOGO = 0x10000800, + GAME_EVIL_INTERFACE = 0x10001000, + GAME_HIDE_INTERFACE = 0x10002000, + GAME_ALSO_CONFIRM_AUTOSAVE = 0x10004000, + // UNUSED = 0x10008000, + GAME_DYNAMIC_INTERFACE = 0x10010000, + GAME_BATTLE_SHOW_GRID = 0x10020000, + GAME_BATTLE_SHOW_MOUSE_SHADOW = 0x10040000, + GAME_BATTLE_SHOW_MOVE_SHADOW = 0x10080000, + GAME_BATTLE_SHOW_DAMAGE = 0x10100000, + GAME_CONTINUE_AFTER_VICTORY = 0x10200000, + POCKETPC_HIDE_CURSOR = 0x10400000, + POCKETPC_LOW_MEMORY = 0x10800000, + POCKETPC_TAP_MODE = 0x11000000, + POCKETPC_DRAG_DROP_SCROLL = 0x12000000, + POCKETPC_LOW_RESOLUTION = 0x14000000 + } +} diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2WorldFlags.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2WorldFlags.cs new file mode 100644 index 00000000..d048ffc0 --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FreeHeroes2Configuration/FH2WorldFlags.cs @@ -0,0 +1,57 @@ +// +// FH2WorldFlags.cs +// +// Author: +// beckermj <> +// +// Copyright (c) 2023 ${CopyrightHolder} +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +namespace UniversalEditor.DataFormats.FreeHeroes2Configuration +{ + [Flags()] + public enum FH2WorldFlags + { + /* influence on game balance: save to savefile */ + WORLD_SHOW_VISITED_CONTENT = 0x20000001, + WORLD_ABANDONED_MINE_RANDOM = 0x20000002, + WORLD_SAVE_MONSTER_BATTLE = 0x20000004, + WORLD_ALLOW_SET_GUARDIAN = 0x20000008, + WORLD_NOREQ_FOR_ARTIFACTS = 0x20000010, + WORLD_ARTIFACT_CRYSTAL_BALL = 0x20000020, + WORLD_SCOUTING_EXTENDED = 0x20000040, + WORLD_ONLY_FIRST_MONSTER_ATTACK = 0x20000080, + WORLD_EYE_EAGLE_AS_SCHOLAR = 0x20000100, + HEROES_BUY_BOOK_FROM_SHRINES = 0x20000200, + WORLD_BAN_WEEKOF = 0x20000400, + WORLD_BAN_PLAGUES = 0x20000800, + UNIONS_ALLOW_HERO_MEETINGS = 0x20001000, + UNIONS_ALLOW_CASTLE_VISITING = 0x20002000, + // UNUSED = 0x20004000, + HEROES_AUTO_MOVE_BATTLE_DST = 0x20008000, + WORLD_BAN_MONTHOF_MONSTERS = 0x20010000, + HEROES_TRANSCRIBING_SCROLLS = 0x20020000, + WORLD_NEW_VERSION_WEEKOF = 0x20040000, + CASTLE_ALLOW_GUARDIANS = 0x20080000, + CASTLE_ALLOW_BUY_FROM_WELL = 0x20100000, + HEROES_LEARN_SPELLS_WITH_DAY = 0x20200000, + HEROES_ALLOW_BANNED_SECSKILLS = 0x20400000, + HEROES_COST_DEPENDED_FROM_LEVEL = 0x20800000, + HEROES_REMEMBER_POINTS_RETREAT = 0x21000000, + HEROES_SURRENDERING_GIVE_EXP = 0x22000000, + HEROES_RECALCULATE_MOVEMENT = 0x24000000, + HEROES_PATROL_ALLOW_PICKUP = 0x28000000 + } +} diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Font/Bitmap/Heroes2FNTDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Font/Bitmap/Heroes2FNTDataFormat.cs new file mode 100644 index 00000000..56179392 --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Font/Bitmap/Heroes2FNTDataFormat.cs @@ -0,0 +1,84 @@ +// +// Heroes2FNTDataFormat.cs +// +// Author: +// beckermj <> +// +// Copyright (c) 2023 ${CopyrightHolder} +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +using System; +using UniversalEditor.DataFormats.Multimedia.Picture.NewWorldComputing.ICN; +using UniversalEditor.ObjectModels.Multimedia.Font.Bitmap; +using UniversalEditor.ObjectModels.Multimedia.Picture; +using UniversalEditor.ObjectModels.Multimedia.Picture.Collection; + +namespace UniversalEditor.DataFormats.Multimedia.Font.Bitmap +{ + public class Heroes2FNTDataFormat : DataFormat + { + private static DataFormatReference _dfr = null; + protected override DataFormatReference MakeReferenceInternal() + { + if (_dfr == null) + { + _dfr = base.MakeReferenceInternal(); + _dfr.Capabilities.Add(typeof(BitmapFontObjectModel), DataFormatCapabilities.All); + } + return _dfr; + } + + protected override void LoadInternal(ref ObjectModel objectModel) + { + BitmapFontObjectModel font = (objectModel as BitmapFontObjectModel); + if (font == null) + throw new ObjectModelNotSupportedException(); + + uint size = Accessor.Reader.ReadUInt32(); + font.Size = new MBS.Framework.Drawing.Dimension2D(size, size); + + string fontFileName = Accessor.Reader.ReadFixedLengthString(13).TrimNull(); + + Accessor accRelative = Accessor.GetRelative(fontFileName); + if (accRelative != null) + { + ICNDataFormat icn = new ICNDataFormat(); + PictureCollectionObjectModel coll = new PictureCollectionObjectModel(); + Document.Load(coll, icn, accRelative); + + // from FONT.ICN + string chars = "'!\"'$%&'()*+,`'/0123456789:;._.?.ABCDEFGHIJKLMNOPQRSTUVWXYZ[']'_.abcdefghijklmnopqrstuvwxyz....."; + + for (int i = 0; i < coll.Pictures.Count; i++) + { + PictureObjectModel pic = coll.Pictures[i]; + BitmapFontPixmap pixmap = new BitmapFontPixmap(); + BitmapFontGlyph glyph = new BitmapFontGlyph(); + glyph.Pixmap = pixmap; + glyph.Character = chars[i]; + pixmap.Picture = pic; + glyph.Picture = pic; + + pixmap.Glyphs.Add(glyph); + font.Pixmaps.Add(pixmap); + } + } + } + + protected override void SaveInternal(ObjectModel objectModel) + { + throw new NotImplementedException(); + } + } +} diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs index 72e58166..0bdd4570 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs @@ -184,10 +184,8 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.NewWorldComputing.ICN SpriteHeader sh = shs[i]; PictureObjectModel pic = new PictureObjectModel(); - /* pic.Left = sh.offsetX; pic.Top = sh.offsetY; - */ pic.Width = sh.width; pic.Height = sh.height; diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/UniversalEditor.Plugins.NewWorldComputing.csproj b/Plugins/UniversalEditor.Plugins.NewWorldComputing/UniversalEditor.Plugins.NewWorldComputing.csproj index b24a19c0..328216ae 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/UniversalEditor.Plugins.NewWorldComputing.csproj +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/UniversalEditor.Plugins.NewWorldComputing.csproj @@ -40,7 +40,6 @@ - @@ -104,6 +103,12 @@ + + + + + + @@ -149,6 +154,10 @@ + + + + @@ -160,6 +169,10 @@ + + + +