Edit order of commands in pbMessageDisplay to fix light text assignment (#40)

This commit is contained in:
Marc L
2020-10-15 21:45:00 +01:00
committed by GitHub
parent 5c4c0f4e35
commit da5c9680d4

View File

@@ -1041,6 +1041,15 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
text.gsub!(/\\pog/i,"")
text.gsub!(/\\b/i,"<c3=3050C8,D0D0C8>")
text.gsub!(/\\r/i,"<c3=E00808,D0D0C8>")
text.gsub!(/\\[Ww]\[([^\]]*)\]/) {
w = $1.to_s
if w==""
msgwindow.windowskin = nil
else
msgwindow.setSkin("Graphics/Windowskins/#{w}",false)
end
next ""
}
isDarkSkin = isDarkWindowskin(msgwindow.windowskin)
text.gsub!(/\\[Cc]\[([0-9]+)\]/) {
m = $1.to_i
@@ -1071,7 +1080,7 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
### Controls
textchunks=[]
controls=[]
while text[/(?:\\(w|f|ff|ts|cl|me|se|wt|wtnp|ch)\[([^\]]*)\]|\\(g|cn|wd|wm|op|cl|wu|\.|\||\!|\^))/i]
while text[/(?:\\(f|ff|ts|cl|me|se|wt|wtnp|ch)\[([^\]]*)\]|\\(g|cn|wd|wm|op|cl|wu|\.|\||\!|\^))/i]
textchunks.push($~.pre_match)
if $~[1]
controls.push([$~[1].downcase,$~[2],-1])
@@ -1206,12 +1215,6 @@ def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
msgback.y = msgwindow.y if msgback
pbPositionNearMsgWindow(facewindow,msgwindow,:left)
msgwindow.y = Graphics.height-msgwindow.height*(signWaitTime-signWaitCount)/signWaitTime
when "w" # Change windowskin
if param==""
msgwindow.windowskin = nil
else
msgwindow.setSkin("Graphics/Windowskins/#{param}",false)
end
when "ts" # Change text speed
msgwindow.textspeed = (param=="") ? -999 : param.to_i
when "." # Wait 0.25 seconds