Wintermute Engine => Technical forum => Topic started by: MrMyro on September 04, 2009, 10:59:31 PM
Title: Customised Captions
Post by: MrMyro on September 04, 2009, 10:59:31 PM
This is going to seem like a really dumb question, and I apologise if this is in the manual somewhere, because I can't find it in there anywhere.
I am currently using the standard set-up for the 'action/verb' menu, with no changes to the 'look at', 'pick up' and 'talk to' buttons (other than new graphics).
I can see that there is a text box that displays 'caption' in the WindowEdit view, which when viewed in game displays the 'caption' field of the item you have right clicked on (e.g. So when I right click on a cup, the text box object below my action window states 'cup').
What coding would I need to use and within which script, so that when I right click on my 'cup' item and then hover over my 'look at' button, the caption text box object no longer just reads 'cup', but would now say 'look at cup'?
I can use the 'caption' field on each of the 'look at' 'pick up' and 'talk to' buttons to display the correct 'Look at...' e.t.c, but without it including the name of the item at the end of the caption.
I hope this makes sense to someone and that some kind soul out there will be able to point me in the right direction.
Title: Re: Customised Captions
Post by: Mnemonic on September 07, 2009, 01:21:19 PM
You'd need to attach a script to each of the buttons. The script would contain a "MouseEntry" handler. Sor example the Look At button would contain something like this (untested):
Code: WME Script
// this variable is filled with the correct object by game.script; we'll just use it
global MenuObject;
// same with menu window
global WinMenu;
on"MouseEntry"
{
if(MenuObject != null)
{
var CaptionText = "Look at " + MenuObject.Caption;
// now we need to display the caption somewhere
// we'll ask the menu window for a control called "caption"
var CaptionControl = WinMenu.GetControl("caption");