Changeset 1031 for trunk/modules/abstract.tcl
- Timestamp:
- 09/11/09 05:40:45 (3 years ago)
- File:
-
- 1 edited
-
trunk/modules/abstract.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/abstract.tcl
r1026 r1031 66 66 # fileformat is simply one per line. 67 67 68 # default = mixin own gender 69 # reverse = mixin opposite gender 70 # none = don't mixin at all 71 set BMOTION_MIXIN_DEFAULT 0 72 set BMOTION_MIXIN_REVERSE 1 73 set BMOTION_MIXIN_NONE 2 74 68 75 if { [bMotion_setting_get "abstractMaxAge"] != "" } { 69 76 set bMotion_abstract_max_age [bMotion_setting_get "abstractMaxAge"] … … 340 347 341 348 set contents [bMotion_abstract_all $abstract] 342 putlog $contents343 349 344 350 if {[llength $contents] == 0} { … … 366 372 } 367 373 368 proc bMotion_abstract_get { abstract } {369 bMotion_putloglev 5 * "bMotion_abstract_get ($abstract )"374 proc bMotion_abstract_get { abstract { mixin_type 0 } } { 375 bMotion_putloglev 5 * "bMotion_abstract_get ($abstract $mixin_type)" 370 376 global bMotion_abstract_contents bMotion_abstract_timestamps bMotion_abstract_max_age bMotion_abstract_last_get bMotionInfo 371 377 … … 388 394 389 395 # look for male and female versions, and merge in if needed 390 if [bMotion_abstract_exists "${abstract}_$bMotionInfo(gender)"] { 391 # mix-in the gender one with the vanilla one 392 bMotion_putloglev 1 * "mixing in $bMotionInfo(gender) version of $abstract" 393 set final_version [concat [bMotion_abstract_all $abstract] [bMotion_abstract_all "${abstract}_$bMotionInfo(gender)"]] 394 } else { 395 set final_version [bMotion_abstract_all $abstract] 396 } 397 396 set final_version [bMotion_abstract_all $abstract] 397 switch $mixin_type { 398 0 { 399 if [bMotion_abstract_exists "${abstract}_$bMotionInfo(gender)"] { 400 # mix-in the gender one with the vanilla one 401 bMotion_putloglev 1 * "mixing in $bMotionInfo(gender) version of $abstract" 402 set final_version $final_version [bMotion_abstract_all "${abstract}_$bMotionInfo(gender)"]] 403 } else { 404 set final_version [bMotion_abstract_all $abstract] 405 } 406 } 407 1 { 408 if {[bMotion_setting_get "gender"] == "male"} { 409 set gender "female" 410 } else { 411 set gender "male" 412 } 413 if [bMotion_abstract_exists "${abstract}_$gender"] { 414 # mix-in the gender one with the vanilla one 415 bMotion_putloglev 1 * "mixing in $gender version of $abstract" 416 set final_version [concat $final_version [bMotion_abstract_all "${abstract}_$gender"]] 417 } else { 418 set final_version [bMotion_abstract_all $abstract] 419 } 420 } 421 2 { 422 # noop, we did it already before the switch 423 } 424 default { 425 putlog "bMotion ERROR: unknown mixin type $mixin_type for abstract $abstract" 426 } 427 } 398 428 399 429 if {[llength $final_version] == 0} { … … 634 664 bMotion_abstract_revive_language 635 665 666 636 667 bMotion_putloglev d * "abstract module loaded"
Note: See TracChangeset
for help on using the changeset viewer.
