CS:GO Information Panel
Posted: Sun Aug 21, 2016 2:15 am
Hey Guys,
I'm currently thinking about an alternative from the keyhint-text from CS:S and I thought about creating a (maybe self refreshing?) simple menu to show the keyhint-text.
I checked the forums already and saw 'register_build_callback' from this thread: viewtopic.php?p=8062#p8062
Sadly I have no clue how to use this properly, since this code gives me actually just the latest menu I opended (just visual, but buttons dont work etc).
I guess the first step would be:
But ye, that doesnt update it.
This time nothing, what am I doing wrong?
As an addition, we probably need to subclass the SimpleMenu, so player's cant close it. Which means, we need to create a 'native', like CloseMenu & OpenMenu so we can use other menus during our hud loop.
I'm currently thinking about an alternative from the keyhint-text from CS:S and I thought about creating a (maybe self refreshing?) simple menu to show the keyhint-text.
I checked the forums already and saw 'register_build_callback' from this thread: viewtopic.php?p=8062#p8062
Sadly I have no clue how to use this properly, since this code gives me actually just the latest menu I opended (just visual, but buttons dont work etc).
I guess the first step would be:
Syntax: Select all
def hudLoop():
Delay(1, hudLoop)
for player in PlayerIter('human'):
sendInformationPanel(player.index)
hudLoop()
def sendInformationPanel(player_index):
player = Player(player_index) #I heard we need to re-create this for a new function, else a crash can happen if the player leaves?
p = SimpleMenu()
p.append("-Player: %s\n\nKills: %s\nDeaths: %s" % (player.name, player.kills, player.deaths))
p.send(player_index)
But ye, that doesnt update it.
Syntax: Select all
def sendInformationPanel(player_index):
player = Player(player_index) #I heard we need to re-create this for a new function, else a crash can happen if the player leaves?
p = SimpleMenu()
p.register_build_callback
p.send(player_index)
def my_build_callback(menu, index):
menu.clear()
menu.append(time.ctime())
This time nothing, what am I doing wrong?
As an addition, we probably need to subclass the SimpleMenu, so player's cant close it. Which means, we need to create a 'native', like CloseMenu & OpenMenu so we can use other menus during our hud loop.