20 namespace eval ::move {}
22 proc ::move::drawVarArrows {} {
23 if {! $::showVarArrows || $::autoplayMode ||
24 ([
info exists ::playMode] && [
eval "$::playMode drawVarArrows"] == 0)} {
29 set varList [
sc_var list UCI]
32 set move [
sc_game info nextMoveUCI]
33 if {$move != ""} {
set varList [
linsert $varList 0 $move]}
34 foreach { move } $varList {
36 set sq_start [
::board::sq [
string range $move 0 1]]
38 foreach mark $::board::_mark(.main.board) {
39 if { [
lindex $mark 0] == "arrow" } {
40 if {[
lindex $mark 1] == $sq_start && [
lindex $mark 2] == $sq_end} {
46 if {! $bDrawn } {
set bDrawArrow 1 break}
53 proc ::move::showVarArrows {} {
54 set move [
sc_game info nextMoveUCI]
56 set sq_start [
::board::sq [
string range $move 0 1]]
60 set varList [
sc_var list UCI]
61 foreach { move } $varList {
62 set sq_start [
::board::sq [
string range $move 0 1]]
68 proc ::move::Start {} {
69 if {[
info exists ::playMode] && [
eval "$::playMode moveStart"] == 0} {
78 if {[
info exists ::playMode] && [
eval "$::playMode moveEnd"] == 0} {
86 proc ::move::ExitVar {} {
87 if {[
sc_var level] == 0 } {
return 0 }
88 if {[
info exists ::playMode] && [
eval "$::playMode moveExitVar"] == 0} {
96 proc ::move::Back {{count 1}} {
97 if {[
sc_pos isAt start]} {
return}
99 if {[
info exists ::playMode] && [
eval "$::playMode moveBack"] == 0} {
117 proc ::move::Forward {{count 1}} {
119 if {[
info exists ::playMode] && [
eval "$::playMode moveForward"] == 0} {
127 if {[
sc_var count] != 0 && ! $::autoplayMode && $::showVarPopup} {
129 set bArrows $::showVarArrows
131 if {! $bArrows} {
sc_move forward}
138 if {! $bArrows} {
sc_move forward $count}
146 proc ::move::Follow {{moveUCI}} {
147 if {$moveUCI != "null"} {
148 set moveUCI2 "[
string range $moveUCI 2 3][
string range $moveUCI 0 1][
string range $moveUCI 4 end]"
152 set varList [
sc_var list UCI]
153 set varList [
linsert $varList 0 "[
sc_game info nextMoveUCI]"]
155 foreach {move} $varList {
156 if { [
string compare -nocase $moveUCI $move] == 0 || \
157 [
string compare -nocase $moveUCI2 $move] == 0 } {
170 proc ::move::PGNOffset { location } {