Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Help with menu


  • Please log in to reply
4 replies to this topic

#1
Rugal

Rugal

    Advanced Member

  • Banned
  • PipPipPip
  • 80 posts

Can I generate menu with hero names? because it saves the settings per menu id instead of hero name.


  • 0

#2
Shulepin

Shulepin

    Advanced Member

  • Contributor
  • 185 posts
  • LocationRussia
local MyMenu = MenuElement({id = "my_menu", name = "My Menu", type = MENU})

for k = 1, Game.HeroCount() do
	local hero = Game.Hero(k)
	local heroName = hero.charName

	MyMenu:MenuElement({id = heroName, name = "Menu for " .. heroName, value = true})
end

  • 1

#3
Rugal

Rugal

    Advanced Member

  • Banned
  • PipPipPip
  • 80 posts

I reached this, but how do I use it?

 

Menu.Name:MenuElement

Menu.[Name]:MenuElement

Menu[Name]:MenuElement


  • 0

#4
Shulepin

Shulepin

    Advanced Member

  • Contributor
  • 185 posts
  • LocationRussia

I reached this, but how do I use it?

 

Menu.Name:MenuElement

Menu.[Name]:MenuElement

Menu[Name]:MenuElement

 

The last option is correct.

for k = 1, Game.HeroCount() do
	local hero = Game.Hero(k)
	local heroName = hero.charName

	if MyMenu[heroName]:Value() == true then 
		-- do smt
	end
end

  • 2

#5
Rugal

Rugal

    Advanced Member

  • Banned
  • PipPipPip
  • 80 posts

 

The last option is correct.

for k = 1, Game.HeroCount() do
	local hero = Game.Hero(k)
	local heroName = hero.charName

	if MyMenu[heroName]:Value() == true then 
		-- do smt
	end
end

thank you very much!!!

 

sadly I cant upvote you for some weird bug


  • 0




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users