private void BtnMapEditor_Click(object sender, EventArgs e) { if (CurrentMapEditor == null) { CurrentMapEditor = new MapEditor(); } if (CurrentMapLayerEditor == null) { CurrentMapLayerEditor = new MapLayerEditor(); } CurrentMapEditor.Show(); CurrentMapLayerEditor.Show(); }
int GetIndexFromLayerInfo(MapEditor.EditLayer layerType, int layer) { int layerIndex = 0; if (layerType == MapEditor.EditLayer.Fringe) return layerIndex + Processor.CurrentMap.FringeLayers.Count - 1 - layer; layerIndex += Logic.Gameplay.Processor.CurrentMap.FringeLayers.Count; if (layerType == MapEditor.EditLayer.PropFront) return layerIndex + Processor.CurrentMap.PropFrontLayers.Count - 1 - layer; layerIndex += Logic.Gameplay.Processor.CurrentMap.PropFrontLayers.Count; if (layerType == MapEditor.EditLayer.PropBack) return layerIndex + Processor.CurrentMap.PropBackLayers.Count - 1 - layer; layerIndex += Logic.Gameplay.Processor.CurrentMap.PropBackLayers.Count; if (layerType == MapEditor.EditLayer.Ground) return layerIndex + Logic.Gameplay.Processor.CurrentMap.GroundLayers.Count - 1 - layer; layerIndex += Logic.Gameplay.Processor.CurrentMap.GroundLayers.Count; if (layerType == MapEditor.EditLayer.Data) return layerIndex; return -1; }
void GetLayerInfoFromIndex(int index, ref MapEditor.EditLayer layerType, ref int layer) { if (Logic.Gameplay.Processor.CurrentMap.FringeLayers.Count > index) { layerType = MapEditor.EditLayer.Fringe; layer = Logic.Gameplay.Processor.CurrentMap.FringeLayers.Count - index - 1; return; } index -= Logic.Gameplay.Processor.CurrentMap.FringeLayers.Count; if (Logic.Gameplay.Processor.CurrentMap.PropFrontLayers.Count > index) { layerType = MapEditor.EditLayer.PropFront; layer = Logic.Gameplay.Processor.CurrentMap.PropFrontLayers.Count - index - 1; return; } index -= Logic.Gameplay.Processor.CurrentMap.PropFrontLayers.Count; if (Logic.Gameplay.Processor.CurrentMap.PropBackLayers.Count > index) { layerType = MapEditor.EditLayer.PropBack; layer = Logic.Gameplay.Processor.CurrentMap.PropBackLayers.Count - index - 1; return; } index -= Logic.Gameplay.Processor.CurrentMap.PropBackLayers.Count; if (Logic.Gameplay.Processor.CurrentMap.GroundLayers.Count > index) { layerType = MapEditor.EditLayer.Ground; layer = Logic.Gameplay.Processor.CurrentMap.GroundLayers.Count - index - 1; return; } layerType = MapEditor.EditLayer.Data; layer = 0; }
private void btnMapEditor_Click(object sender, EventArgs e) { if (CurrentMapEditor == null) { CurrentMapEditor = new MapEditor(); } if (CurrentMapLayerEditor == null) { CurrentMapLayerEditor = new MapLayerEditor(); } CurrentMapEditor.Show(); CurrentMapLayerEditor.Show(); }