Yes, we have success ladies and gentlemen!

Using the idea in the below mentioned post, I have successfully created
a custom menu with images, rollovers, and sounds whilst still retaining
use of the HL2 dialogs. I even made sure the menu would shift
accordingly when in-game to allow Resume Game and Save Game to be in the
appropriate spots.

Once I finish finalizing the menu, I will create a Wiki on it.

Basic summary:

* Create a panel for your custom menu.
* Set "SetKeyboardInputEnabled(false)" and "SetMouseInputEnabled(false)".
* Set Zpos(-1)
* Programmatically add your ImagePanels, making sure to align them properly.
* Add invisible buttons over your image panels, these are used for
rollover detection.
* Replace menu labels in GameMenu.res with spaces (i.e. "label" "
") [for testing and alignment, use underscores]
* After getting everything aligned properly, you can either be happy and
not have rollovers, or proceed to do rollovers.

Rollovers:

* Because we have set Mouseinputenabled to false, the panel will not
register mouse input (this is good, because if we clicked on the panel,
it would come to the foreground thus coming OVER the main menu panel,
rendering it useless).
* This means we cannot use Button->IsArmed(), so we have to resort to
mouse positioning.
* So, with your Algebra skills, we use the OnThink function to calculate
the position of the mouse relative to your panel. If the mouse enters
your button bounds, we switch images thus effectively creating a rollover!

Alignment:

* Noticing that in-game, the menu has two extra options, we must shift
our buttons a bit to compensate (and make visible other images and buttons).
* Assigning a delta y shift value, we move everything accordingly in the
OnThink function. Because OnThink is called very often, we must make
sure we didn't already move it AND that we are in fact in-game. So we
set up a boolean value to make sure of that (and reset it when the game
is over) and a function to check whether we're in-game.

I'm so happy! Now my aesthetic mind is pleased and content. Go creative
brain power! Whoo!

I'll go into detail and provide the code for doing all of this in the
Wiki. :-) I just want to finish doing some tweaking.

Kamran wrote:
I could, I suppose. Right now, I just got rid of the New Game menu
option and replaced it with my own custom image (with rollover and
sounds) that links to my custom new game panel. I also created a new
panel for the menu which displays my mod's logo; that was easy.

I could play around with my idea and see how far I get.

Another idea just came to me and might be easier. In SourceScheme.res,
replace the MainMenu text with a font that has blank characters (I have
some fonts that don't have numbers, so they have blank chars instead),
but that take up space. So then, all you would do is build a panel
beneath the main menu  with your images and then it would /appear/ that
you made a custom menu. As for rollovers... hmmm.

The problems I foresee with that, albeit small and probably fixable, is
alignment (Getting your panel perfectly aligned in each resolution), and
doing image rollovers. The alignment isn't impossible, because right now
my New Game image does align perfectly in 1280x1024, 1680x1050, and is
only a few (5-10) pixels off in every other. If you make your MainMenu
Item height and length a bit bigger, I'm sure it would be fine.

PS. You have a very good descriptive writing ability, kudos. :P

Karl Jones wrote:
Kamran, how about posting your research to the developer wiki?  Lots of
good knowledge passes through this mailing list community, let's capture
and codify the best of it.

http://developer.valvesoftware.com/wiki/SDK_Docs

You've already got a good start -- I see a working agenda in your "I
would imagine" notes.  Post those notes to the wiki, then announce the
post to the mailing list.   When you find the full answer, or simply
more clues, or even more questions, update the wiki.

Meanwhile, who knows?  Those clues and questions will bubble and boil in
the wiki-cauldron, releasing hot buttered coder-memes into the
Steamosphere, with resultant high pressure zones and supersaturated
problem-solving clouds ... the perfect conditions for early morning
code-showers.

Karl Jones ... the Handy Vandal

[Kamran] However, cloning is intermediate-advanced level. I would
/imagine/ that
it'd be something like this:
* Create a new class, "ModOptions."
* Inherit from VGUI::Panel
* Load control settings from Options dialog res file.
* Set parent to ... ?




_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



--
Kamran A
Get Firefox! Safer, Faster, Better.
<http://www.spreadfirefox.com/?q=affiliates&id=0&t=85>
Down with Internet Explorer! Say "NO!" to Spyware! Use Firefox

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



--
Kamran A
Get Firefox! Safer, Faster, Better.
<http://www.spreadfirefox.com/?q=affiliates&id=0&t=85>
Down with Internet Explorer! Say "NO!" to Spyware! Use Firefox

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to