Page 1 of 1

What are labels? & How do i customize tool tips?

Posted: Wed Jan 04, 2012 10:06 pm
by fasty
1) What exactly are "labels?" You can set them in ZE and also the stock game has some in the ODF's, I was wondering what they are good for.
2) Is it possible to set custom tool tips? I know if you have your tool tips set to auto, you will get a messege when you go near command posts, but is it possible to have one for when you go near other objects and can I have them say what I want?

Re: Two quick questions

Posted: Wed Jan 04, 2012 10:13 pm
by THEWULFMAN
1: Labels are just that, labels. They serve no purpose other than helping developers keep track of things.

2: As far as I know, no. It's probably hardcoded into the exe. But I haven't really ever cared about it enough to look, so what do I know?

Re: Two quick questions

Posted: Wed Jan 04, 2012 11:38 pm
by Marth8880
I am almost completely positive I saw the localization for tool tips somewhere a few days ago. I'll have to get back to you on this...

Re: Two quick questions

Posted: Thu Jan 05, 2012 12:02 am
by Firefang
Marth8880 wrote:I am almost completely positive I saw the localization for tool tips somewhere a few days ago. I'll have to get back to you on this...
I can confirm this. Though, I don't believe you can edit the stock levels, only custom. But they are in the localize tool.

Re: What are labels? & How do i customize tool tips?

Posted: Thu Jan 05, 2012 9:05 am
by Cerfon Rournes
ifelem_helptext wrote:Code to create & modify 'helptext' -- a button icon and associated
-- text.
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- Code to create & modify 'helptext' -- a button icon and associated
-- text.

-- Code to make a new helptext. In the template, pass in the following:
--
-- Template.ScreenRelativeX, .ScreenRelativeX, .x, .y -- self-explanatory
-- Template.buttonicon = "btna" -- texture for button
-- Template.string = text to show.
-- Template.bRightJustify . nil = left, 1 = right justify

function NewHelptext(Template)
local TextW = 460

local ret = NewIFContainer {
ScreenRelativeX = Template.ScreenRelativeX,
ScreenRelativeY = Template.ScreenRelativeY,
y = Template.y, -- just above bottom
x = Template.x,

icon = NewIFImage {
ZPos = 200, -- behind most.

texture = Template.buttonicon,
localpos_l = Template.bRightJustify and -gHelptextIconWidth or 0,
localpos_t = gHelptextIconHeight * -0.5,
localpos_r = Template.bRightJustify and 0 or gHelptextIconWidth,
localpos_b = gHelptextIconHeight * 0.5,
-- inert = 1, -- Delete this out of lua once created (we'll never touch it again)
},

helpstr = NewIFText {
string = Template.string,
font = "gamefont_small",
textw = TextW,
x = Template.bRightJustify and -TextW-20 or 20,
y = -8,
ColorR = gHelptextTextColor[1], ColorG = gHelptextTextColor[2], ColorB = gHelptextTextColor[3], alpha = gHelptextTextAlpha,
halign = Template.bRightJustify and "right" or "left",
nocreatebackground = 1,
},
} -- end of ret

return ret
end

-- Helper function for right-justified icon + text containers. Each
-- container must have a .icon and a .helpstr field.
function gHelptext_fnMoveIcon(Container)
-- local fLeft, fTop, fRight, fBot = IFText_fnGetDisplayRect(Container.helpstr)
-- local TextW = fRight - fLeft + 10
-- IFImage_fnSetTexturePos(Container.icon,-TextW -gHelptextIconWidth, gHelptextIconHeight * -0.5, -TextW, gHelptextIconHeight * 0.5)
end

[/code]
Try this code out, it just may work. :wink:
Located in: C:\BF2_ModTools\data_***\Common\scripts

Re: Two quick questions

Posted: Thu Jan 05, 2012 5:36 pm
by Dakota
THEWULFMAN wrote:1: Labels are just that, labels. They serve no purpose other than helping developers keep track of things.

2: As far as I know, no. It's probably hardcoded into the exe. But I haven't really ever cared about it enough to look, so what do I know?
@2: as the others have said i have seen custom tool tips, just look at what it says when you get near a medic droid in one of dann's maps.

Re: What are labels? & How do i customize tool tips?

Posted: Thu Jan 05, 2012 10:59 pm
by fasty
Yes but can I create a tool tip for a custom object?