Skip to content

Instantly share code, notes, and snippets.

@cacao-soft
Created January 3, 2021 19:21
Show Gist options
  • Save cacao-soft/da97b37df0af1e5252e1ff2acc64eeb4 to your computer and use it in GitHub Desktop.
Save cacao-soft/da97b37df0af1e5252e1ff2acc64eeb4 to your computer and use it in GitHub Desktop.
# イベントコマンド「スクロール文章の表示」のスクリプト欄化
# 行頭で #! RGSS と入力
# その後、#! RGSS TOP で、スクリプトをトップレベルで実行
class Game_Interpreter
#--------------------------------------------------------------------------
# ● スクロール文章の表示
#--------------------------------------------------------------------------
alias _cao_script_command_105 command_105
def command_105
if @list[@index+1].parameters[0][/^\s*#!\s*RGSS\s*(TOP)?/i]
command_105_script($1 ? TOPLEVEL_BINDING : binding)
else
_cao_script_command_105
end
end
#--------------------------------------------------------------------------
# ● スクリプト
#--------------------------------------------------------------------------
def command_105_script(b)
script = ""
while next_event_code == 405
@index += 1
script += @list[@index].parameters[0] + "\n"
end
begin
b.eval(script, "スクロール文章の表示", 1)
rescue SyntaxError
msg = "スクロール文章の表示:" \
"#{@index-index}:" \
"実行されたイベントコマンドを確認してください。"
raise SyntaxError, msg, []
rescue => e
raise e
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment