remove lock

This commit is contained in:
2018-11-25 21:49:33 -05:00
parent 67c0680681
commit 87a3d3f116
3 changed files with 5 additions and 16 deletions

View File

@@ -28,20 +28,16 @@ class ActionView(val interp: Interpreter, val codeView: CodeView, val ioView: IO
} }
button("reset") { button("reset") {
enableWhen(codeView.lockedProperty)
setOnAction { setOnAction {
interp.reset() interp.reset()
ioView.reset() ioView.reset()
codeView.src = interp.funge.toString() codeView.src = interp.funge.toString()
codeView.locked = false
} }
} }
button("run") { button("run") {
setOnAction { setOnAction {
interp.funge.setString(codeView.src) interp.funge.setString(codeView.src)
codeView.locked = true
runTimeline.rate = 10000.0 runTimeline.rate = 10000.0
runTimeline.playFromStart() runTimeline.playFromStart()
} }
@@ -50,7 +46,6 @@ class ActionView(val interp: Interpreter, val codeView: CodeView, val ioView: IO
button("walk") { button("walk") {
setOnAction { setOnAction {
interp.funge.setString(codeView.src) interp.funge.setString(codeView.src)
codeView.locked = true
runTimeline.rate = 50.0 runTimeline.rate = 50.0
runTimeline.playFromStart() runTimeline.playFromStart()
} }
@@ -59,7 +54,6 @@ class ActionView(val interp: Interpreter, val codeView: CodeView, val ioView: IO
button("crawl") { button("crawl") {
setOnAction { setOnAction {
interp.funge.setString(codeView.src) interp.funge.setString(codeView.src)
codeView.locked = true
runTimeline.rate = 4.0 runTimeline.rate = 4.0
runTimeline.playFromStart() runTimeline.playFromStart()
} }

View File

@@ -19,9 +19,6 @@ class CodeView(val interp: Interpreter) : View() {
val cursorDeltaProperty = SimpleObjectProperty<Vec>(Vec(1, 0)) val cursorDeltaProperty = SimpleObjectProperty<Vec>(Vec(1, 0))
var cursorDelta by cursorDeltaProperty var cursorDelta by cursorDeltaProperty
val lockedProperty = SimpleBooleanProperty(false)
var locked by lockedProperty
var labels: List<List<CodeLabel>> = List(25) { y -> List(80) { x -> CodeLabel(Vec(x, y), cursorPosProperty, interp) } } var labels: List<List<CodeLabel>> = List(25) { y -> List(80) { x -> CodeLabel(Vec(x, y), cursorPosProperty, interp) } }
init { init {
@@ -97,8 +94,6 @@ class CodeView(val interp: Interpreter) : View() {
} }
setOnKeyTyped { setOnKeyTyped {
if (locked) return@setOnKeyTyped
for (ch in it.character) { for (ch in it.character) {
when { when {
!ch.isISOControl() -> { !ch.isISOControl() -> {

View File

@@ -23,12 +23,12 @@ class EditorView : View("Befide") {
} }
init { init {
codeView.src = """>84*>:#v_55+"ude.ub@yelruta">:#,_@>188*+>\02p\12p\:22p#v_${'$'} 55+,1- v codeView.src = """ 2>:3g" "-!v\ g30 <
^ 0 v +1\ _^#-+*< >22g02g*"_@"*-!1- #v_v> |!`"O":+1_:.:03p>03g+:"O"`|
>:>::3g: ,\188 ^^ -1\g21\g22<p3\"_":< @ ^ p3\" ":<
________________________________@_________________________________^ p3\"@":<""" 2 234567890123456789012345678901234567890123456789012345678901234567890123456789"""
// codeView.src = """"hello world",,,,,,,,,,@""" // codeView.src = """"hello world",,,,,,,,,,,@"""
} }
override fun onDock() { override fun onDock() {