editor seems to almost working

This commit is contained in:
Tubix
2024-12-17 22:08:17 +00:00
parent 4b25ee98c5
commit 739e5b8b9d
324 changed files with 30253 additions and 0 deletions

BIN
src/.DS_Store vendored Normal file

Binary file not shown.

2
src/.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

816
src/AlternativaEditor.mxml Normal file
View File

@@ -0,0 +1,816 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"
xmlns:local1="alternativa.editor.*" applicationComplete="onApplicationComplete()"
backgroundAlpha="0">
<mx:Script>
<![CDATA[
import alternativa.editor.FunctionalProps;
import alternativa.editor.LayersWindow;
import alternativa.editor.LibraryManager;
import alternativa.editor.MultiPropMode;
import alternativa.editor.Preview;
import alternativa.editor.SceneContainer;
import alternativa.editor.events.EditorProgressEvent;
import alternativa.editor.mapexport.ExportManager;
import alternativa.editor.mapexport.FileType;
import alternativa.editor.mapimport.ImportManager;
import alternativa.editor.prop.BonusRegion;
import alternativa.editor.prop.CTFFlagBase;
import alternativa.editor.prop.ControlPoint;
import alternativa.editor.prop.FreeBonusRegion;
import alternativa.editor.prop.KillBox;
import alternativa.editor.prop.MeshProp;
import alternativa.editor.prop.Prop;
import alternativa.editor.prop.SpawnPoint;
import alternativa.editor.prop.Sprite3DProp;
import alternativa.editor.scene.CursorScene;
import alternativa.editor.scene.MainScene;
import alternativa.utils.KeyboardUtils;
import flash.desktop.*;
import flash.display.*;
import flash.events.*;
import flash.filesystem.*;
import flash.utils.*;
import gui.events.PropListEvent;
import mx.binding.*;
import mx.containers.ControlBar;
import mx.containers.HDividedBox;
import mx.containers.Panel;
import mx.containers.VBox;
import mx.containers.VDividedBox;
import mx.controls.Alert;
import mx.controls.Button;
import mx.controls.ComboBox;
import mx.controls.FlexNativeMenu;
import mx.controls.Label;
import mx.core.UIComponentDescriptor;
import mx.core.WindowedApplication;
import mx.events.CloseEvent;
import mx.events.FlexEvent;
import mx.events.FlexNativeMenuEvent;
import mx.events.ListEvent;
import mx.events.PropertyChangeEvent;
import mx.managers.PopUpManager;
public static var preview:Preview;
private static var helpDataClass:Class = AlternativaEditor_helpDataClass;
private static const helpText:String = ByteArray(new helpDataClass()).toString().split(/\r/).join("");
public static const DEFAULT_SELECTABLE_TYPES:Array = [KillBox, MeshProp, Sprite3DProp, SpawnPoint, Prop, FreeBonusRegion, ControlPoint, CTFFlagBase];
private var progressBar:PopUpProgressBar;
private var mainScene:MainScene;
private var cursorScene:CursorScene;
private var importManager:ImportManager;
private var exportManager:ExportManager;
private var miVisulaGeometry:NativeMenuItem;
private var miCollisionGeometry:NativeMenuItem;
private var miLock:NativeMenuItem;
private var miLockGroup:NativeMenuItem;
private var miUnlock:NativeMenuItem;
private var miSnap:NativeMenuItem;
private var miShowGrid:NativeMenuItem;
private var miShowLayers:NativeMenuItem;
private var propertyPanel:Panel;
private var libraryManager:LibraryManager;
private var showCollisionGeometry:Boolean;
private var snappingEnabled:Boolean;
private var showGrid:Boolean = true;
private var batchSelector:File = new File();
private var batchProcessor:BatchProcessor;
private var layersWindow:LayersWindowBase;
private static function onPreviewPanelResize(param1:Event):void
{
preview.onResize();
}
private function onApplicationComplete():void
{
var loc1:NativeMenuItem = null;
var loc2:NativeMenuItem = null;
this.createPropPreview();
this.initPropList();
this.mainScene = this.sceneContainer.mainScene;
this.createPropertyPanel();
this.cursorScene = this.sceneContainer.cursorScene;
stage.addEventListener(KeyboardEvent.KEY_DOWN, this.onKeyDown);
this.createLibraryManager();
this.createImportManager();
this.exportManager = new ExportManager(this.mainScene);
loc1 = this.getMenuItemByLabel("Export Tanks map 1.x");
loc1.keyEquivalent = null;
loc1 = this.getMenuItemByLabel("File");
loc2 = loc1.submenu.addItemAt(new NativeMenuItem("Export Tanks map 1.x.Full"), 3);
loc2.keyEquivalent = "t";
loc2.addEventListener(Event.SELECT, this.onExportToTanksV1FullClick);
loc2 = loc1.submenu.addItemAt(new NativeMenuItem("Import Specials"), 5);
loc2.addEventListener(Event.SELECT, this.specialAppendFromXMLClick);
this.initMenuItems();
this.setSnapping(true);
this.initFunctionalLibrary();
this.batchProcessor = new BatchProcessor(this.mainScene, this.libraryManager);
this.batchProcessor.addEventListener(Event.COMPLETE, this.onBatchProcessingComplete);
this.batchProcessor.addEventListener(EditorProgressEvent.PROGRESS, this.onBatchProcessingProgress);
this.batchSelector.addEventListener(Event.SELECT, this.onBatchFileSelect);
addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER, this.fileHoverHandler);
addEventListener(NativeDragEvent.NATIVE_DRAG_DROP, this.fileDroppedHandler);
}
private function fileHoverHandler(param1:NativeDragEvent):void
{
NativeDragManager.acceptDragDrop(this);
}
private function fileDroppedHandler(param1:NativeDragEvent):void
{
var loc2:Array = param1.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array;
if (loc2.length == 1 && !File(loc2[0]).isDirectory && File(loc2[0]).name.indexOf(".xml") > 0)
{
this.onImportStart(null);
this.importManager.clearScene();
this.importManager.startImport(File(loc2[0]));
}
else
{
this.libraryManager.loadGivenLibraries(loc2);
}
}
private function onBatchProcessingComplete(param1:Event):void
{
this.hideProgressBar();
}
private function onBatchProcessingProgress(param1:EditorProgressEvent):void
{
this.progressBar.setProgress(param1.progress, 1);
}
private function initFunctionalLibrary():void
{
this.libraryManager.addLibrary(FunctionalProps.getFunctionalLibrary());
this.cbPropLibNames.selectedItem = "Functional";
this.onComboBoxChange(null);
}
private function initMenuItems():void
{
this.miVisulaGeometry = this.getMenuItem(2, 0);
this.miCollisionGeometry = this.getMenuItem(2, 1);
this.miShowGrid = this.getMenuItem(2, 4);
this.miSnap = this.getMenuItem(4, 1);
this.miUnlock = this.getMenuItemByLabel("All intersections allowed");
this.miLockGroup = this.getMenuItemByLabel("Same props intersections denied");
this.miLock = this.getMenuItemByLabel("All intersections denied");
this.miShowLayers = this.getMenuItem(2, 5);
}
private function getMenuItem(...rest):NativeMenuItem
{
var loc2:NativeMenuItem = menu.nativeMenu.getItemAt(rest[0]);
var loc3:int = 1;
while (loc3 < rest.length)
{
loc2 = loc2.submenu.getItemAt(rest[loc3]);
loc3++;
}
return loc2;
}
private function getMenuItemByLabel(param1:String, param2:NativeMenu = null):NativeMenuItem
{
var loc4:NativeMenuItem = null;
if (!param2)
{
param2 = this.menu.nativeMenu;
}
var loc3:int = 0;
while (loc3 < param2.numItems)
{
loc4 = param2.getItemAt(loc3);
if (loc4.label == param1)
{
return loc4;
}
if (Boolean(loc4.submenu) && Boolean(this.getMenuItemByLabel(param1, loc4.submenu)))
{
return this.getMenuItemByLabel(param1, loc4.submenu);
}
loc3++;
}
return null;
}
private function onPropSelect(param1:PropListEvent):void
{
preview.showProp(param1.selectedItem);
this.workspace.setFocus();
this.cursorScene.object = param1.selectedItem.clone();
}
private function onPropListClick(param1:MouseEvent):void
{
this.workspace.setFocus();
}
private function onLibraryManagerChange(param1:Event):void
{
this.cursorScene.clear();
var loc2:Array = this.libraryManager.libraryNames;
this.cbPropLibNames.selectedItem = loc2[loc2.length - 1];
this.onComboBoxChange(null);
this.hideProgressBar();
}
private function onKeyDown(param1:KeyboardEvent):void
{
var loc2:Prop = null;
switch (param1.keyCode)
{
case KeyboardUtils.SPACE:
if (!this.showCollisionGeometry)
{
if (this.cursorScene.visible)
{
loc2 = this.cursorScene.object;
if (loc2)
{
this.sceneContainer.addProp(loc2);
break;
}
Alert.show("Select prop for pasting!");
break;
}
if (this.propertyPanel.enabled && this.showPropertyButton.down && this.mainScene.isTexturePanel)
{
this.mainScene.onTexturePanelSelect();
}
break;
}
}
this.workspace.setFocus();
}
private function toggleSnapMode():void
{
this.setSnapping(!this.snappingEnabled);
}
private function setSnapping(param1:Boolean):void
{
this.snappingEnabled = param1;
this.sceneContainer.snapMode = param1;
this.miSnap.checked = param1;
this.snapButton.down = param1;
}
private function toggleGrid():void
{
this.showGrid = !this.showGrid;
this.btnToggleGrid.down = this.showGrid;
this.miShowGrid.checked = this.showGrid;
if (this.showGrid)
{
this.mainScene.showGrid();
}
else
{
this.mainScene.hideGrid();
}
}
private function showPropertyPanel():void
{
if (this.showPropertyButton.down)
{
this.vbox.addChild(this.propertyPanel);
}
else
{
this.vbox.removeChild(this.propertyPanel);
}
}
private function toggleGeometryViewMode():void
{
this.showCollisionGeometry = !this.showCollisionGeometry;
this.viewButton.down = this.showCollisionGeometry;
this.miVisulaGeometry.checked = !this.showCollisionGeometry;
this.miCollisionGeometry.checked = this.showCollisionGeometry;
if (this.showCollisionGeometry)
{
this.mainScene.showCollisionBoxes();
}
else
{
this.mainScene.hideCollisionBoxes();
}
}
private function onComboBoxChange(param1:Event):void
{
var loc2:Array = null;
var loc3:int = 0;
var loc4:Prop = null;
this.proplistPanel.deleteAllProps();
if (this.cbPropLibNames.selectedLabel)
{
loc2 = this.libraryManager.getPropsByLibName(this.cbPropLibNames.selectedLabel);
loc3 = 0;
while (loc3 < loc2.length)
{
loc4 = loc2[loc3];
this.proplistPanel.addProp(loc4.groupName, loc4.name, loc4.icon, loc4);
loc3++;
}
}
}
private function onSelectionTypeChange(param1:Event):void
{
switch (this.typeSelecting.selectedIndex)
{
case 0:
this.mainScene.selectablePropTypes = DEFAULT_SELECTABLE_TYPES;
break;
case 1:
this.mainScene.selectablePropTypes = [MeshProp];
break;
case 2:
this.mainScene.selectablePropTypes = [Sprite3DProp];
break;
case 3:
this.mainScene.selectablePropTypes = [SpawnPoint, BonusRegion, CTFFlagBase, ControlPoint, FreeBonusRegion];
}
this.workspace.setFocus();
}
private function hideSelectedProps():void
{
this.mainScene.hideSelectedProps();
}
private function showAll():void
{
this.mainScene.showAll();
}
private function onBatchFileSelect(param1:Event):void
{
this.showProgressBar("Batch processing");
this.progressBar.setProgress(0, 1);
this.batchProcessor.run(this.batchSelector.getDirectoryListing());
}
private function menuHandler(param1:FlexNativeMenuEvent):void
{
var handlerName:String = param1.item.@click;
var loc2:Function = this[handlerName];
//var loc2:Function = param1.item.@click;
if (loc2 != null)
{
loc2.call(this, param1.nativeMenuItem);
}
this.workspace.setFocus();
}
private function onNewLevelClick(param1:NativeMenuItem):void
{
var item:NativeMenuItem = param1;
if (this.mainScene.changed)
{
Alert.show("Discard changes?", "Scene has been changed", Alert.YES | Alert.CANCEL, null, function(param1:CloseEvent):void
{
if (param1.detail == Alert.YES)
{
newLevel();
}
});
}
else
{
this.newLevel();
}
}
private function newLevel():void
{
this.mainScene.clear();
this.cursorScene.updateMaterial();
}
private function onImportFromTanksClick(param1:NativeMenuItem):void
{
var item:NativeMenuItem = param1;
if (this.mainScene.changed)
{
Alert.show("Discard changes?", "Scene has been changed", Alert.YES | Alert.CANCEL, null, function(param1:CloseEvent):void
{
if (param1.detail == Alert.YES)
{
importFromXML();
}
});
}
else
{
this.importFromXML();
}
}
private function importFromXML():void
{
this.importManager.clearScene();
this.importManager.importFromXML();
}
private function appendFromXMLClick(param1:NativeMenuItem):void
{
this.importManager.importFromXML();
}
private function specialAppendFromXMLClick(param1:Event):void
{
this.importManager.importFromXML(true);
}
private function onImportStart(param1:Event):void
{
this.showProgressBar("Importing level");
}
private function onImportProgress(param1:EditorProgressEvent):void
{
this.progressBar.setProgress(param1.progress, 1);
}
private function onImportComplete(param1:Event):void
{
this.hideProgressBar();
}
private function onExportToTanksV1Click(param1:NativeMenuItem):void
{
this.exportManager.exportMap(FileType.MAP_XML_VERSION_1_LITE);
}
private function onExportToTanksV1FullClick(param1:Event):void
{
this.exportManager.exportMap(FileType.MAP_XML_VERSION_1_FULL);
}
private function onExportToTanksV3Click(param1:NativeMenuItem):void
{
this.exportManager.exportMap(FileType.MAP_XML_VERSION_3);
}
private function onBatchProcessingClick(param1:NativeMenuItem):void
{
this.batchSelector.browseForDirectory("Levels");
}
private function onUndoClick(param1:NativeMenuItem):void
{
this.sceneContainer.undo();
}
private function onRedoClick(param1:NativeMenuItem):void
{
this.sceneContainer.redo();
}
private function onClearLevelClick(param1:NativeMenuItem):void
{
this.mainScene.clear();
this.mainScene.changed = true;
this.cursorScene.updateMaterial();
}
private function onSelectAll(param1:NativeMenuItem):void
{
this.mainScene.selectAll();
}
private function onClearAndLoadLibClick(param1:NativeMenuItem):void
{
this.libraryManager.clearAndLoadLibrary();
}
private function onLoadLibClick(param1:NativeMenuItem):void
{
this.libraryManager.loadLibrary();
}
private function onStartLibLoading(param1:Event):void
{
this.showProgressBar("Loading libraries");
}
private function onLibraryLoadingProgress(param1:EditorProgressEvent):void
{
this.progressBar.setProgress(param1.progress, 1);
}
public function onToggleIntersectionCheckMode(param1:NativeMenuItem):void
{
this.getMenuItemByLabel("All intersections allowed").checked = false;
this.getMenuItemByLabel("Same props intersections denied").checked = false;
this.getMenuItemByLabel("All intersections denied").checked = false;
switch (param1)
{
case this.getMenuItemByLabel("All intersections allowed"):
this.sceneContainer.multiplePropMode = MultiPropMode.ANY;
break;
case this.getMenuItemByLabel("Same props intersections denied"):
this.sceneContainer.multiplePropMode = MultiPropMode.GROUP;
break;
case this.getMenuItemByLabel("All intersections denied"):
this.sceneContainer.multiplePropMode = MultiPropMode.NONE;
}
param1.checked = true;
}
private function onToggleGeometryClick(param1:NativeMenuItem):void
{
if (param1 == this.miCollisionGeometry && !this.showCollisionGeometry || param1 == this.miVisulaGeometry && this.showCollisionGeometry)
{
this.toggleGeometryViewMode();
}
else
{
param1.checked = true;
}
}
private function onSnapClick(param1:NativeMenuItem):void
{
this.toggleSnapMode();
}
private function onShowBoundBoxesClick(param1:NativeMenuItem):void
{
this.sceneContainer.showBoundBoxes = !this.sceneContainer.showBoundBoxes;
param1.checked = this.sceneContainer.showBoundBoxes;
}
private function onShowGridClick(param1:NativeMenuItem):void
{
this.toggleGrid();
}
private function onHelpClick(param1:NativeMenuItem):void
{
Alert.show(helpText, "Help");
}
private function showProgressBar(param1:String):void
{
if (this.progressBar == null)
{
this.progressBar = PopUpProgressBar(PopUpManager.createPopUp(this, PopUpProgressBar, true));
}
this.progressBar.setLabel(param1);
}
private function hideProgressBar():void
{
if (this.progressBar != null)
{
PopUpManager.removePopUp(this.progressBar);
this.progressBar = null;
}
}
private function onObjectGroupCheckboxChange(param1:Event):void
{
}
private function createPropPreview():void
{
preview = new Preview();
this.previewPanel.addChild(preview);
this.previewPanel.addEventListener(Event.RESIZE, onPreviewPanelResize);
}
private function initPropList():void
{
this.proplistPanel.addEventListener(PropListEvent.SELECT, this.onPropSelect);
this.proplistPanel.addEventListener(MouseEvent.CLICK, this.onPropListClick);
}
private function createPropertyPanel():void
{
this.propertyPanel = new Panel();
this.propertyPanel.title = "Properties";
this.propertyPanel.percentWidth = 100;
this.propertyPanel.height = 200;
this.mainScene.setPropertyPanel(this.propertyPanel);
}
private function createLibraryManager():void
{
this.libraryManager = new LibraryManager();
this.libraryManager.addEventListener(Event.OPEN, this.onStartLibLoading);
this.libraryManager.addEventListener(Event.COMPLETE, this.onLibraryManagerChange);
this.libraryManager.addEventListener(EditorProgressEvent.PROGRESS, this.onLibraryLoadingProgress);
this.cbPropLibNames.dataProvider = this.libraryManager.libraryNames;
}
private function createImportManager():void
{
this.importManager = new ImportManager(this.mainScene, this.libraryManager);
this.importManager.addEventListener(Event.COMPLETE, this.onImportComplete);
this.importManager.addEventListener(EditorProgressEvent.PROGRESS, this.onImportProgress);
this.importManager.addEventListener(Event.OPEN, this.onImportStart);
}
private function onShowLayersWindow(param1:NativeMenuItem):void
{
if (param1.checked)
{
this.showLayersWindow();
}
else
{
this.closeLayersWindow();
}
}
private function showLayersWindow():void
{
if (this.layersWindow == null)
{
this.layersWindow = LayersWindowBase(PopUpManager.createPopUp(this, LayersWindow));
this.layersWindow.addEventListener(Event.CLOSE, this.closeLayersWindow);
PopUpManager.centerPopUp(this.layersWindow);
}
this.layersWindow.visible = true;
}
private function closeLayersWindow(param1:Event = null):void
{
this.layersWindow.visible = false;
this.miShowLayers.checked = false;
}
private function onClearLibClick(param1:NativeMenuItem):void
{
this.libraryManager.clearLibraries();
}
]]>
</mx:Script>
<!-- Define Menu Data -->
<mx:XML id="menuData">
<root>
<menuitem label="File">
<menuitem label="New" keyEquivalent="n" ctrlKey="true" click="onNewLevelClick"/>
<menuitem type="separator"/>
<menuitem label="Export Tanks map 1.x" keyEquivalent="t" ctrlKey="true" click="onExportToTanksV1Click"/>
<menuitem label="Export Tanks map 3.x" keyEquivalent="t" ctrlKey="true" shiftKey="true" click="onExportToTanksV3Click"/>
<menuitem label="Import Tanks map" keyEquivalent="i" ctrlKey="true" click="onImportFromTanksClick"/>
<menuitem label="Append Tanks map" keyEquivalent="a" ctrlKey="true" click="appendFromXMLClick"/>
<menuitem label="Batch processing" click="onBatchProcessingClick"/>
</menuitem>
<menuitem label="Edit">
<menuitem label="Undo" keyEquivalent="z" ctrlKey="true" click="onUndoClick"/>
<menuitem label="Redo" keyEquivalent="y" ctrlKey="true" click="onRedoClick"/>
<menuitem label="Clear" keyEquivalent="c" ctrlKey="true" altKey="true" click="onClearLevelClick"/>
<menuitem label="Select all" keyEquivalent="a" ctrlKey="true" click="onSelectAll"/>
</menuitem>
<menuitem label="View">
<menuitem label="Visual geometry" type="check" toggled="true" keyEquivalent="1" ctrlKey="true" click="onToggleGeometryClick"/>
<menuitem label="Collision geometry" type="check" keyEquivalent="2" ctrlKey="true" click="onToggleGeometryClick"/>
<menuitem type="separator"/>
<menuitem label="Show bound boxes" type="check" keyEquivalent="b" ctrlKey="true" click="onShowBoundBoxesClick"/>
<menuitem label="Show grid" type="check" toggled="true" keyEquivalent="g" click="onShowGridClick"/>
<menuitem label="Show layers" type="check" toggled="false" keyEquivalent="l" click="onShowLayersWindow"/>
</menuitem>
<menuitem label="Library">
<menuitem label="Clear" keyEquivalent="l" ctrlKey="true" altKey="true" click="onClearLibClick"/>
<menuitem label="Clear and load" keyEquivalent="l" ctrlKey="true" altKey="true" click="onClearAndLoadLibClick"/>
<menuitem label="Load" keyEquivalent="l" ctrlKey="true" click="onLoadLibClick()"/>
</menuitem>
<menuitem label="Options">
<menuitem label="Props intersection check">
<menuitem label="All intersections allowed" type="check" click="onToggleIntersectionCheckMode"/>
<menuitem label="Same props intersections denied" type="check" click="onToggleIntersectionCheckMode"/>
<menuitem label="All intersections denied" type="check" toggled="true" click="onToggleIntersectionCheckMode"/>
</menuitem>
<menuitem label="Snap" keyEquivalent="n" click="onSnapClick()"/>
</menuitem>
<menuitem label="Help">
<menuitem label="Show help" click="onHelpClick()"/>
</menuitem>
</root>
</mx:XML>
<!-- Flex Native Menu -->
<mx:menu>
<mx:FlexNativeMenu dataProvider="{menuData}"
labelField="@label"
showRoot="false"
keyEquivalentField="@keyEquivalent"
itemClick="menuHandler(event);"
id="menu"/>
</mx:menu>
<mx:ControlBar percentWidth="100" height="26" paddingTop="0" paddingBottom="0" paddingLeft="0" paddingRight="0">
<local:ModeButton id="snapButton"
click="toggleSnapMode();"
width="24" height="24"
upToolTip="Enable snapping"
downToolTip="Disable snapping"
upModeIcon="@Embed(source='icons/editor/snap_icon_on.png')"
downModeIcon="@Embed(source='icons/editor/snap_icon.png')"/>
<local:ModeButton id="viewButton"
click="toggleGeometryViewMode();"
width="24" height="24"
upToolTip="Show collision geometry"
downToolTip="Show visual geometry"
upModeIcon="@Embed(source='icons/editor/boxes_icon_on.png')"
downModeIcon="@Embed(source='icons/editor/boxes_icon.png')"/>
<local:ModeButton id="btnToggleGrid"
click="toggleGrid();"
width="24" height="24"
upToolTip="Show grid"
downToolTip="Hide grid"
down="true"
upModeIcon="@Embed(source='icons/editor/grid_icon_on.png')"
downModeIcon="@Embed(source='icons/editor/grid_icon.png')"/>
<local:ModeButton id="showPropertyButton"
click="showPropertyPanel()"
width="24" height="24"
upToolTip="Show property panel"
downToolTip="Hide property panel"
upModeIcon="@Embed(source='icons/editor/textures_icon_on.png')"
downModeIcon="@Embed(source='icons/editor/textures_icon.png')"/>
<mx:Button id="hideSelectedButton"
click="hideSelectedProps()"
width="24" height="24"
toolTip="Hide selected props"
icon="@Embed(source='icons/editor/hide_selected.png')"/>
<mx:Button id="showAllButton"
click="showAll();"
width="24" height="24"
toolTip="Show all"
icon="@Embed(source='icons/editor/show_all.png')"/>
<mx:Label text="Selecting prop:" width="89"/>
<mx:ComboBox id="typeSelecting"
change="onSelectionTypeChange(event);"
width="130"/>
</mx:ControlBar>
<mx:HDividedBox percentWidth="100" percentHeight="100" y="26">
<!-- Left VBox Section -->
<mx:VBox id="vbox" percentWidth="100" percentHeight="100">
<mx:HDividedBox percentWidth="100" percentHeight="100">
<mx:Panel id="workspace" title="Workspace" percentWidth="100" percentHeight="100" layout="absolute" horizontalScrollPolicy="off">
<local1:SceneContainer id="sceneContainer" percentWidth="100" percentHeight="100"/>
</mx:Panel>
</mx:HDividedBox>
</mx:VBox>
<!-- Right VDividedBox Section -->
<mx:VDividedBox width="300" percentHeight="100">
<mx:Panel id="previewPanel" title="Preview" percentWidth="100" height="300"/>
<mx:VBox percentWidth="100" percentHeight="100">
<mx:ComboBox id="cbPropLibNames" change="onComboBoxChange(event);" percentWidth="100"/>
<local:PropListPanel id="proplistPanel"/>
</mx:VBox>
</mx:VDividedBox>
</mx:HDividedBox>
</mx:WindowedApplication>

View File

@@ -0,0 +1,14 @@
package
{
import mx.core.ByteArrayAsset;
[Embed(source="/_assets/74_AlternativaEditor_helpDataClass.bin", mimeType="application/octet-stream")]
public class AlternativaEditor_helpDataClass extends ByteArrayAsset
{
public function AlternativaEditor_helpDataClass()
{
super();
}
}
}

101
src/BatchProcessor.as Normal file
View File

@@ -0,0 +1,101 @@
package
{
import alternativa.editor.LibraryManager;
import alternativa.editor.events.EditorProgressEvent;
import alternativa.editor.mapexport.FileType;
import alternativa.editor.mapimport.TanksXmlImporter;
import alternativa.editor.scene.MainScene;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
public class BatchProcessor extends EventDispatcher
{
private var files:Vector.<File>;
private var currentFileIndex:int;
private var importer:TanksXmlImporter;
private var mainScene:MainScene;
public function BatchProcessor(param1:MainScene, param2:LibraryManager)
{
super();
this.mainScene = param1;
this.importer = new TanksXmlImporter(param1,param2);
this.importer.addEventListener(Event.COMPLETE,this.onImportComplete);
this.importer.addEventListener(EditorProgressEvent.PROGRESS,this.onProgress);
}
private static function selectXMLFiles(param1:Array) : Vector.<File>
{
var loc3:File = null;
var loc2:Vector.<File> = new Vector.<File>();
for each(loc3 in param1)
{
if(loc3.extension.toLowerCase() == "xml")
{
loc2.push(loc3);
}
}
return loc2;
}
private function onProgress(param1:EditorProgressEvent) : void
{
var loc2:Number = 1 / this.files.length;
dispatchEvent(new EditorProgressEvent((this.currentFileIndex + param1.progress) * loc2));
}
public function run(param1:Array) : void
{
this.files = selectXMLFiles(param1);
this.currentFileIndex = -1;
this.processNextFile();
}
private function processNextFile() : void
{
++this.currentFileIndex;
if(this.currentFileIndex < this.files.length)
{
this.importFile();
}
else
{
this.complete();
}
}
private function importFile() : void
{
this.mainScene.clear();
var loc1:FileStream = new FileStream();
loc1.open(this.getCurrentFile(),FileMode.READ);
this.importer.importFromFileStream(loc1);
}
private function onImportComplete(param1:Event) : void
{
var loc2:FileStream = new FileStream();
loc2.open(this.getCurrentFile(),FileMode.WRITE);
this.mainScene.exportScene(FileType.MAP_XML_VERSION_1_FULL,loc2);
this.processNextFile();
}
private function getCurrentFile() : File
{
return this.files[this.currentFileIndex];
}
private function complete() : void
{
this.files = null;
dispatchEvent(new Event(Event.COMPLETE));
}
}
}

13
src/BonusTypes.as Normal file
View File

@@ -0,0 +1,13 @@
package
{
public class BonusTypes
{
public static const types:Array = ["damageup","armorup","nitro","medkit","crystal","crystal_100"];
public function BonusTypes()
{
super();
}
}
}

54
src/ErrorHandler.as Normal file
View File

@@ -0,0 +1,54 @@
package
{
import flash.display.DisplayObject;
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
public class ErrorHandler
{
private static var windowMessage:String = "";
private static var content:String = "";
private static var window:ErrorWindow = new ErrorWindow();
public function ErrorHandler()
{
super();
}
public static function addText(param1:String) : void
{
content += param1 + "\r";
updateContent();
}
public static function setMessage(param1:String) : void
{
windowMessage = param1;
updateContent();
}
private static function updateContent() : void
{
if(window.text)
{
window.text.text = content;
window.message.text = windowMessage;
}
}
public static function clearMessages() : void
{
content = "";
}
public static function showWindow() : void
{
PopUpManager.addPopUp(window,DisplayObject(FlexGlobals.topLevelApplication));
PopUpManager.centerPopUp(window);
updateContent();
}
}
}

48
src/ErrorWindow.mxml Normal file
View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<local:ResizableTitleWindowX xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*"
width="400" title="Error Window"
close="close();">
<fx:Script>
<![CDATA[
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
import flash.events.MouseEvent;
]]>
</fx:Script>
<!-- Define the layout using MXML -->
<s:VGroup percentWidth="100" percentHeight="100" paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5">
<!-- Message Label -->
<s:Label id="message" />
<!-- Scroller for text area -->
<s:Scroller percentWidth="100" percentHeight="100">
<s:Group percentWidth="100">
<s:TextArea id="text" percentWidth="100" percentHeight="100" />
</s:Group>
</s:Scroller>
<!-- OK Button -->
<s:Button id="ok" label="Okay" click="ok_click();" />
</s:VGroup>
<!-- Script for event handling -->
<fx:Script>
<![CDATA[
// Close event handler
public function close():void {
PopUpManager.removePopUp(this);
}
// OK button click handler
public function ok_click():void {
this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
}
]]>
</fx:Script>
</local:ResizableTitleWindowX>

13
src/GameModes.as Normal file
View File

@@ -0,0 +1,13 @@
package
{
public class GameModes
{
public static const modes:Array = ["dm","tdm","ctf","dom"];
public function GameModes()
{
super();
}
}
}

View File

@@ -0,0 +1,31 @@
package
{
import flash.events.Event;
import flash.events.EventDispatcher;
public class GlobalEventDispatcher
{
private static var eventDispatcher:EventDispatcher = new EventDispatcher();
public function GlobalEventDispatcher()
{
super();
}
public static function addListener(param1:String, param2:Function) : void
{
eventDispatcher.addEventListener(param1,param2);
}
public static function removeListener(param1:String, param2:Function) : void
{
eventDispatcher.removeEventListener(param1,param2);
}
public static function dispatch(param1:Event) : void
{
eventDispatcher.dispatchEvent(param1);
}
}
}

11
src/LayersWindowBase.mxml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
title="Layers"
width="150" height="200"
showCloseButton="true"
xmlns:local="*">
<!-- Main VBox container -->
<mx:VBox id="mainBox"/>
</mx:TitleWindow>

136
src/ModeButton.as Normal file
View File

@@ -0,0 +1,136 @@
package
{
import flash.events.MouseEvent;
import mx.binding.BindingManager;
import mx.controls.Button;
import mx.core.IFlexModuleFactory;
import mx.events.FlexEvent;
import mx.events.PropertyChangeEvent;
public class ModeButton extends Button
{
private var _1023233823downToolTip:String;
private var _1427000520upToolTip:String;
private var __moduleFactoryInitialized:Boolean = false;
private var _down:Boolean = false;
public var downModeIcon:Class;
public var upModeIcon:Class;
public function ModeButton()
{
super();
this._ModeButton_String2_i();
this._ModeButton_String1_i();
this.addEventListener("creationComplete",this.___ModeButton_Button1_creationComplete);
}
override public function set moduleFactory(param1:IFlexModuleFactory) : void
{
super.moduleFactory = param1;
if(this.__moduleFactoryInitialized)
{
return;
}
this.__moduleFactoryInitialized = true;
}
override public function initialize() : void
{
super.initialize();
}
public function get down() : Boolean
{
return this._down;
}
public function set down(param1:Boolean) : void
{
this._down = param1;
this.update();
}
override protected function clickHandler(param1:MouseEvent) : void
{
this.down = !this.down;
super.clickHandler(param1);
}
private function update() : void
{
if(this._down)
{
setStyle("icon",this.downModeIcon);
toolTip = this.downToolTip;
}
else
{
setStyle("icon",this.upModeIcon);
toolTip = this.upToolTip;
}
}
private function _ModeButton_String2_i() : String
{
this.downToolTip = "null";
BindingManager.executeBindings(this,"downToolTip",this.downToolTip);
return "null";
}
private function _ModeButton_String1_i() : String
{
this.upToolTip = "null";
BindingManager.executeBindings(this,"upToolTip",this.upToolTip);
return "null";
}
public function ___ModeButton_Button1_creationComplete(param1:FlexEvent) : void
{
this.update();
}
[Bindable(event="propertyChange")]
public function get downToolTip() : String
{
return this._1023233823downToolTip;
}
public function set downToolTip(param1:String) : void
{
var loc2:Object = this._1023233823downToolTip;
if(loc2 !== param1)
{
this._1023233823downToolTip = param1;
if(this.hasEventListener("propertyChange"))
{
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"downToolTip",loc2,param1));
}
}
}
[Bindable(event="propertyChange")]
public function get upToolTip() : String
{
return this._1427000520upToolTip;
}
public function set upToolTip(param1:String) : void
{
var loc2:Object = this._1427000520upToolTip;
if(loc2 !== param1)
{
this._1427000520upToolTip = param1;
if(this.hasEventListener("propertyChange"))
{
this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"upToolTip",loc2,param1));
}
}
}
}
}

40
src/PopUpProgressBar.mxml Normal file
View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Box xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="240" height="50"
creationComplete="onCreationComplete()">
<fx:Script>
<![CDATA[
import mx.controls.ProgressBar;
import mx.controls.ProgressBarMode;
import mx.events.FlexEvent;
import mx.managers.PopUpManager;
private function onCreationComplete():void {
PopUpManager.centerPopUp(this);
progressBar.mode = ProgressBarMode.MANUAL;
}
public function setProgress(value:Number, maxValue:Number):void {
progressBar.setProgress(value, maxValue);
}
public function setLabel(label:String):void {
progressBar.label = label;
}
]]>
</fx:Script>
<!-- ProgressBar -->
<mx:ProgressBar id="progressBar"
width="200"
label="Loading"
labelPlacement="top"
minimum="0"
maximum="100"
indeterminate="false"
direction="right"
visible="true"/>
</mx:Box>

87
src/PropListPanel.mxml Normal file
View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:fx="http://ns.adobe.com/mxml/2009"
title="Props"
width="100%" height="100%"
focusEnabled="false">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.containers.Canvas;
import mx.containers.Accordion;
import mx.controls.TileList;
import mx.core.ClassFactory;
import mx.core.ScrollPolicy;
import mx.events.ListEvent;
import gui.events.PropListEvent;
import alternativa.editor.ImageItemRenderer;
private var _groupName:Array = [];
private var _group:Array = [];
private var dataProviders:Array = [];
public var selectedItem:* = null;
public function addProp(groupName:String, label:String, image:DisplayObject, obj:* = null):void {
var canvas:Canvas;
var dataProvider:ArrayCollection;
var tileList:TileList;
var groupIndex:int = _groupName.indexOf(groupName);
if (groupIndex >= 0) {
dataProvider = dataProviders[groupIndex];
} else {
canvas = new Canvas();
canvas.label = groupName;
canvas.autoLayout = true;
canvas.percentHeight = canvas.percentWidth = 100;
canvas.horizontalScrollPolicy = ScrollPolicy.OFF;
accordion.addChild(canvas);
tileList = new TileList();
tileList.percentHeight = tileList.percentWidth = 100;
tileList.focusEnabled = false;
dataProvider = new ArrayCollection();
dataProviders.push(dataProvider);
tileList.dataProvider = dataProvider;
tileList.itemRenderer = new ClassFactory(ImageItemRenderer);
tileList.addEventListener(ListEvent.ITEM_CLICK, changeSelected);
_group.push(tileList);
_groupName.push(groupName);
canvas.addChild(tileList);
}
var sprite:Sprite = new Sprite();
sprite.addChild(image);
dataProvider.addItem({
"label": label,
"image": sprite,
"obj": obj
});
}
public function deleteAllProps():void {
var tileList:TileList;
for (var i:int = 0; i < _group.length; i++) {
tileList = _group[i] as TileList;
tileList.removeEventListener(ListEvent.ITEM_CLICK, changeSelected);
}
while (accordion.numChildren > 0) {
accordion.removeChildAt(0);
}
dataProviders = [];
_group = [];
_groupName = [];
}
private function changeSelected(event:ListEvent):void {
dispatchEvent(new PropListEvent(0, event.itemRenderer.data.obj));
selectedItem = event.itemRenderer.data.obj;
}
]]>
</fx:Script>
<!-- Accordion -->
<mx:Accordion id="accordion" percentWidth="100" percentHeight="100"/>
</mx:Panel>

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="300" height="200" title="Resizable Title Window"
addedToStage="onAddedToStage(event)">
<fx:Script>
<![CDATA[
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import mx.events.SandboxMouseEvent;
import spark.components.Group;
import spark.primitives.Path;
import mx.graphics.SolidColor;
import mx.events.PropertyChangeEvent;
private var clickOffset:Point;
private var prevWidth:Number;
private var prevHeight:Number;
private var _defaultResizeHandler:Group;
private function init():void {
partAdded("resizeHandle", resizeHandle);
}
private function resizeHandle_mouseDownHandler(event:MouseEvent):void {
if (enabled && !clickOffset) {
clickOffset = new Point(event.stageX, event.stageY);
prevWidth = width;
prevHeight = height;
var loc:DisplayObject = systemManager.getSandboxRoot();
loc.addEventListener(MouseEvent.MOUSE_MOVE, resizeHandle_mouseMoveHandler, true);
loc.addEventListener(MouseEvent.MOUSE_UP, resizeHandle_mouseUpHandler, true);
loc.addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, resizeHandle_mouseUpHandler);
}
}
private function resizeHandle_mouseMoveHandler(event:MouseEvent):void {
event.stopImmediatePropagation();
if (!clickOffset) return;
width = prevWidth + (event.stageX - clickOffset.x);
height = prevHeight + (event.stageY - clickOffset.y);
event.updateAfterEvent();
}
private function resizeHandle_mouseUpHandler(event:Event):void {
clickOffset = null;
prevWidth = NaN;
prevHeight = NaN;
var loc:DisplayObject = systemManager.getSandboxRoot();
loc.removeEventListener(MouseEvent.MOUSE_MOVE, resizeHandle_mouseMoveHandler, true);
loc.removeEventListener(MouseEvent.MOUSE_UP, resizeHandle_mouseUpHandler, true);
loc.removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, resizeHandle_mouseUpHandler);
}
private function createResizeHandler():Group {
var handler:Group = new Group();
handler.right = 1;
handler.bottom = 1;
handler.width = 15;
handler.height = 15;
handler.mxmlContent = [createPath()];
handler.id = "defaultResizeHandler";
_defaultResizeHandler = handler;
return handler;
}
private function createPath():Path {
var path:Path = new Path();
path.data = "M 4 13 L 13 4 L 13 13 L 4 13";
path.fill = new SolidColor(0x000000);
return path;
}
override protected function partAdded(partName:String, instance:Object):void {
super.partAdded(partName, instance);
if (partName == "resizeHandle" && instance is Group) {
resizeHandle = instance as Group;
resizeHandle.addEventListener(MouseEvent.MOUSE_DOWN, resizeHandle_mouseDownHandler);
}
}
override protected function partRemoved(partName:String, instance:Object):void {
if (instance == resizeHandle) {
resizeHandle.removeEventListener(MouseEvent.MOUSE_DOWN, resizeHandle_mouseDownHandler);
}
super.partRemoved(partName, instance);
}
private function onAddedToStage(event:Event):void {
init();
}
]]>
</fx:Script>
<!-- Content and other components can go here -->
<s:Group id="contentGroup" width="100%" height="100%" />
<!-- Resize handle part -->
<s:Group id="resizeHandle" right="1" bottom="1" width="15" height="15"
mouseDown="resizeHandle_mouseDownHandler(event)">
<s:Path data="M 4 13 L 13 4 L 13 13 L 4 13">
<s:fill>
<mx:SolidColor color="#000000"/>
</s:fill>
</s:Path>
</s:Group>
</s:TitleWindow>

View File

@@ -0,0 +1,26 @@
package
{
import mx.binding.IWatcherSetupUtil2;
import mx.binding.PropertyWatcher;
import mx.core.IFlexModuleFactory;
public class _AlternativaEditorWatcherSetupUtil implements IWatcherSetupUtil2
{
public function _AlternativaEditorWatcherSetupUtil()
{
super();
}
public static function init(param1:IFlexModuleFactory) : void
{
AlternativaEditor.watcherSetupUtil = new _AlternativaEditorWatcherSetupUtil();
}
public function setup(param1:Object, param2:Function, param3:Function, param4:Array, param5:Array) : void
{
param5[0] = new PropertyWatcher("menuData",{"propertyChange":true},[param4[0]],param2);
param5[0].updateParent(param1);
}
}
}

View File

@@ -0,0 +1,140 @@
package
{
import flash.net.getClassByAlias;
import flash.net.registerClassAlias;
import flash.system.*;
import flash.utils.*;
import mx.accessibility.AccordionHeaderAccImpl;
import mx.accessibility.AlertAccImpl;
import mx.accessibility.ButtonAccImpl;
import mx.accessibility.CheckBoxAccImpl;
import mx.accessibility.ComboBaseAccImpl;
import mx.accessibility.ComboBoxAccImpl;
import mx.accessibility.LabelAccImpl;
import mx.accessibility.ListAccImpl;
import mx.accessibility.ListBaseAccImpl;
import mx.accessibility.PanelAccImpl;
import mx.accessibility.TitleWindowAccImpl;
import mx.accessibility.UIComponentAccProps;
import mx.collections.ArrayCollection;
import mx.collections.ArrayList;
import mx.core.IFlexModuleFactory;
import mx.core.mx_internal;
import mx.effects.EffectManager;
import mx.managers.systemClasses.ChildManager;
import mx.styles.IStyleManager2;
import mx.styles.StyleManagerImpl;
import mx.utils.ObjectProxy;
import spark.accessibility.ButtonBaseAccImpl;
import spark.accessibility.CheckBoxAccImpl;
import spark.accessibility.PanelAccImpl;
import spark.accessibility.RichEditableTextAccImpl;
import spark.accessibility.TextBaseAccImpl;
import spark.accessibility.TitleWindowAccImpl;
import spark.accessibility.ToggleButtonAccImpl;
public class _AlternativaEditor_FlexInit
{
public function _AlternativaEditor_FlexInit()
{
super();
}
public static function init(param1:IFlexModuleFactory) : void
{
var styleNames:Array;
var i:int;
var styleManager:IStyleManager2 = null;
var fbs:IFlexModuleFactory = param1;
new ChildManager(fbs);
styleManager = new StyleManagerImpl(fbs);
EffectManager.mx_internal::registerEffectTrigger("addedEffect","added");
EffectManager.mx_internal::registerEffectTrigger("closeEffect","windowClose");
EffectManager.mx_internal::registerEffectTrigger("completeEffect","complete");
EffectManager.mx_internal::registerEffectTrigger("creationCompleteEffect","creationComplete");
EffectManager.mx_internal::registerEffectTrigger("focusInEffect","focusIn");
EffectManager.mx_internal::registerEffectTrigger("focusOutEffect","focusOut");
EffectManager.mx_internal::registerEffectTrigger("hideEffect","hide");
EffectManager.mx_internal::registerEffectTrigger("itemsChangeEffect","itemsChange");
EffectManager.mx_internal::registerEffectTrigger("minimizeEffect","windowMinimize");
EffectManager.mx_internal::registerEffectTrigger("mouseDownEffect","mouseDown");
EffectManager.mx_internal::registerEffectTrigger("mouseUpEffect","mouseUp");
EffectManager.mx_internal::registerEffectTrigger("moveEffect","move");
EffectManager.mx_internal::registerEffectTrigger("removedEffect","removed");
EffectManager.mx_internal::registerEffectTrigger("resizeEffect","resize");
EffectManager.mx_internal::registerEffectTrigger("resizeEndEffect","resizeEnd");
EffectManager.mx_internal::registerEffectTrigger("resizeStartEffect","resizeStart");
EffectManager.mx_internal::registerEffectTrigger("rollOutEffect","rollOut");
EffectManager.mx_internal::registerEffectTrigger("rollOverEffect","rollOver");
EffectManager.mx_internal::registerEffectTrigger("showEffect","show");
EffectManager.mx_internal::registerEffectTrigger("unminimizeEffect","windowUnminimize");
if(Capabilities.hasAccessibility)
{
ComboBoxAccImpl.enableAccessibility();
mx.accessibility.PanelAccImpl.enableAccessibility();
ListBaseAccImpl.enableAccessibility();
mx.accessibility.TitleWindowAccImpl.enableAccessibility();
AccordionHeaderAccImpl.enableAccessibility();
ButtonBaseAccImpl.enableAccessibility();
ToggleButtonAccImpl.enableAccessibility();
ListAccImpl.enableAccessibility();
AlertAccImpl.enableAccessibility();
RichEditableTextAccImpl.enableAccessibility();
LabelAccImpl.enableAccessibility();
TextBaseAccImpl.enableAccessibility();
spark.accessibility.TitleWindowAccImpl.enableAccessibility();
spark.accessibility.PanelAccImpl.enableAccessibility();
spark.accessibility.CheckBoxAccImpl.enableAccessibility();
mx.accessibility.CheckBoxAccImpl.enableAccessibility();
ButtonAccImpl.enableAccessibility();
UIComponentAccProps.enableAccessibility();
ComboBaseAccImpl.enableAccessibility();
}
try
{
if(getClassByAlias("flex.messaging.io.ArrayCollection") != ArrayCollection)
{
registerClassAlias("flex.messaging.io.ArrayCollection",ArrayCollection);
}
}
catch(e:Error)
{
registerClassAlias("flex.messaging.io.ArrayCollection",ArrayCollection);
}
try
{
if(getClassByAlias("flex.messaging.io.ArrayList") != ArrayList)
{
registerClassAlias("flex.messaging.io.ArrayList",ArrayList);
}
}
catch(e:Error)
{
registerClassAlias("flex.messaging.io.ArrayList",ArrayList);
}
try
{
if(getClassByAlias("flex.messaging.io.ObjectProxy") != ObjectProxy)
{
registerClassAlias("flex.messaging.io.ObjectProxy",ObjectProxy);
}
}
catch(e:Error)
{
registerClassAlias("flex.messaging.io.ObjectProxy",ObjectProxy);
}
styleNames = ["lineHeight","unfocusedTextSelectionColor","kerning","iconColor","listAutoPadding","showErrorTip","textDecoration","dominantBaseline","buttonPadding","fontThickness","textShadowColor","blockProgression","textAlignLast","listStylePosition","buttonAlignment","textShadowAlpha","textAlpha","chromeColor","rollOverColor","fontSize","paragraphEndIndent","fontWeight","breakOpportunity","leading","symbolColor","renderingMode","paragraphStartIndent","layoutDirection","footerColors","contentBackgroundColor","statusTextStyleName","paragraphSpaceAfter","titleTextStyleName","digitWidth","touchDelay","ligatureLevel","firstBaselineOffset","fontLookup","paragraphSpaceBefore","fontFamily","lineThrough","alignmentBaseline","trackingLeft","fontStyle","dropShadowColor","accentColor","selectionColor","titleBarBackgroundSkin","dropdownBorderColor","disabledIconColor","textJustify","focusColor","alternatingItemColors","typographicCase","textRollOverColor","showErrorSkin","digitCase","inactiveTextSelectionColor","justificationRule","statusBarBackgroundColor","dividerColor","titleAlignment","trackingRight","leadingModel","selectionDisabledColor","letterSpacing","focusedTextSelectionColor","baselineShift","titleBarColors","fontSharpness","barColor","modalTransparencyDuration","justificationStyle","wordSpacing","listStyleType","contentBackgroundAlpha","fontAntiAliasType","textRotation","errorColor","direction","cffHinting","locale","backgroundDisabledColor","modalTransparencyColor","showPromptWhenFocused","textIndent","themeColor","clearFloats","modalTransparency","tabStops","textAlign","headerColors","textSelectedColor","interactionMode","labelWidth","whiteSpaceCollapse","fontGridFitType","statusBarBackgroundSkin","disabledColor","modalTransparencyBlur","downColor","color"];
i = 0;
while(i < styleNames.length)
{
styleManager.registerInheritingStyle(styleNames[i]);
i++;
}
}
}
}
import mx.core.TextFieldFactory;
TextFieldFactory;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
package
{
import flash.display.LoaderInfo;
import flash.system.ApplicationDomain;
import flash.system.Security;
import flash.utils.Dictionary;
import flashx.textLayout.compose.ISWFContext;
import mx.core.IFlexModule;
import mx.core.IFlexModuleFactory;
import mx.events.RSLEvent;
import mx.managers.SystemManager;
import mx.preloaders.SparkDownloadProgressBar;
public class _AlternativaEditor_mx_managers_SystemManager extends SystemManager implements IFlexModuleFactory, ISWFContext
{
private var _info:Object;
private var _preloadedRSLs:Dictionary;
private var _allowDomainParameters:Vector.<Array>;
private var _allowInsecureDomainParameters:Vector.<Array>;
public function _AlternativaEditor_mx_managers_SystemManager()
{
super();
}
override public function callInContext(param1:Function, param2:Object, param3:Array, param4:Boolean = true) : *
{
if(param4)
{
return param1.apply(param2,param3);
}
param1.apply(param2,param3);
}
override public function create(... rest) : Object
{
if(rest.length > 0 && !(rest[0] is String))
{
return super.create.apply(this,rest);
}
var loc2:String = rest.length == 0 ? "AlternativaEditor" : String(rest[0]);
var loc3:Class = Class(getDefinitionByName(loc2));
if(!loc3)
{
return null;
}
var loc4:Object = new loc3();
if(loc4 is IFlexModule)
{
IFlexModule(loc4).moduleFactory = this;
}
return loc4;
}
override public function info() : Object
{
if(!this._info)
{
this._info = {
"applicationComplete":"onApplicationComplete();",
"compiledLocales":["en_US"],
"compiledResourceBundleNames":["collections","components","containers","controls","core","effects","layout","skins","sparkEffects","styles","textLayout"],
"currentDomain":ApplicationDomain.currentDomain,
"layout":"absolute",
"mainClassName":"AlternativaEditor",
"mixins":["_AlternativaEditor_FlexInit","_AlternativaEditor_Styles","mx.managers.systemClasses.ActiveWindowManager","mx.messaging.config.LoaderConfig"],
"preloader":SparkDownloadProgressBar
};
}
return this._info;
}
override public function get preloadedRSLs() : Dictionary
{
if(this._preloadedRSLs == null)
{
this._preloadedRSLs = new Dictionary(true);
}
return this._preloadedRSLs;
}
override public function allowDomain(... rest) : void
{
var loc2:Object = null;
Security.allowDomain.apply(null,rest);
for(loc2 in this._preloadedRSLs)
{
if(Boolean(loc2.content) && "allowDomainInRSL" in loc2.content)
{
loc2.content["allowDomainInRSL"].apply(null,rest);
}
}
if(!this._allowDomainParameters)
{
this._allowDomainParameters = new Vector.<Array>();
}
this._allowDomainParameters.push(rest);
addEventListener(RSLEvent.RSL_ADD_PRELOADED,this.addPreloadedRSLHandler,false,50);
}
override public function allowInsecureDomain(... rest) : void
{
var loc2:Object = null;
Security.allowInsecureDomain.apply(null,rest);
for(loc2 in this._preloadedRSLs)
{
if(Boolean(loc2.content) && "allowInsecureDomainInRSL" in loc2.content)
{
loc2.content["allowInsecureDomainInRSL"].apply(null,rest);
}
}
if(!this._allowInsecureDomainParameters)
{
this._allowInsecureDomainParameters = new Vector.<Array>();
}
this._allowInsecureDomainParameters.push(rest);
addEventListener(RSLEvent.RSL_ADD_PRELOADED,this.addPreloadedRSLHandler,false,50);
}
private function addPreloadedRSLHandler(param1:RSLEvent) : void
{
var loc3:Array = null;
var loc2:LoaderInfo = param1.loaderInfo;
if(!loc2 || !loc2.content)
{
return;
}
if(allowDomainsInNewRSLs && Boolean(this._allowDomainParameters))
{
for each(loc3 in this._allowDomainParameters)
{
if("allowDomainInRSL" in loc2.content)
{
loc2.content["allowDomainInRSL"].apply(null,loc3);
}
}
}
if(allowInsecureDomainsInNewRSLs && Boolean(this._allowInsecureDomainParameters))
{
for each(loc3 in this._allowInsecureDomainParameters)
{
if("allowInsecureDomainInRSL" in loc2.content)
{
loc2.content["allowInsecureDomainInRSL"].apply(null,loc3);
}
}
}
}
}
}

View File

@@ -0,0 +1,24 @@
package
{
import alternativa.editor.KillZonePropertiesPanel;
import mx.binding.IWatcherSetupUtil2;
import mx.core.IFlexModuleFactory;
public class _alternativa_editor_KillZonePropertiesPanelWatcherSetupUtil implements IWatcherSetupUtil2
{
public function _alternativa_editor_KillZonePropertiesPanelWatcherSetupUtil()
{
super();
}
public static function init(param1:IFlexModuleFactory) : void
{
KillZonePropertiesPanel.watcherSetupUtil = new _alternativa_editor_KillZonePropertiesPanelWatcherSetupUtil();
}
public function setup(param1:Object, param2:Function, param3:Function, param4:Array, param5:Array) : void
{
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
src/_assets/73.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

View File

@@ -0,0 +1,18 @@
Esc — clear selection
Delete, C — delete selected prop
X, Z — rotate selected prop or cursor
K switch half cell snapping
Ctrl + = zoom in
Ctrl + - zoom out
Ctrl + 0 reset camera direction
Drag, arrows — moving selected prop or cursor
Shift + drag — copy and moving selected prop
V + drag, W, S — vertical moving
Space — paste prop
F — mirror texture
Q — select conflict props
Middle mouse button + drag — panning
Alt + middle — rotate camera
Link domination spawn point: Ctrl+Click on spawn point, then Ctrl+Click on check point
Drag&Drop folder on editor window load prop libs from all subfolders
Drag&Drop map.xml load map

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Some files were not shown because too many files have changed in this diff Show More