From: <man...@us...> - 2010-09-26 10:29:51
|
Revision: 11689 http://openmsx.svn.sourceforge.net/openmsx/?rev=11689&view=rev Author: manuelbi Date: 2010-09-26 10:29:45 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Fix initial slot and do not hardcode the number of slots where it is not necessary Modified Paths: -------------- openmsx/trunk/share/scripts/tas_tools.tcl Modified: openmsx/trunk/share/scripts/tas_tools.tcl =================================================================== --- openmsx/trunk/share/scripts/tas_tools.tcl 2010-09-25 21:59:24 UTC (rev 11688) +++ openmsx/trunk/share/scripts/tas_tools.tcl 2010-09-26 10:29:45 UTC (rev 11689) @@ -64,7 +64,7 @@ ### Very basic replay slot selector ### -user_setting create string current_replay_slot "Name of the current replay slot." slot1 +user_setting create string current_replay_slot "Name of the current replay slot." slot0 proc list_slots {} { set slots [list] @@ -77,15 +77,15 @@ proc menu_create_slot_menu {} { set items [list_slots] set menu_def \ - { execute tas::set_slot - font-size 8 - border-size 2 - width 100 - xpos 100 - ypos 100 - header { text "Select Replay Slot" - font-size 10 - post-spacing 6 }} + { execute tas::set_slot + font-size 8 + border-size 2 + width 100 + xpos 100 + ypos 100 + header { text "Select Replay Slot" + font-size 10 + post-spacing 6 }} return [osd_menu::prepare_menu_list $items 10 $menu_def] } @@ -98,13 +98,13 @@ proc open_select_slot_menu {} { osd_menu::do_menu_open [menu_create_slot_menu] osd_menu::select_menu_item $::current_replay_slot - for {set i 0} {$i <= 9} {incr i} { + for {set i 0} {$i < [llength [tas::list_slots]]} {incr i} { bind_default "$i" "tas::set_slot [lindex [tas::list_slots] $i]; tas::unbind_number_keys" } } proc unbind_number_keys {} { - for {set i 0} {$i <= 9} {incr i} { + for {set i 0} {$i < [llength [tas::list_slots]]} {incr i} { unbind_default "$i" } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |