コード例 #1
0
ファイル: MapElement.cs プロジェクト: Mixi59/Stump
 public MapElement(DlmGraphicalElement dlmElement, EleGraphicalData eleElement)
 {
     Identifier = (int)dlmElement.Identifier;
     ElementId  = dlmElement.ElementId;
     CellId     = dlmElement.Cell.Id;
     Animated   = eleElement is AnimatedGraphicalElementData;
     Gfx        = (eleElement as NormalGraphicalElementData)?.Gfx ?? -1;
 }
コード例 #2
0
ファイル: Helper.cs プロジェクト: Zaetic/Symbioz-2.38-RED
        public static void GetElements(DlmMap map, Elements elements, out List <MapInteractiveElement> interactiveElements)
        {
            interactiveElements = new List <MapInteractiveElement>();
            foreach (var layer in map.Layers)
            {
                foreach (var cell in layer.Cells)
                {
                    foreach (var element in cell.Elements)
                    {
                        if (element is DlmGraphicalElement)
                        {
                            DlmGraphicalElement graphicalElement = element as DlmGraphicalElement;

                            if (graphicalElement.Identifier != 0)
                            {
                                var gfxElement = elements.ReadElement((int)graphicalElement.ElementId);

                                if (gfxElement.Type != EleGraphicalElementTypes.ENTITY)
                                {
                                    NormalGraphicalElementData normalElement    = gfxElement as NormalGraphicalElementData;
                                    MapInteractiveElement      interactiveTable = new MapInteractiveElement();
                                    interactiveTable.ElementId = (int)graphicalElement.Identifier;
                                    interactiveTable.MapId     = map.Id;
                                    interactiveTable.CellId    = (ushort)cell.Id;
                                    if (normalElement != null)
                                    {
                                        interactiveTable.GfxId = normalElement.Gfx;
                                    }
                                    interactiveTable.GfxBonesId = -1;
                                    interactiveElements.Add(interactiveTable);
                                }
                                else
                                {
                                    EntityGraphicalElementData entityElement    = gfxElement as EntityGraphicalElementData;
                                    MapInteractiveElement      interactiveTable = new MapInteractiveElement();
                                    interactiveTable.ElementId  = (int)graphicalElement.Identifier;
                                    interactiveTable.MapId      = map.Id;
                                    interactiveTable.CellId     = (ushort)cell.Id;
                                    interactiveTable.GfxBonesId = ushort.Parse(entityElement.EntityLook.Replace("{", "").Replace("}", ""));
                                    interactiveTable.GfxId      = -1;
                                    interactiveElements.Add(interactiveTable);
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
 public GfxElement(DlmGraphicalElement element, NormalGraphicalElementData graphicalElement, BitmapSource gfx, ObjectsLayer layer)
 {
     Cell = element.Cell.Id;
     ColorMultiplicator = element.ColorMultiplicator;
     Altitude           = element.Altitude;
     m_elementId        = element.ElementId;
     Identifier         = element.Identifier;
     Offset             = new Point(element.Offset.X, element.Offset.Y);
     PixelOffset        = new Point(element.PixelOffset.X, element.PixelOffset.Y);
     FinalTeint         = element.FinalTeint;
     Hue         = element.Hue;
     Shadow      = element.Shadow;
     Layer       = layer;
     Template    = new GfxTemplate(graphicalElement);
     ImageSource = gfx;
 }
コード例 #4
0
 public IdentifiableElement(DlmGraphicalElement element, DlmMap map)
 {
     Element = element;
     Map     = map;
 }