赞 | 159 |
VIP | 0 |
好人卡 | 0 |
积分 | 262 |
经验 | 0 |
最后登录 | 2024-10-31 |
在线时间 | 5343 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 26184
- 在线时间
- 5343 小时
- 注册时间
- 2016-3-8
- 帖子
- 1655
|
本帖最后由 alexncf125 于 2022-8-11 09:51 编辑
使用方法
在输入数字事件命令之后,创建注释并写入
<num input digits: x>
其中 `x` 是您想要的位数
例子:
<num input digits: 10>
- =begin
- #===============================================================================
- Title: More Input Digits
- Author: Hime
- Date: Jan 29, 2015
- URL: http://himeworks.com/2015/01/more-input-digits/
- --------------------------------------------------------------------------------
- ** Change log
- Jan 29, 2015
- - Initial release
- --------------------------------------------------------------------------------
- ** Terms of Use
- * Free to use in non-commercial projects
- * Contact me for commercial use
- * No real support. The script is provided as-is
- * Will do bug fixes, but no compatibility patches
- * Features may be requested but no guarantees, especially if it is non-trivial
- * Credits to Hime Works in your project
- * Preserve this header
- --------------------------------------------------------------------------------
- ** Description
-
- This script allows you to set more digits for your number input event command.
- By default, the event editor only supports up to 8 digits.
-
- --------------------------------------------------------------------------------
- ** Installation
-
- In the script editor, place this script below Materials and above Main
- --------------------------------------------------------------------------------
- ** Usage
-
- Right after an input number event command, create a comment and write
-
- <num input digits: x>
-
- Where `x` is the number of digits you would like
- #===============================================================================
- =end
- $imported = {} if $imported.nil?
- $imported[:TH_MoreInputDigits] = true
- #===============================================================================
- # ** Configuration
- #===============================================================================
- module TH
- module More_Input_Digits
- Regex = /<num[-_ ]input[-_ ]digits:\s*(\d+)\s*>/i
- end
- end
- #===============================================================================
- # ** Rest of script
- #===============================================================================
- module RPG
- class Event::Page
- alias :th_more_input_digits_list :list
- def list
- parse_more_input_digits unless @more_input_digits_parsed
- th_more_input_digits_list
- end
-
- def parse_more_input_digits
- @more_input_digits_parsed = true
- i = 0
- while i < @list.size
- cmd = @list[i]
-
- # Number Input command
- if cmd.code == 103
-
- # Collect all comments under it
- next_cmd = @list[i+1]
- comment = ""
- while next_cmd.code == 108 || next_cmd.code == 408
- i += 1
- comment << "\n" << next_cmd.parameters[0]
- next_cmd = @list[i+1]
- end
-
- # Check if there's something special
- if comment =~ TH::More_Input_Digits::Regex
- num = $1.to_i
- cmd.parameters[1] = num
- end
- end
- i += 1
- end
- end
- end
- end
复制代码 |
|