PDA

View Full Version : Disconnect button (at game end)



MaxGhost
08-25-2009, 10:23 PM
Disconnect button (at game end)
*updated on 27 Aug 2009 04:10 GMT-5*

***Does not work on Regular ratio screens (4:3) right now, and only works on Widescreen (16:9). If I find the chance to plug in my old 4:3 LCD, I'll be able to release another version for it.

***Update causes the game.interface file to be reloaded after being pressed to fix a bug for now.

I created this mod because some people (like me) get really tired of having to press three buttons to leave at the end of a game to leave it. This mod adds a button that slides down from the top of the screen (where the voting panel comes down from). It's a big blue Disconnect button which makes it easy and instant to leave a game and return to the game's lobby.

For those who are wondering, when you click the button, it sends "disconnect" to the console instantly. You can achieve the same effect by pressing Ctrl+F8 during the game and typing disconnect.

The button slide down occurs when either one of the main building's health drops to zero.

***** Screenshot coming soon! *****

Note: This mod will NOT work with other game.interface mods currently, because it adds two lines of code to that file. I will add it in some of my combination mods soon.
__________________________________________________ ___________

Installation
To install, download this file (http://www.mediafire.com/?jqbimjbmtjr) into the games folder game/ folder. The default locations for these are:

Linux: /home/<username>/HoN/game/
Windows 7: C:\Program Files\Heroes of Newerth\game\
Windows Vista: C:\Program Files\Heroes of Newerth\game\
Windows XP: C:\Program Files\Heroes of Newerth\game\
Mac:
1. Press Finder
2. Press Applications
3. Right click 'Heroes of Newerth', and press Show containing files
4. Open Game folder
5. Move file here
__________________________________________________ ___________
Changelog

0.2.1 (27 Aug 2009 04:10 GMT-5):
- Bug was found. After clicking the disconnect button and joining another game, the button stays up in the next game from the beginning. This is probably not the best solution, but I added a "reloadinterface game" command when you click the button, so there might be a slight ~1 second pause after clicking the button. That's normal, but let me know if your pauses are very long (5-10 second range).

0.2.0 (26 Aug 2009 10:25 GMT-5):
- It should now be fully working. It shows when the base's health is below 0.1% (so around 45hp left).

0.1.1 (25 Aug 2009 23:40 GMT-5):
- Found that initial release was broken
- Tried to fix, and it works to an extent, but still now how I want it. Consider this to still be in beta.

0.1.0 (25 Aug 2009 22:20 GMT-5):
- Initial release.

_____________________

This is officially modification 025 in the Modification Repository (http://forums.heroesofnewerth.com/showthread.php?t=7391)!

Check out other mods by users by clicking here (http://forums.heroesofnewerth.com/showthread.php?t=7391)!

MaxGhost
08-25-2009, 10:38 PM
:/ It's not working right now... -.-

slime
08-25-2009, 10:43 PM
Someone was asking for this in clan chat about an hour ago, nice.

rhave
08-25-2009, 11:38 PM
where do we download?

MaxGhost
08-25-2009, 11:41 PM
Released an update. How I was trying to make it work is that when main building hp = 0, trigger the slide to show the button. That didn't always work. I tried doing 0.1, but that made the slide happen when the base's hp was around 460hp. Then I tried 0.000001, that didn't work at all, then I tried 0.01, didn't work either. So the released version is with 0.1 for now, but I'll try and figure it out. (by the way those numbers are in percentage, so right now, it's at 10% hp).

I'll try to find a more sure-fire way to do it, but for now this'll have to do.


where do we download?
I just updated it. The link is in the installation section. Sorry.

Fleder
08-26-2009, 05:04 AM
could you post a screenshot? would be nice to see how this looks

MaxGhost
08-26-2009, 08:13 AM
could you post a screenshot? would be nice to see how this looks
Yeah... my problem is that it's not properly working, and I only got it to slide out once out of like 6 times, so I really don't know what's going on...

Tehwildcard
08-26-2009, 09:59 AM
Yeah... my problem is that it's not properly working, and I only got it to slide out once out of like 6 times, so I really don't know what's going on...

Max maybe because you set it to to trigger at .1 (at least that's what I think you did). Well what it goes from a higher number to .0

MaxGhost
08-26-2009, 10:01 AM
Max maybe because you set it to to trigger at .1 (at least that's what I think you did). Well what it goes from a higher number to .0
But... Then it wouldn't be an if statement, it would be a while statement... I'm so confused... cause I did "param lt 0.1"

Edit: thanks for helping me test it tehwildcard. Released a new version which should fix the problems.

Jiggaboo
08-26-2009, 05:37 PM
I would use this if you had it dropdown when a team concedes as well :D
Would be a cool future feature

MaxGhost
08-26-2009, 05:46 PM
I would use this if you had it dropdown when a team concedes as well :D
Would be a cool future feature
Yup... workin on it.

MaxGhost
08-27-2009, 04:12 AM
Update. Read the changelog in OP.

Warchamp7
08-27-2009, 07:51 AM
For the 'bug' you found, can't you have the button slide back up when it's clicked?

MaxGhost
08-27-2009, 10:10 AM
For the 'bug' you found, can't you have the button slide back up when it's clicked?
I have a button inside a panel. I don't know how to send a command to a panel from the button in the panel to make it slide back up. So for now, that's the best solution I could think of.

MaxGhost
08-27-2009, 09:45 PM
Found that it only works on widescreen. Info in OP.

eNTi
08-29-2009, 11:17 AM
i've tried to created a similar mod based on yours and bard's buttons... it seems if i send a disconnect + reloadinterface game via one click my game crashes. is there any way to read the dump files?

MaxGhost
08-29-2009, 11:21 AM
i've tried to created a similar mod based on yours and bard's buttons... it seems if i send a disconnect + reloadinterface game via one click my game crashes. is there any way to read the dump files?
I don't know how to read dump files, never used them.

What exactly are you trying to do? I might be able to help.

eNTi
08-29-2009, 11:26 AM
this:


<?xml version="1.0" encoding="UTF-8"?>
<package>
<panel color="invisible" x="158.5h" y="-69.0h" height="2.1h" width="2.1h" name="minimap_disconnect_quit" >
<image texture="/ui/nqa/nqa_button.tga"/>
<button
texture="/ui/elements/button_roundhl.tga"
onclick="Cmd('disconnect'); Cmd('reloadinterface game');"
onrightclick="Cmd('quit');"
interactive="false"
/>
</panel>
</package>


did you find a way to make the button placement relative, so that the screen resolution / size doesn't matter?

MaxGhost
08-29-2009, 11:35 AM
did you find a way to make the button placement relative, so that the screen resolution / size doesn't matter?
No I did not. All I know is that you can do align="left/center/right" and valign="top/center/bottom" and then just add or remove from the y to move it and you would be a little more precise, but I don't know how do do relative other than that.

WiLL
09-03-2009, 05:21 PM
I would use this if you had it dropdown when a team concedes as well :D
Would be a cool future feature


Yup... workin on it.

This is going to be awesome, will download then. :)

MaxGhost
09-03-2009, 05:34 PM
This is going to be awesome, will download then. :)
There's no concede event. Not gonna happen until S2 cleans up their events system and adds the ones that should be there. Technically there's not even an end-game trigger other than the base health and end game countdown, but that doesn't include concedes.

dewatempur
09-08-2009, 02:35 PM
i need a screenshot of this. bump

MaxGhost
09-08-2009, 04:42 PM
i need a screenshot of this. bump
It's really hard to make one, cause it only happens at end-game when a main base dies. I suggest you use TUB with the Disconnect add-on instead now because that version is very improved from this one.

Ulquiomaru
09-16-2009, 04:21 AM
I can't seem to get this one to work even after combining it with my mods. Then I noticed it's a bit outdated, meh.

BlackICE
09-21-2009, 02:07 PM
ya none of MaxGhost's mods work for me and I have tried them all

EDIT: I take that back, the bigger score board one worked, but i don't use it. I'd love for the right click close notifications to work, but it doesn't.

MaxGhost
09-21-2009, 04:08 PM
ya none of MaxGhost's mods work for me and I have tried them all

EDIT: I take that back, the bigger score board one worked, but i don't use it. I'd love for the right click close notifications to work, but it doesn't.
... First of all, check the updated date. Second of all, this one is discontinued because the TUB mod (The Useless Button) made a newer and better version of this mod. Third of all, you're probably trying to use multiple mods that use the same file together; try combining them.

WiLL
09-25-2009, 06:34 AM
are you still working on this ?

MaxGhost
09-25-2009, 03:55 PM
are you still working on this ?
No, cause like I said many times... the TUB mod added much improved support for this mod, so this one is now obsolete.

Dreadlord
09-27-2009, 10:47 AM
U have it working for 16:9 but not for 4:3? How is that possible? Didn't look into the modding - but shouldn't positioning be in percents?

MaxGhost
09-27-2009, 11:19 AM
U have it working for 16:9 but not for 4:3? How is that possible? Didn't look into the modding - but shouldn't positioning be in percents?
No, it's in 'h' unit. Each resolution has it's own screen width in 'h'. screen height is always 100h, 88h inside the game interface. At the time I didn't know a way around this, but like I said many times, I could update this, but it's now discontinued in favor of TUB's version.

RyDeRz666
03-05-2010, 05:50 AM
very good script

Sephinator
03-05-2010, 06:27 AM
very good script

It's implemented. :/

Snake_Eyes
04-02-2010, 11:10 PM
working wif the new version??

MaxGhost
04-02-2010, 11:31 PM
working wif the new version??
/facepalm

It's been implemented.