Add Actuate -> Inspect tool.

master
Anthony Zhang 2012-08-03 22:41:11 -04:00
parent 105fa41407
commit 0807e8dd26
2 changed files with 26 additions and 16 deletions

View File

@ -2,7 +2,6 @@
;wip: multiple simultaneous viewports with independent views
;wip: undo/redo
;wip: component count in status bar - nodes used in selection, in total, as well as info such as hovered node class and state
;wip: selection filling/moving/copying/pasting
/*
@ -253,7 +252,7 @@ Gui, About:Add, Picture, x10 y10 w140 h140, % A_IsCompiled ? A_ScriptFullPath :
Gui, About:Font, s48, Arial
Gui, About:Add, Text, x170 y10 w400 h70, MeseconEdit
Gui, About:Font, s8 Bold
Gui, About:Add, Text, x170 y80 w200 h20, v1.6 Stable
Gui, About:Add, Text, x170 y80 w200 h20, v1.7 Stable
Gui, About:Font, s12 Norm
Gui, About:Add, Link, x170 y110 w400 h20, Licensed under the <a href="http://www.gnu.org/licenses/">GNU Affero General Public License</a>.
Gui, About:Font, s8
@ -383,19 +382,6 @@ While, GetKeyState("RButton","P")
}
Return
Space::
While, GetKeyState("Space","P")
{
GetMouseCoordinates(Width,Height,MouseX,MouseY)
Node := Grid[MouseX][MouseY]
If Node
ToolTip % "Type: " . Node.__Class . "`nState: " . Node.State
Else
ToolTip
Sleep, 100
}
Return
DisplayClick:
Gui, Main:Submit, NoHide
For Index, Tool In Tools

View File

@ -4,7 +4,7 @@ class Actuate
{
Select()
{
Return, ["Punch","Walk Over"]
Return, ["Punch","Walk Over","Inspect"]
}
Activate(Grid)
@ -18,5 +18,29 @@ class Actuate
Cell.Punch()
Else If (Action = "Walk Over")
Cell.WalkOver()
Else If (Action = "Inspect")
{
If Cell
{
Count := 0
For IndexX, Column In Grid
{
For IndexY, Node In Column
{
If Node.__Class = Cell.__Class
Count ++
}
}
}
Else ;node is blank
Count := "infinity"
Info := "Node:`t`t" . (Cell ? Cell.__Class : "(None)")
. "`nPosition:`t`t(" . MouseX . "," . MouseY . ",0)"
. "`nAmount:`t`t1 of " . Count
. "`nState:`t`t" . (Cell.HasKey("State") ? Cell.State : "(None)")
ToolTip, %Info%,,, 20
KeyWait, LButton
ToolTip,,,, 20
}
}
}