~mdw
/
rocl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow C-u to erase an entry box. Disallow coinicident planet choice in
[rocl]
/
elite-editor
diff --git
a/elite-editor
b/elite-editor
index
e92578e
..
46c689d
100755
(executable)
--- a/
elite-editor
+++ b/
elite-editor
@@
-1,6
+1,6
@@
#! /usr/bin/wish
#
#! /usr/bin/wish
#
-# $Id: elite-editor,v 1.
6 2003/03/02 12:28:14
mdw Exp $
+# $Id: elite-editor,v 1.
7 2003/03/03 10:38:08
mdw Exp $
package require "elite" "1.0.0"
package require "elite" "1.0.0"
@@
-272,11
+272,11
@@
proc show-shortest-path {seq weight} {
# --- Planet information box ---
# --- Planet information box ---
-proc
do-getinfo {tag seq x y
} {
+proc
show-worldinfo {tag p
} {
global economy government
upvar \#0 info-$tag info
set tl .world-info-$tag
global economy government
upvar \#0 info-$tag info
set tl .world-info-$tag
- elite-worldinfo info
[find-click $seq $x $y]
+ elite-worldinfo info
$p
if {[winfo exists $tl]} {
# raise $tl
} else {
if {[winfo exists $tl]} {
# raise $tl
} else {
@@
-323,6
+323,10
@@
proc do-getinfo {tag seq x y} {
$tl.desc configure -state disabled
}
$tl.desc configure -state disabled
}
+proc do-getinfo {tag seq x y} {
+ show-worldinfo $tag [find-click $seq $x $y]
+}
+
# --- Messing with selections ---
proc to-ly {seq x} {
# --- Messing with selections ---
proc to-ly {seq x} {
@@
-407,17
+411,30
@@
proc select-byname {seq name seed proc} {
set p [parse-planet-spec $map(galaxy) $map($name)]
if {![string equal $p ""] && [in-galaxy-p $map(galaxy) $p]} {
$proc $seq $p
set p [parse-planet-spec $map(galaxy) $map($name)]
if {![string equal $p ""] && [in-galaxy-p $map(galaxy) $p]} {
$proc $seq $p
+ return 1
} elseif {[info exists map($seed)]} {
bell
set map($name) [worldname $map($seed)]
} elseif {[info exists map($seed)]} {
bell
set map($name) [worldname $map($seed)]
+ return 0
} else {
bell
set map($name) ""
} else {
bell
set map($name) ""
+ return 0
+ }
+}
+
+proc info-byname {seq name seed proc} {
+ upvar \#0 map-$seq map
+ if {[select-byname $seq $name $seed $proc]} {
+ show-worldinfo $seed $map($seed)
}
}
proc set-selection {seq p} {
upvar \#0 map-$seq map
}
}
proc set-selection {seq p} {
upvar \#0 map-$seq map
+ if {[info exists map(cmdr)]} {
+ set p [cmdr-set-world $map(cmdr) $p]
+ }
set map(select) $p
elite-worldinfo pp $p
select-world $seq
set map(select) $p
elite-worldinfo pp $p
select-world $seq
@@
-427,9
+444,6
@@
proc set-selection {seq p} {
} else {
set-destination $seq $map(dest)
}
} else {
set-destination $seq $map(dest)
}
- if {[info exists map(cmdr)]} {
- cmdr-set-world $map(cmdr) $p
- }
}
proc do-select {seq x y} {
}
proc do-select {seq x y} {
@@
-660,13
+674,17
@@
proc map-new {ng g} {
bind $tl.map <3> [list do-select $seq %x %y]
bind $tl.map <1> [list do-destination $seq %x %y]
bind $tl.map <Double-1> [list do-getinfo dest $seq %x %y]
bind $tl.map <3> [list do-select $seq %x %y]
bind $tl.map <1> [list do-destination $seq %x %y]
bind $tl.map <Double-1> [list do-getinfo dest $seq %x %y]
- bind $tl.map <Double-3> [list do-getinfo
home
$seq %x %y]
+ bind $tl.map <Double-3> [list do-getinfo
select
$seq %x %y]
map-set-title $seq
entry-on-change $tl.info.home \
[list select-byname $seq sel-name select set-selection]
entry-on-change $tl.info.dest \
[list select-byname $seq dest-name dest set-destination]
map-set-title $seq
entry-on-change $tl.info.home \
[list select-byname $seq sel-name select set-selection]
entry-on-change $tl.info.dest \
[list select-byname $seq dest-name dest set-destination]
+ bind $tl.info.home <Control-Return> \
+ [list info-byname $seq sel-name select set-selection]
+ bind $tl.info.dest <Control-Return> \
+ [list info-byname $seq dest-name dest set-destination]
map-setscale $seq $sc
return $seq
}
map-setscale $seq $sc
return $seq
}
@@
-804,12
+822,20
@@
proc cmdrdb-custom {seq tag} {
proc cmdr-set-world {seq p} {
upvar \#0 cmdr-$seq cmdr
proc cmdr-set-world {seq p} {
upvar \#0 cmdr-$seq cmdr
+ upvar \#0 ww-$cmdr(gal-seed) ww
elite-worldinfo i $p
elite-worldinfo i $p
- set cmdr(world-seed) $p
+ set pp [nearest-planet $ww $i(x) $i(y)]
+ if {![string equal $p $pp]} {
+ set n $i(name)
+ elite-worldinfo i $pp
+ moan "world $n is coincident with $i(name); substituting"
+ }
+ set cmdr(world-seed) $i(seed)
set cmdr(world-name) $i(name)
set cmdr(world-x) [expr {$i(x)/4}]
set cmdr(world-y) [expr {$i(y)/2}]
cmdr-set-fluc $seq
set cmdr(world-name) $i(name)
set cmdr(world-x) [expr {$i(x)/4}]
set cmdr(world-y) [expr {$i(y)/2}]
cmdr-set-fluc $seq
+ return $i(seed)
}
proc cmdr-update-world {seq} {
}
proc cmdr-update-world {seq} {
@@
-1164,6
+1190,8
@@
proc cmdr-new {} {
wm withdraw .
wm withdraw .
+bind Entry <Control-u> { %W delete 0 end }
+
if {[llength $argv]} {
foreach a $argv {
switch -glob -- $a {
if {[llength $argv]} {
foreach a $argv {
switch -glob -- $a {