じ☆ve冰风 发表于 2026-8-2 21:32:14

KOpenWeb ACE

KOpenWeb ACE

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 ACE * #
#   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"
COMMAND_INDEX = 2
COMMAND_SYMBOL = :open_website
WEBSITE_URL = "https://forums.rpgmakerweb.com/index.php"
end

class Window_TitleCommand
include KOpenWeb
alias :kyon_open_website_mk_cmd_list :make_command_list
def make_command_list
    kyon_open_website_mk_cmd_list
    place_command(COMMAND_TEXT, COMMAND_SYMBOL)
end

def place_command(name, symbol)
    cmd = { name: name, symbol: symbol, enabled: true, ext: nil }
    @list.insert(COMMAND_INDEX, cmd)
end
end

class Scene_Title
include KOpenWeb
alias :kyon_open_website_scn_title_ccw :create_command_window
def create_command_window
    kyon_open_website_scn_title_ccw
    @command_window.set_handler(COMMAND_SYMBOL, method(:open_url))
end

def open_url
    Thread.new{ system("open " + WEBSITE_URL) }
    @command_window.activate
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-ace.154406/
页: [1]
查看完整版本: KOpenWeb ACE