插件脚本 【原创】【20.1+21.1】中文文本处理(1.3.6)

LQWU

天王
成员
2023-07-12
45
2
18
1,461
因本人懒惰导致未在v20.1上进行测试,所以在v20.1中使用会报错,紧急修正方法为在Tools.rb文件中插入以下代码
Ruby:
def fmtReplaceEscapes(text)
  text.gsub!(/&lt;/, "<")
  text.gsub!(/&gt;/, ">")
  text.gsub!(/&apos;/, "'")
  text.gsub!(/&quot;/, "\"")
  text.gsub!(/&amp;/, "&")
  text.gsub!(/&m;/, "♂")
  text.gsub!(/&f;/, "♀")
end

class Color
  def self.new_from_rgb(param)
    return Font.default_color if !param
    base_int = param.to_i(16)
    case param.length
    when 8   # 32-bit hex
      return Color.new(
        (base_int >> 24) & 0xFF,
        (base_int >> 16) & 0xFF,
        (base_int >> 8) & 0xFF,
        (base_int) & 0xFF
      )
    when 6   # 24-bit hex
      return Color.new(
        (base_int >> 16) & 0xFF,
        (base_int >> 8) & 0xFF,
        (base_int) & 0xFF
      )
    when 4   # 15-bit hex
      return Color.new(
        ((base_int) & 0x1F) << 3,
        ((base_int >> 5) & 0x1F) << 3,
        ((base_int >> 10) & 0x1F) << 3
      )
    when 1, 2   # Color number
      case base_int
      when 0 then return Color.white
      when 1 then return Color.blue
      when 2 then return Color.red
      when 3 then return Color.green
      when 4 then return Color.cyan
      when 5 then return Color.pink
      when 6 then return Color.yellow
      when 7 then return Color.gray
      else        return Font.default_color
      end
    end
    return Font.default_color
  end
end

过几天我会尽快修复,给大家造成的不便敬请谅解
大佬,辛苦了
 

在线成员

现在没有会员在线。

论坛统计

主题
345
消息
1,586
会员
2,330
最新会员
工藤优幸

关于我们

  • 宝可梦以及其他相关名称是任天堂的商标,版权归宝可梦公司所有。宝可饭堂是一个同人游戏中文社区,不隶属于宝可梦公司。在宝可饭堂上的粉丝游戏亦未获得其授权,请支持正版游戏。
© 2022- pokefans.cn
点此延长宝可饭堂生命