Seileach
Chieftain
- Joined
- Feb 1, 2002
- Messages
- 79
hi
i was tweaking a bit with WHoward's Map Pin mod. i wanted to alter it so it would display map labels.
i did some minor changes to MapPins.lua
first i created a new string array to handle text color (line 25 aprox)
local g_TextColor = {
{color="[COLOR_XP_BLUE]"}, {color="[COLOR_CITY_BROWN]"}, {color="[COLOR_BROWN_TEXT]"}, {color="[COLOR_CITY_GREEN]"}, {color="[COLOR_FONT_RED]"},
}
and replaced this (line 440 aprox)
pin.instance.Text:SetText(GetFlag(iType))
with this
if (iType >= 6) then
labelText = Locale.ConvertTextKey(g_TextColor[iType-5].color) .. sText .. "[ENDCOLOR]"
pin.instance.Text:SetText(labelText)
else
pin.instance.Text:SetText(GetFlag(iType))
end
so that the first 5 icons behave as icons and the last 5 as labels, each with a different color.
i also changed MapPins.xml to change the label text style (line 7)
<Instance Name="Pin">
<WorldAnchor ID="Anchor">
<Button ID="Text" Size="24,24" Anchor="C,C" String="[ICON_TEAM_3]" Font="TwCenMT24" FontStyle="Stroke" ToolTip=""/>
</WorldAnchor>
</Instance>
i changed FlagIcons.xml too to reflect the changes i had done in the other two files, but it's not relevant to the issue troubling me
<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_MAPPINS_FLAG_UNKNOWN">
<Text>[ICON_CAPITAL]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_1">
<Text>[ICON_CITY_STATE]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_2">
<Text>[ICON_RAZING]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_3">
<Text>[ICON_WAR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_4">
<Text>[ICON_CAPITAL]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_5">
<Text>[ICON_GOLDEN_AGE]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_6">
<Text>[COLOR_XP_BLUE]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_7">
<Text>[COLOR_CITY_BROWN]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_8">
<Text>[COLOR_BROWN_TEXT]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_9">
<Text>[COLOR_CITY_GREEN]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_10">
<Text>[COLOR_FONT_RED]@[ENDCOLOR]</Text>
</Row>
</Language_en_US>
</GameData>
the result was this
and this
not bad, right?
thing is, the labels overlap the top bar, the minimaps, the menus, you name it
it kinda breaks it for me...
any hints on how i could fix this? or if it can be fixed?
my programming skills are limited, i think i've gone as far as i can go on my own.
cheers!
i was tweaking a bit with WHoward's Map Pin mod. i wanted to alter it so it would display map labels.
i did some minor changes to MapPins.lua
first i created a new string array to handle text color (line 25 aprox)
Spoiler :
local g_TextColor = {
{color="[COLOR_XP_BLUE]"}, {color="[COLOR_CITY_BROWN]"}, {color="[COLOR_BROWN_TEXT]"}, {color="[COLOR_CITY_GREEN]"}, {color="[COLOR_FONT_RED]"},
}
and replaced this (line 440 aprox)
Spoiler :
pin.instance.Text:SetText(GetFlag(iType))
with this
Spoiler :
if (iType >= 6) then
labelText = Locale.ConvertTextKey(g_TextColor[iType-5].color) .. sText .. "[ENDCOLOR]"
pin.instance.Text:SetText(labelText)
else
pin.instance.Text:SetText(GetFlag(iType))
end
so that the first 5 icons behave as icons and the last 5 as labels, each with a different color.
i also changed MapPins.xml to change the label text style (line 7)
Spoiler :
<Instance Name="Pin">
<WorldAnchor ID="Anchor">
<Button ID="Text" Size="24,24" Anchor="C,C" String="[ICON_TEAM_3]" Font="TwCenMT24" FontStyle="Stroke" ToolTip=""/>
</WorldAnchor>
</Instance>
i changed FlagIcons.xml too to reflect the changes i had done in the other two files, but it's not relevant to the issue troubling me
Spoiler :
<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_MAPPINS_FLAG_UNKNOWN">
<Text>[ICON_CAPITAL]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_1">
<Text>[ICON_CITY_STATE]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_2">
<Text>[ICON_RAZING]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_3">
<Text>[ICON_WAR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_4">
<Text>[ICON_CAPITAL]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_5">
<Text>[ICON_GOLDEN_AGE]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_6">
<Text>[COLOR_XP_BLUE]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_7">
<Text>[COLOR_CITY_BROWN]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_8">
<Text>[COLOR_BROWN_TEXT]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_9">
<Text>[COLOR_CITY_GREEN]@[ENDCOLOR]</Text>
</Row>
<Row Tag="TXT_KEY_MAPPINS_FLAG_10">
<Text>[COLOR_FONT_RED]@[ENDCOLOR]</Text>
</Row>
</Language_en_US>
</GameData>
the result was this
Spoiler :
and this
Spoiler :
not bad, right?
thing is, the labels overlap the top bar, the minimaps, the menus, you name it
Spoiler :
it kinda breaks it for me...
any hints on how i could fix this? or if it can be fixed?
my programming skills are limited, i think i've gone as far as i can go on my own.
cheers!