幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2359|回复: 7

[原创]好不容易做了汉语输名字脚本来看看吧

[复制链接]

3

主题

12

帖子

133

积分

③业余

积分
133
QQ
发表于 2007-7-25 08:08:37 | 显示全部楼层 |阅读模式
好不容易做了汉语输名字脚本来看看吧[s:2][s:2][s:2]
[url=http://isdongman.ttsite.com[/url]

#==============================================================================
# ■ Window_NameInput
#------------------------------------------------------------------------------
#  输入名称的画面、文字选择窗口。
#    由百老工作室按白家姓顺序编写(不全哦,但也够了)
#   有个论坛大家捧一下吧,不惘我N小时复制粘贴
#          isdongman.ttsite.com
#==============================================================================

class Window_NameInput < Window_Base
  CHARACTER_TABLE =
  [
    "赵","钱","孙","李","周",
    "吴","郑","王","冯","陈",
    "褚","卫","蒋","沈","韩",
    "杨","朱","秦","尤","许",
    "何","吕","施","张","孔",
    "曹","严","华","金","魏",
    "陶","姜","戚","谢","邹",
    "喻","柏","水","窦","章",
    "云","苏","潘","葛","奚",
    "白","老","工","作","室",
    "范","彭","郎","鲁","韦",
    "昌","马","苗","凤","花",
    "方","俞","任","袁","柳",
    "酆","鲍","史","唐","费",
    "廉","岑","薛","雷","贺",
    "倪","汤","滕","殷","罗",
    "毕","郝","邬","安","常",
    "乐","于","时","傅","皮",
    "卞","齐","康","伍","余",
    "元","卜","顾","孟","平",
    "黄","和","穆","萧","尹",
    "姚","邵","湛","汪","祁",
    "毛","禹","狄","米","贝",
    "明","臧","计","伏","成",
    "戴","谈","宋","茅","庞",
    "熊","纪","舒","屈","项",
    "祝","董","梁","杜","阮",
    "蓝","闵","席","季","麻",
    "强","贾","路","娄","危",
    "江","童","颜","郭","梅",
    "盛","林","刁","钟","徐",
    "邱","骆","高","夏","蔡",
    "∴","♂","♀","$","¤",
    "¢","§","№","☆","★",
    "○","●","◎","◇","◆",
    "□","■","※","〓","  ",
  ]
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    super(0, 128, 640, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    @index = 0
    refresh
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● 获取文字
  #--------------------------------------------------------------------------
  def character
    return CHARACTER_TABLE[@index]
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0..179
      x = 4 + i / 5 / 9 * 152 + i % 5 * 28
      y = i / 5 % 9 * 32
      self.contents.draw_text(x, y, 28, 32, CHARACTER_TABLE, 1)
    end
    self.contents.draw_text(544, 9 * 32, 64, 32, "确定", 1)
  end
  #--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 光标位置在 [确定] 的情况下
    if @index >= 180
      self.cursor_rect.set(544, 9 * 32, 64, 32)
    # 光标位置在 [确定] 以外的情况下
    else
      x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
      y = @index / 5 % 9 * 32
      self.cursor_rect.set(x, y, 28, 32)
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    super
    # 光标位置在 [确定] 的情况下
    if @index >= 180
      # 光标下
      if Input.trigger?(Input:OWN)
        $game_system.se_play($data_system.cursor_se)
        @index -= 180
      end
      # 光标上
      if Input.repeat?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        @index -= 180 - 40
      end
    # 光标位置在 [确定] 以外的情况下
    else
      # 按下方向键右的情况下
      if Input.repeat?(Input::RIGHT)
        # 按下状态不是重复的情况下、
        # 光标位置不在右端的情况下
        if Input.trigger?(Input::RIGHT) or
           @index / 45 < 3 or @index % 5 < 4
          # 光标向右移动
          $game_system.se_play($data_system.cursor_se)
          if @index % 5 < 4
            @index += 1
          else
            @index += 45 - 4
          end
          if @index >= 180
            @index -= 180
          end
        end
      end
      # 按下方向键左的情况下
      if Input.repeat?(Input:EFT)
        # 按下状态不是重复的情况下、
        # 光标位置不在左端的情况下
        if Input.trigger?(Input:EFT) or
           @index / 45 > 0 or @index % 5 > 0
          # 光标向右移动
          $game_system.se_play($data_system.cursor_se)
          if @index % 5 > 0
            @index -= 1
          else
            @index -= 45 - 4
          end
          if @index < 0
            @index += 180
          end
        end
      end
      # 按下方向键下的情况下
      if Input.repeat?(Input:OWN)
        # 光标向下移动
        $game_system.se_play($data_system.cursor_se)
        if @index % 45 < 40
          @index += 5
        else
          @index += 180 - 40
        end
      end
      # 按下方向键上的情况下
      if Input.repeat?(Input::UP)
        # 按下状态不是重复的情况下、
        # 光标位置不在上端的情况下
        if Input.trigger?(Input::UP) or @index % 45 >= 5
          # 光标向上移动
          $game_system.se_play($data_system.cursor_se)
          if @index % 45 >= 5
            @index -= 5
          else
            @index += 180
          end
        end
      end
      # L 键与 R 键被按下的情况下
      if Input.repeat?(Input:) or Input.repeat?(Input::R)
        # 平假名 / 片假名 之间移动
        $game_system.se_play($data_system.cursor_se)
        if @index / 45 < 2
          @index += 90
        else
          @index -= 90
        end
      end
    end
    update_cursor_rect
  end
end
回复

使用道具 举报

122

主题

4962

帖子

74

积分

超级版主

Rank: 8Rank: 8

积分
74

声命组银赏

QQ
发表于 2007-7-25 10:28:20 | 显示全部楼层
-_-只有姓没有名吗

而且现在一般都用加强脚本了吧
回复 支持 反对

使用道具 举报

0

主题

102

帖子

1126

积分

⑥精研

积分
1126
QQ
发表于 2007-7-25 10:47:47 | 显示全部楼层
直接用真输入法得了- -+
回复 支持 反对

使用道具 举报

3

主题

12

帖子

133

积分

③业余

积分
133
QQ
 楼主| 发表于 2007-7-26 07:50:28 | 显示全部楼层
55555。。。。。。。。。我的心啊 [s:6]
来个
直接用真输入法得了- -+
得好吧!
回复 支持 反对

使用道具 举报

3

主题

23

帖子

255

积分

③业余

积分
255
发表于 2007-9-1 22:41:51 | 显示全部楼层
加强脚本了吧 这是什么?
ls 我支持你哦~
回复 支持 反对

使用道具 举报

3

主题

53

帖子

610

积分

⑤进阶

积分
610
发表于 2007-9-19 12:50:34 | 显示全部楼层
虽然不怎么能在广大游戏中用到,但若做中华文化纪念游戏的话,这个脚本应该算必不可少的.......
支持一下!
回复 支持 反对

使用道具 举报

火鸡三毛 该用户已被删除
发表于 2007-10-28 11:36:47 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

2

主题

15

帖子

167

积分

③业余

积分
167
发表于 2007-11-16 12:50:29 | 显示全部楼层
[s:1]  [s:1]
顶只
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-21 06:30 , Processed in 0.012947 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表