Author Topic: GUI-calling functions  (Read 1150 times)

Hi guys,

I want to edit some functions that call the GUIs like the lag icon
I just want to edit the function

Anyone know the function Blockland uses to call the lag icon/other GUIs?

Also have a second question:
What is the code for the bricks in the radius of an explosion to fakekill them?
« Last Edit: May 18, 2010, 08:26:01 AM by chilmans »

Type Trace(1); into the console, You will get a stuffload of code, it displays all function called and more.
Then, You will need a package to overwrite it.

Type Trace(1); into the console, You will get a stuffload of code, it displays all function called and more.
Then, You will need a package to overwrite it.
But how am I supposed to get the lag GUI appear?

Pull out your internet cable? (Lol)
I'm not really sure if Trace works with clients.. I think the lag icon is clientside anyway because it's a GUI.

What would you want to change anyway? Add some code when the GUI gets loaded?

yes, i want it to do something when the GUI opens

Trace works with EVERYTHING, aside from a few engine functions that you can't change anyways.

I will try some stuff with trace tomorrow

Copied some stuff from log file:
Code: [Select]
Entering useTools(1)
   Entering setScrollMode(2)
      Entering PlayGui::hideToolBox(PlayGui, -320, 10, 0)
      Leaving PlayGui::hideToolBox() - return 48
   Leaving setScrollMode() - return 1
   Entering setActiveTool(0)
   Leaving setActiveTool() - return
Leaving useTools() - return
Entering PlayGui::hideToolBox(4351, -320, 10, 1)
Leaving PlayGui::hideToolBox() - return 49
Entering PlayGui::hideToolBox(4351, -320, 10, 2)
Leaving PlayGui::hideToolBox() - return 50
Entering servercmdUseTool(8305, 0)
   Entering Weapon::onUse(71, 9427, 0)
      Entering Player::updateArm(9427, hammerimage)
      Leaving Player::updateArm() - return 0
      Entering WeaponImage::onMount(72, 9427, 0)
      Leaving WeaponImage::onMount() - return 72
   Leaving Weapon::onUse() - return 72
Leaving servercmdUseTool() - return 72
Entering PlayGui::hideToolBox(4351, -320, 10, 3)
Leaving PlayGui::hideToolBox() - return 51
Entering PlayGui::hideToolBox(4351, -320, 10, 4)
Leaving PlayGui::hideToolBox() - return 52
Entering PlayGui::hideToolBox(4351, -320, 10, 5)
Leaving PlayGui::hideToolBox() - return 53
Entering clientCmdShowBricks(1)
Leaving clientCmdShowBricks() - return 1
Entering PlayGui::hideToolBox(4351, -320, 10, 6)
Leaving PlayGui::hideToolBox() - return 54
Entering PlayGui::hideToolBox(4351, -320, 10, 7)
Leaving PlayGui::hideToolBox() - return 55
Entering useTools(0)
Leaving useTools() - return 0
Entering PlayGui::hideToolBox(4351, -320, 10, 8)
Leaving PlayGui::hideToolBox() - return 56
Entering PlayGui::hideToolBox(4351, -320, 10, 9)
Leaving PlayGui::hideToolBox() - return 57
Entering PlayGui::hideToolBox(4351, -320, 10, 10)
Leaving PlayGui::hideToolBox() - return 9427
It is the Tools/Weapons GUI I opened
Any idea what the function might be called?
onuseTools?
« Last Edit: May 19, 2010, 07:53:13 AM by chilmans »

Try PlayGui.dump();

That'll give you a list of PlayGui's functions.
I'm assuming all the commands that make stuff pop up on the HUD will be in there, like lag icon and toolbox.

no, playGui.listObjects();

Guess what the lag icon is named... lemme take a wild guess, "LagIcon"? YES!
and it's just a normal guibitmapctrl, so it's fairly simple to interact with.

As for the function that shows and hides it, i believe that's an engine callback and if it isn't already it may be protected from packaging at some point, so I'd just use ::onWake() and ::onSleep() if you're trying to do something special when it comes and goes, and change LagIcon.visible or call LagIcon.setVisible() to show and hide it.

But beware, if it is still how it was last time I dealt with it, the lag icon can be shown quite frequently but for a very short duration (so short that you don't see it), and this can cause problems depending on what you are doing. Say for example that you want to automatically chat LAG whenever the lag icon appears, you would wind up chatting LAG when you didn't even see the lag icon, and it would probably end in you being kicked or banned. So, it would be wise to schedule whatever you wanted to do to happen like 250 miliseconds after the lag icon is shown, and cancel that schedule if it is hid again before the scheduled function is called, that way (if you are implementing the example above) you would only chat LAG when you actually knew you were lagging.

I could've sworn there was a playgui function for making the lag icon show up, but all I'm seeing is inventory and paint stuff.

What would the arguments be on the LagIcon::onWake() function?

Its called when the Lag icon is shown im guessing...

Its called when the Lag icon is shown im guessing...
Yeah I know

I just want to know what to put between the ( and ) in the function

It's not called when the Lag icon is showing.
It's not called at all.

onWake isn't called when you use .setvisible, and I doubt trying to package .setvisible would get you far.