Hi
I've run into some trouble here, hope you can help me. For some reason the floating caption has disappeared and I can't find why. I've combed the code and it seems the problem may be in the Caption Window, which is... weird because I haven't even touched that window. Any suggestions?
#include "scripts\base.inc"
// this script runs in an endless loop and does all the user-interface work
// that needs to be periodically updated
// such as the floating items captions display and positioning
// and the sliding inventory window handling
global WinCaption;
var WinInv = Game.GetInventoryWindow();
// infinite loop
while(true){
// save the active object for later
var ActObj = Game.ActiveObject;
// handle the standard floating caption
if(Game.Interactive && ActObj!=null)
{
if (Game.InventoryVisible == false)
{
if (Game.SelectedItem==null)
{
WinCaption.X = Game.MouseX;
WinCaption.Y = Game.MouseY + 20;
WinCaption.TextAlign = TAL_LEFT;
WinCaption.Text = ActObj.Caption;
// keep the caption on screen
WinCaption.SizeToFit();
if(WinCaption.X + WinCaption.Width > Game.ScreenWidth) WinCaption.X = Game.ScreenWidth - WinCaption.Width;
if(WinCaption.Y + WinCaption.Height > Game.ScreenHeight) WinCaption.Y = Game.ScreenHeight - WinCaption.Height;
}
}
else
{
var prov = WinInv.GetControl("Description");
if (Game.SelectedItem==null)
{
prov.Text = ActObj.Caption;
}
else
{
// handle the caption when you want to use an object with another
var Item = Game.SelectedItem;
prov.Text = "Use " + Item.Caption + " with " + ActObj.Caption;
}
}
}
else WinCaption.Visible = false;
// go to sleep for 20 miliseconds to allow the engine to perform other tasks
// it is important for the "endless" scripts to call the Sleep command, otherwise the game will get stuck
Sleep(20);
}
EDIT:
Nevermind, already solved. As always, something really stupid.