Hi evryone,
So, I’ve written some classes (I will be posting them soon), and I wanted them to have a good usability. I want to have code highlighting and code hints. Codehighlighting was easy and it works, but code hinting (a dropdown) is something else…
I now have an XML file in the ActionsPanel/CustomActions folder and it seems to be working, but …
This works (I get a dropdown):
var my_astar:be.dauntless.Astar.Astar = new be.dauntless.Astar.Astar();
my_astar.[/As]
This doesn't work:
import be.dauntless.Astar.*;
var my_astar:Astar = new Astar();
my_astar.
This works too:
my_astar.[/As]
And this doesn’t work either:
import be.dauntless.Astar.*;
var my_astar:Astar = new Astar();
my_astar.[/As]
So... It DOES work if I use the full class path and It does work if I don't specify a variable type...
I hope it's clear... It's quite hard to explain...
What I want is that I get a dropdown when I type this:
import be.dauntless.Astar.*;
var anyVariableName:Astar = new Astar();
anyVariableName.
Greets!
Heres the XML: (I’m not editing my previous post, 'cause the post editor really sucks!)
<customactions>
<actionspanel>
<folder name="Astar" id="Dauntless' Astar pathfinding classes" index="true" tiptext="Astar pathfinding classes" helpid="" version="1.0">
<folder name="Astar" id="[be.dauntless.Astar.Astar]" index="true" tiptext="The prossessing class" helpid="" version="1.0">
<folder name="Properties" id="Properties" tiptext="Astar properties" version="1.0">
<string name="standardCost" tiptext="The standard cost of the tile. The more acurate is, the better A* will work" helpid="" text=".standardCost" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="diagonalCost" tiptext="The diagonal cost of the tile. The more acurate is, the better A* will work" helpid="" text=".diagonalCost" object="[be.dauntless.Astar.Astar]" version="1.0"/>
</folder>
<folder name="Methods" id="Methods" tiptext="Astar methods" version="1.0" index="true">
<string name="new Astar" tiptext="Constructor" helpid="" text="new Astar(% %);" object="" version="1.0"/>
<string name="setMap" tiptext="Set the map for the engine" helpid="" text=".setMap(% _map:Array %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="newMap" tiptext="Build a new Map" helpid="" text=".newMap(% w:Number, h:Number %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="setStartPoint" tiptext="Set the starting point (player position) for the engine" helpid="" text=".setStartPoint(% x:Number, y:Number %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="setClipping" tiptext="Set the clipping mode." helpid="" text=".setClipping(% cl:String %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="setEndPoint" tiptext="Set the ending point (final player position) for engine" helpid="" text=".setEndPoint(% x:Number, y:Number %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="findPath" tiptext="find a path from the startPoint to the endPoint in the given map" helpid="" text=".findPath(% %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="findSurroundingTiles" tiptext="find the surrounding tiles of the given tile. " helpid="" text=".findSurroundingTiles(% current:Tile %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="ready" tiptext="Check whether or not all the settings are correct" helpid="" text=".ready(% %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="setWalkable" tiptext="Set the tile to be walkable or not" helpid="" text=".setWalkable(% x:Number, y:Number, b:Boolean %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="toggleWalkable" tiptext="Toggle the tile to be walkable or not" helpid="" text=".toggleWalkable(% x:Number, y:Number %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="openMap" tiptext="Opens the map (resets all the tiles)" helpid="" text=".openMap(% %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="setStandardCost" tiptext="Sets the standard cost for the map." helpid="" text=".setStandardCost(% c:Number %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
<string name="setDiagonalCost" tiptext="Sets the extra cost for going diagonal." helpid="" text=".setDiagonalCost(% c:Number %);" object="[be.dauntless.Astar.Astar]" version="1.0"/>
</folder>
</folder>
<folder name="BinaryHeap" id="[be.dauntless.Astar.BinaryHeap]" index="true" tiptext="The binary heap class" helpid="" version="1.0">
<folder name="Methods" id="Methods" tiptext="binary heap's methods" version="1.0">
<string name="new BinaryHeap" tiptext="Constructor; makes a new heap array" helpid="" text="new BinaryHeap(% %);" object="" version="1.0"/>
<string name="addToHeap" tiptext="Adds a tile to the binary heap" helpid="" text=".addToHeap(% newTile:Tile %);" object="[be.dauntless.Astar.BinaryHeap]" version="1.0"/>
<string name="getLowest" tiptext="This method returns the lowest F from the heap. That F is deleted from the heap" helpid="" text=".getLowest(% %);" object="[be.dauntless.Astar.BinaryHeap]" version="1.0"/>
<string name="getLength" tiptext="This method returns the length of the heap" helpid="" text=".getLength(% %);" object="[be.dauntless.Astar.BinaryHeap]" version="1.0"/>
<string name="getPosition" tiptext="This method returns the position of the given ID in the heap" helpid="" text=".getPosition(% id %);" object="[be.dauntless.Astar.BinaryHeap]" version="1.0"/>
<string name="updateList" tiptext="This method changes the given tiles f in the heap and resorts it." helpid="" text=".updateList(% cp_ %);" object="[be.dauntless.Astar.BinaryHeap]" version="1.0"/>
</folder>
</folder>
<folder name="Tile" id="[be.dauntless.Astar.Tile]" index="true" tiptext="The tile class" helpid="" version="1.0">
<folder name="Constants" id="Constants" tiptext="The class properties" version="1.0">
<string name="count" tiptext="" helpid="" text="Tile.count" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="ids" tiptext="" helpid="" text="Tile.ids" object="[be.dauntless.Astar.Tile]" version="1.0"/>
</folder>
<folder name="Properties" id="Properties" tiptext="Tile properties" version="1.0">
<string name="inOpen" tiptext="" helpid="" text=".inOpen" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="closed" tiptext="" helpid="" text=".closed" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="parent" tiptext="" helpid="" text=".parent" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="gUp" tiptext="" helpid="" text=".gUp" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="h" tiptext="" helpid="" text=".h" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="g" tiptext="" helpid="" text=".g" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="cost" tiptext="" helpid="" text=".cost" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="x" tiptext="" helpid="" text=".x" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="y" tiptext="" helpid="" text=".y" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="id" tiptext="" helpid="" text=".id" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="walkable" tiptext="" helpid="" text=".walkable" object="[be.dauntless.Astar.Tile]" version="1.0"/>
</folder>
<folder name="Methods" id="Methods" tiptext="Tile methods" version="1.0">
<string name="new Tile" tiptext="Constructor. Set the x, y and cost of the tile" helpid="" text="new Tile(% xp:Number, yp:Number %);" object="" version="1.0"/>
<string name="setWalkable" tiptext="Set the ability to walk on this the tile" helpid="" text=".setWalkable(% b:Boolean %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="setOpen" tiptext="Set this tile to be in the open-array. This is used by the findPath method of the Astar class." helpid="" text=".setOpen(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="setClosed" tiptext="Set this tile to be in the closed-array. This is used by the findPath method of the Astar class." helpid="" text=".setClosed(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="isClosed" tiptext="returns whether or not the tile is in the closed list." helpid="" text=".isClosed(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="getOpen" tiptext="returns whether or not the tile is in the open list." helpid="" text=".getOpen(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="setParent" tiptext="sets the parent of the node" helpid="" text=".setParent(% t:Tile %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="getParent" tiptext="returns the parent of the node" helpid="" text=".getParent(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="setH" tiptext="sets the H for the node. H is calculated with the manhatten method." helpid="" text=".setH(% ex:Number, ey:Number %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="setG" tiptext="Sets the G (cost) for the tile" helpid="" text=".setG(% _g:Number %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="getF" tiptext="Returns the F of the tile (F = G + H)" helpid="" text=".getF(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="getH" tiptext="Returns the H of the tile" helpid="" text=".getH(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="setCost" tiptext="Set the cost for the tile" helpid="" text=".setCost(% _cost:Number %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="getG" tiptext="get the G (cost) of the tile" helpid="" text=".getG(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="getCost" tiptext="Returns the cost for the tile" helpid="" text=".getCost(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="toggleWalkable" tiptext="Toggles the ability to walk on the tile" helpid="" text=".toggleWalkable(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="reset" tiptext="This method resets the tile for further use" helpid="" text=".reset(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="costUp" tiptext="This method tells the node that its being accessed diagonally" helpid="" text=".costUp(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="costDown" tiptext="This method tells the node that its NOT being accessed diagonally" helpid="" text=".costDown(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
<string name="notice" tiptext="This method is called by A*. It tells the tile that its in the found path. This can be used when you extend the tile class." helpid="" text=".notice(% %);" object="[be.dauntless.Astar.Tile]" version="1.0"/>
</folder>
</folder>
<folder name="Types" id="Types" index="true" tiptext="Types that can be used for strong typing">
<string name="Astar" tiptext="Astar type" text="Astar" />
<string name="BinaryHeap" tiptext="BinaryHeap type" text="BinaryHeap" />
<string name="Tile" tiptext="Tile type" text="Tile" />
</folder>
</folder>
</actionspanel>
<colorsyntax>
<identifier text="Astar" />
<identifier text="BinaryHeap" />
<identifier text="standardCost"/>
<identifier text="diagonalCost"/>
<identifier text="setMap"/>
<identifier text="newMap"/>
<identifier text="setStartPoint"/>
<identifier text="setClipping"/>
<identifier text="setEndPoint"/>
<identifier text="findPath"/>
<identifier text="findSurroundingTiles"/>
<identifier text="ready"/>
<identifier text="setWalkable"/>
<identifier text="toggleWalkable"/>
<identifier text="openMap"/>
<identifier text="setStandardCost"/>
<identifier text="setDiagonalCost"/>
<identifier text="addToHeap"/>
<identifier text="getLowest"/>
<identifier text="getLength"/>
<identifier text="getPosition"/>
<identifier text="updateList"/>
<identifier text="count"/>
<identifier text="inOpen"/>
<identifier text="closed"/>
<identifier text="parent"/>
<identifier text="ids"/>
<identifier text="gUp"/>
<identifier text="h"/>
<identifier text="g"/>
<identifier text="cost"/>
<identifier text="x"/>
<identifier text="y"/>
<identifier text="id"/>
<identifier text="walkable"/>
<identifier text="Tile"/>
<identifier text="setWalkable"/>
<identifier text="setOpen"/>
<identifier text="setClosed"/>
<identifier text="isClosed"/>
<identifier text="getOpen"/>
<identifier text="setParent"/>
<identifier text="getParent"/>
<identifier text="setH"/>
<identifier text="setG"/>
<identifier text="getF"/>
<identifier text="getH"/>
<identifier text="setCost"/>
<identifier text="getG"/>
<identifier text="getCost"/>
<identifier text="toggleWalkable"/>
<identifier text="reset"/>
<identifier text="costUp"/>
<identifier text="costDown"/>
<identifier text="notice"/>
</colorsyntax>
<codehints>
<typeinfo pattern="*_astar" object="be.dauntless.Astar.Astar" />
<typeinfo pattern="Astar" object="be.dauntless.Astar.Astar" />
<typeinfo pattern="be.dauntless.Astar.Astar" object="be.dauntless.Astar.Astar">
<typeinfo pattern="*_tile" object="be.dauntless.Astar.Tile" />
<typeinfo pattern="Tile" object="be.dauntless.Astar.Tile" />
<typeinfo pattern="be.dauntless.Astar.Tile" object="be.dauntless.Astar.Tile">
<typeinfo pattern="BinaryHeap" object="be.dauntless.Astar.BinaryHeap" />
<typeinfo pattern="*_bh" object="be.dauntless.Astar.Binaryheap" />
<typeinfo pattern="be.dauntless.Astar.BinaryHeap" object="be.dauntless.Astar.BinaryHeap">
</codehints>
</customactions>