Changeset 1031
- Timestamp:
- 09/11/09 05:40:45 (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
modules/abstract.tcl (modified) (5 diffs)
-
modules/abstracts/en/randomstuff.tcl (modified) (4 diffs)
-
plugins/en/output_VAR.tcl (modified) (4 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" -
trunk/modules/abstracts/en/randomstuff.tcl
r1027 r1031 24 24 "Check out my %VAR{bodypart:plural}" 25 25 "I have expendable %VAR{bodypart:plural}" 26 "I have expandable %VAR{bodypart:plural}" 26 27 "%BOT[The Ambassador's receptions are noted in society for their host's exquisite taste that captivates his guests.]%|Monsieur, with this %VAR{sillyThings:strip} you are really spoiling us!" 27 28 "where there's a snack gap, a %VAR{PROM} fits" … … 207 208 208 209 "WHOOSH *DONG*" 209 "i'm awash with %VAR{bodypart }s"210 "i'm awash with %VAR{bodypart:plural}" 210 211 "I feel a great disatisfaction within my bowels." 211 212 "Pardon me. Do you have any grey poupon?" … … 372 373 "i'm giving up evil science and taking up even gardening instead" 373 374 "noooo! enormous naked buttocks heading towards my head!%|i'm being simultaneously crushed and embarrassed to death" 374 "yay! %VAR{bodypart }s!"375 "yay! %VAR{bodypart:plural}!" 375 376 } 376 377 … … 380 381 ### Mixed in with list above 381 382 bMotion_abstract_register "randomStuff_male" { 383 "I always thought the most sensual part of a woman was the %VAR{bodypart:revmixin}" 382 384 "Looks like the squirrel's been showing everyone where he keeps his nuts." 383 385 "You wanna see some stuff I'm not supposed to show anyone?" -
trunk/plugins/en/output_VAR.tcl
r1029 r1031 24 24 proc bMotion_plugin_output_VAR { channel line } { 25 25 bMotion_putloglev 4 * "bMotion_plugin_output_VAR $channel $line" 26 global BMOTION_MIXIN_NONE BMOTION_MIXIN_REVERSE BMOTION_MIXIN_DEFAULT 26 27 27 28 set line [string map { "%noun" "%VAR{sillyThings}" } $line] … … 30 31 regsub {%VAR\{([^\}]+)\}\{strip\}} $line "%VAR{\\1:strip}" line 31 32 32 if {[regexp -nocase {(%VAR\{([^\}:]+)(: [^\}]+)?\}(\{strip\})?)} $line matches whole_thing abstractoptions clean]} {33 if {[regexp -nocase {(%VAR\{([^\}:]+)(:([^\}]+))?\}(\{strip\})?)} $line matches whole_thing abstract 1 options clean]} { 33 34 global $abstract 35 36 bMotion_putloglev 1 * "options for $abstract are $options" 37 38 # check options 39 if {$options != ""} { 40 set options_list [split $options ","] 41 } else { 42 set options_list [list] 43 } 44 bMotion_putloglev 1 * "options list is $options_list" 45 46 if {$clean == "{strip}"} { 47 lappend options_list "clean" 48 } 49 50 set mixin_type $BMOTION_MIXIN_DEFAULT 51 52 if {[lsearch $options_list "revmixin"] > -1} { 53 bMotion_putloglev 1 * "mixin type for $abstract is reverse" 54 set mixin_type $BMOTION_MIXIN_REVERSE 55 } elseif {[lsearch $options_list "nomixin"] > -1} { 56 bMotion_putloglev 1 * "mixin type for $abstract is none" 57 set mixin_type $BMOTION_MIXIN_NONE 58 } 59 34 60 #see if we have a new-style abstract available 35 set newText [bMotion_abstract_get $abstract ]61 set newText [bMotion_abstract_get $abstract $mixin_type] 36 62 set replacement "" 37 63 if {$newText == ""} { … … 49 75 } 50 76 51 # check options52 set options [string range $options 1 end]53 if {$options != ""} {54 set options_list [split $options ","]55 } else {56 set options_list [list]57 }58 59 if {$clean == "{strip}"} {60 lappend options_list "clean"61 }62 77 63 78 if {[lsearch $options_list "strip"] == -1} { … … 131 146 } 132 147 148 133 149 bMotion_plugin_add_output "VAR" bMotion_plugin_output_VAR 1 "en" 3
Note: See TracChangeset
for help on using the changeset viewer.
