エンジンクラス
PluginMenu
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
方法
AddNewAction(actionId: string,text: string,icon: string):Instance |
AddSeparator():() |
Clear():() |
コードサンプル
プラグインメニューとプラグインメニューアクションの作成
-- このコードはコマンドバーに貼り付けることができますが、1回だけです
local pluginMenu = plugin:CreatePluginMenu(math.random(), "テストメニュー")
pluginMenu.Name = "テストメニュー"
pluginMenu:AddNewAction("ActionA", "A", "rbxasset://textures/loading/robloxTiltRed.png")
pluginMenu:AddNewAction("ActionB", "B", "rbxasset://textures/loading/robloxTilt.png")
local subMenu = plugin:CreatePluginMenu(math.random(), "C", "rbxasset://textures/explosion.png")
subMenu.Name = "サブメニュー"
subMenu:AddNewAction("ActionD", "D", "rbxasset://textures/whiteCircle.png")
subMenu:AddNewAction("ActionE", "E", "rbxasset://textures/icon_ROBUX.png")
pluginMenu:AddMenu(subMenu)
pluginMenu:AddSeparator()
pluginMenu:AddNewAction("ActionF", "F", "rbxasset://textures/sparkle.png")
local toggle = Instance.new("BoolValue")
toggle.Name = "TogglePluginMenu"
toggle.Parent = workspace
local function onToggled()
if toggle.Value then
toggle.Value = false
local selectedAction = pluginMenu:ShowAsync()
if selectedAction then
print("選択したアクション:", selectedAction.Text, "アクションID:", selectedAction.ActionId)
else
print("ユーザーはアクションを選択しませんでした!")
end
end
end
toggle.Changed:Connect(onToggled)APIリファレンス
プロパティ
方法
AddNewAction
AddSeparator
PluginMenu:AddSeparator():()
戻り値
()
Clear
PluginMenu:Clear():()
戻り値
()