じ☆ve冰风 发表于 3 天前

KOpenWeb VX

KOpenWeb VX

by Kyonides Arkanthes​

Introduction

Did you ever want to let your gamers open your official website?
Now you can do it!
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
Just read the instructions embedded in the script and you are good to go!

                Ruby:        
# * KOpenWeb VX * #
#   Scripter : Kyonides Arkanthes
#   2023-01-25

# This script is FREE as in BEER.
# It is distributed AS IS.
# No further changes will be added.

# Since most developers will only include a link to their own webiste,
# I crafted this scriptlet to let them open the default web browser via
# triggering the custom "Open My Website" command.
# The player will not notice any changes till the web browser finally opens.
# Feel free to customize the CONSTANTS found in the KOpenWeb module.

module KOpenWeb
COMMAND_TEXT = "RMW Forums"
# Options: :new, :load, :web, :shut
COMMAND_ORDER = [:new, :load, :web, :shut]
WEBSITE_URL = "https://forums.rpgmakerweb.com/index.php"
end

class Scene_Title
include KOpenWeb
def next_command(sym)
    case sym
    when :new
      @new_game_pos = @options.size
      @options << Vocab.new_game
    when :load
      @continue_pos = @options.size
      @options << Vocab.continue
    when :web
      @website_pos = @options.size
      @options << COMMAND_TEXT
    when :shut
      @shutdown_pos = @options.size
      @options << Vocab.shutdown
    end
end

def create_command_window
    @options = []
    COMMAND_ORDER.each{|cmd| next_command(cmd) }
    @command_window = Window_Command.new(172, @options)
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 248
    if @continue_enabled
      @command_window.index = @continue_pos
    else
      @command_window.draw_item(@continue_pos, false)
    end
    @command_window.openness = 0
    @command_window.open
end

def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when @new_game_pos
      command_new_game
      when @continue_pos
      command_continue
      when @website_pos
      command_open_url
      when @shutdown_pos
      command_shutdown
      end
    end
end

def command_open_url
    Sound.play_decision
    Thread.new{ system("open " + WEBSITE_URL) }
end
end


Terms & Conditions

Free for any kind of projects.
Distributed AS IS. No further changes will be made.
Include my nickname in your game credits!
Do not repost it! Leave a link to this website instead.


本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/kopenweb-vx.154415/
页: [1]
查看完整版本: KOpenWeb VX