查看: 2450|回复: 1

[已经解决] 关于黑色笔记的那个仿网游系统

[复制链接]
梦石
0
星屑
50
在线时间
11 小时
注册时间
2013-10-5
回帖
9
发表于 2013-11-2 17:29:44 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
那个仿网游系统怎么去掉那个打字框?
QQ图片20131102172757.jpg

百合控

梦石
0
星屑
6548
在线时间
1275 小时
注册时间
2013-8-21
回帖
3522

开拓者

发表于 2013-11-2 21:35:06 | 显示全部楼层
用这个替换原Game_MapChat
下次直接去找原作者,或者发脚本,要不是我正好看到过这东西,谁知道你说的是什么
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Game_MapChat
  4. #------------------------------------------------------------------------------
  5. #  处理地图Chat的类。
  6. #==============================================================================

  7. class Game_MapChat
  8.   
  9.   DataLine = 8
  10.   
  11.   def initialize
  12.     @viewport = Viewport.new(0, Graphics.height - (16 * DataLine + 18), 256, 16 * DataLine + 18)
  13.     @chatdata = Sprite.new(@viewport)
  14.     @chatdata.bitmap = Bitmap.new(@viewport.rect.width, 16 * DataLine)
  15.     @chatdata.bitmap.font.shadow = true
  16.     @chatdata_pos = 0
  17.     @chatdatas = []
  18.   end
  19.   
  20.   def dispose
  21.     @viewport.dispose
  22.     @chatdata.dispose
  23.   end
  24.   
  25.   def update
  26.   end
  27.   
  28.   def refresh
  29.     @chatdata.bitmap.clear
  30.     @chatdata.bitmap.font.color.set(255, 255, 255, 255)
  31.     for i in @chatdata_pos...(@chatdata_pos+ 1)
  32.       break unless i < @chatdatas.size
  33.       x = 2
  34.       data = ""
  35.       text = @chatdatas[i].clone
  36.       while char = text.slice!(/./m)
  37.         case char
  38.         when "\001"
  39.           color_string = ""
  40.           while c = text.slice!(/./m)
  41.             case c
  42.             when "["
  43.               next
  44.             when "]"
  45.               break
  46.             else
  47.               color_string += c
  48.               next
  49.             end
  50.           end
  51.           color_string = color_string.split(/,/)
  52.           r = (color_string[0] || 255).to_i
  53.           g = (color_string[1] || 255).to_i
  54.           b = (color_string[2] || 255).to_i
  55.           a = (color_string[3] || 255).to_i
  56.           @chatdata.bitmap.font.color.set(r, g, b, a)
  57.           next
  58.         end
  59.         @chatdata.bitmap.draw_text(x, (i - @chatdata_pos) * 16, 230, 16, char)
  60.         x += @chatdata.bitmap.text_size(char).width
  61.       end
  62.     end
  63.   end
  64.   
  65.   def add(text)
  66.     x = 2
  67.     y = 0
  68.     data = []
  69.     last_color = Color.new(255, 255, 255, 255)
  70.     text = "\001[255, 255, 255, 255]" + text
  71.     text.gsub!(/\\[Cc]/) { "\001" }
  72.     while char = text.slice!(/./m)
  73.       case char
  74.       when "\001"
  75.         data[y] ||= ""
  76.         data[y] += char
  77.         color_string = ""
  78.         while c = text.slice!(/./m)
  79.           data[y] += c
  80.           case c
  81.           when "["
  82.             next
  83.           when "]"
  84.             break
  85.           else
  86.             color_string += c
  87.             next
  88.           end
  89.         end
  90.         color_string = color_string.split(/,/)
  91.         r = (color_string[0] || 255).to_i
  92.         g = (color_string[1] || 255).to_i
  93.         b = (color_string[2] || 255).to_i
  94.         a = (color_string[3] || 255).to_i
  95.         last_color.set(r, g, b, a)
  96.         next
  97.       else
  98.         if x >= @chatdata.bitmap.width - 8
  99.           x = @chatdata.bitmap.text_size("    ").width
  100.           y += 1
  101.         end
  102.         case char
  103.         when "\n"
  104.           x = @chatdata.bitmap.text_size("    ").width
  105.           y += 1
  106.           next
  107.         end
  108.         x += @chatdata.bitmap.text_size(char).width
  109.       end
  110.       
  111.       unless (data[y] ||= "").size > 0
  112.         color = last_color
  113.         char = "\001[#{color.red}, #{color.green}, #{color.blue}, #{color.alpha}]    " + char
  114.       end
  115.       data[y] += char
  116.     end
  117.     @chatdatas += data
  118.   end
  119.   
  120.   
  121.   def send(message, type = 2)
  122.     case type
  123.     when 0
  124.       message = "\001[255, 128, 128][RubyCode] " + message
  125.     when 1
  126.       message = "\001[255, 255, 255][附近] " + message
  127.     when 2
  128.       message = "\001[128, 192, 255]" + message
  129.     end
  130.     add(message)
  131.     @chatdata_pos = [0, @chatdatas.size - 1].max
  132.     refresh
  133.   end
  134. end
复制代码

评分

参与人数 1梦石 +1 收起 理由
Sion + 1 认可答案

查看全部评分

萌新瑟瑟发抖
看到我请叫我去干活
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部