本篇教程由作者设定未经允许禁止转载。
前言
这是个简易的教程,针对以下需求:
第一次打开整合包时会看到该提示
该界面只需显示一次/每次都显示
只需要第一次打开整合包时提示的界面,并不需要模组的任何其他功能
那么你便可以接着看下方的教程
PS:该模组的功能远比提供一个界面要多得多,但我不需要,所以我懒得写了
配置文件教程
"startup gui" {
##########################################################################################################
# button
#--------------------------------------------------------------------------------------------------------#
# Settings related to the shown buttons.
##########################################################################################################
button {
# Text to display on the continue button. [default: Continue]
S:continueButtonText=Continue
# Add a second button that has a link attached to it. Clicking the button will open the link in the user's default browser. [default: true]
B:enableLinkButton=true
# Text to display on the link button. [default: My Website]
S:linkButtonText=My Website
# Link to open when clicked. [default: http://tehnut.info/]
S:linkButtonUrl=http://tehnut.info/
}
##########################################################################################################
# internal
#--------------------------------------------------------------------------------------------------------#
# Settings for the internal checking that the GUI does.
##########################################################################################################
internal {
# Whether to disable the GUI after it has been viewed before.
# Set to false to show GUI on every startup. Still requires showGuiOnStartup to be true. [default: true]
B:disableGuiAfterViewed=false
# False- Displays Gui when the specified mod is found.
# True- Displays Gui when the specified mod is *not* found. [default: false]
B:invertModFinder=false
# Put a modid here to only load if that mod is installed. Leave blank to not check for a mod at all. [default: ]
S:modToFind=
# Whether or not to show the GUI on startup. Used internally, do not touch. [default: true]
B:showGuiOnStartup=true
}
##########################################################################################################
# information
#--------------------------------------------------------------------------------------------------------#
# Information to provide to players.
##########################################################################################################
information {
# These are your information info lines in the GUI
# Use "\n" to define a new line. If the line is still too long, it will split for you.
# If you do not use custom splits, it will just use the automated ones.
# Valid text codes you can use are:
# %player% - Provides the player's username.
# %name% - Provides modpackName
# %version% - Provides modpackVersion
# %acro% - Provides modpackAcronym [default: ]
S:startupGuiLines=
# Title of the startup GUI. Shows as yellow text. [default: TITLE]
S:startupGuiTitle=TITLE
}
}
请在配置文件中找到startup gui部分,进行修改。
本教程代码第11行:继续(即进入主菜单的按钮)的名字,默认为Continue,如果你改成 继续 ,那么该按钮便会改变名字
本教程代码第14行:是否显示第二个按钮。选择true,将会显示第二个按钮,该按钮只有一个功能,将这个按钮导向至指定连接
本教程代码第20行:如果你在14行选择了true,那么就在第20行修改默认的网址为你想要的网址
本教程代码第32行:是否在用户浏览一次该GUI之后,GUI永久不再显示。选择true,该GUI就会变成一次性的;false,则为每次都显示
本教程代码第42行:是否在本次启动游戏时显示GUI。若为true,那么在修改之后,本次启动游戏一定会显示GUI。此时,若你在第32行选择了false,那么本行的配置将不会自行改变,即一直为true,每次启动都会显示GUI;若你在第32行选择了true,而本行你也选择了true,那么游戏将在本次启动时显示GUI,本次启动之后,本行将会自动改变为false,下次启动后不再显示GUI;若你在第32行选择了true,而本行你选择了false,那么游戏将不会在本次启动时显示GUI,也不再显示GUI
本教程代码第60行:显示的内容。直接在等号后面输入即可,使用\n主动进行换行。例如:\n你好\n欢迎游玩整合包\n非常感谢您。那么GUI将会显示3行信息
本教程代码第63行:标题的名字。修改TITLE这个单词即可修改GUI的题目显示