0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GOKI2で広げる拡張性【Mod***MenuItems/ModVersionWindow入門】旧メニュー対応とバージョンウインドウ

0
Last updated at Posted at 2026-03-06

Mod***MenuItems

Mod***MenuItems は各種メニューを実装しています。
まずは、モジュールを読み込みます。

; メニュー機能
@load_module name=ModSystemMenuItems
@load_module name=ModSaveLoadMenuItems
@load_module name=ModMessageMenuItems
@load_module name=ModHelpMenuItems

これでメニューが追加されました。
メニューは基本的にモジュールを読み込むだけでよいです。
いらない項目があれば非表示にしてください。

メニュー設定

メニュー項目で設定できるのは項目の表示/非表示のみです。
詳しくはマニュアルを参照してください。

メニューとシステム画面の競合

ModMessageMenuItemsとModSystemは競合します。
どちらか一方のみを使ってください。

ModVersionWindow

ModVersionWindowはいわゆるバージョン表示を行うモジュールです。
まずは、モジュールを読み込みます。

; バージョンウインドウ
@load_module name=ModVersionWindow

バージョン表示

バージョン表示のためのスクリプトを指定します。
このスクリプトはバージョンウインドウが表示された後、バージョンウインドウ上で動作するスクリプトです。

@version_window storage=VersionWindow

バージョンウインドウのスクリプト

簡単なスクリプトとして以下のようなスクリプトを作成します。

/src/goki2/system/VersionWindow.gs
; 画像関連機能
@load_module name=ModImage
; メッセージレイヤ関連機能
@load_module name=ModMessage

; ウインドウ設定
@window width=300 height=200 fix_position_to_center visible

; メッセージレイヤの数
@message_layers count=1

; メッセージレイヤ設定
@message_option layer=message0 left=0 top=0 width=300 height=200 opacity=0 color=0 caption_color=0xFFFFFF current

@using_mod_message

@cr_handling ignore

@cm

@!show_message type=vista

@show_message layer=message0 vista
@wait_show_message

GOKI2:[emb exp=GOKI2VersionInfo.versionString][r]
タイトル:[emb exp=System.title][r]
バージョン:[emb exp=global.window.conductor.majorVersionNumber].[emb exp=global.window.conductor.minorVersionNumber][r]
[emb exp=global.window.conductor.specialVersionString]

@s

これでバージョン表示ができるようになりました。
バージョンウインドウはモジュールを何も読み込んでいない状態なので使う機能は読み込む必要があります。

embタグで各種値を表示しています。

GOKI2VersionInfo.versionString:GOKI2バージョン
System.title : ゲームタイトル
global.window.conductor.majorVersionNumber : メジャーバージョン番号
global.window.conductor.minorVersionNumber : マイナーバージョン番号
global.window.conductor.specialVersionString : スペシャル文字列

関連する記事の一覧

GOKI2の関連する記事一覧

ダウンロード

気になった方は以下サイトのリリースタグ(Avalanches release version 2.x.y.yという表記)からAssetsにあるAvalanches-Release2.x.y.y.zipのリンクから最新の環境をダウンロードできます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?