요약
메서드
AddNewAction(actionId: string,text: string,icon: string):Instance |
AddSeparator():() |
Clear():() |
상속된 멤버
코드 샘플
플러그인 메뉴 및 플러그인 메뉴 액션 생성
-- 이 코드는 Command Bar에 붙여넣을 수 있지만 한 번만 가능합니다.
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():()
반환
()