mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
ARC: add tooltips to admin actions to show the range of their effect (by rftr).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9303 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -35,6 +35,7 @@ How to add a new admin action:
|
||||
- add to SetupInfo to read from game settings
|
||||
- add to Init to add to pool of valid actions on game start
|
||||
- add admin-action-specific effect
|
||||
- if effect applies outside of towns, add help text range band as appropriate to SetupAdminActionBox
|
||||
|
||||
Points of interest:
|
||||
- Init() - set up rebel command for the first time
|
||||
@@ -187,6 +188,10 @@ enum RebelCommandHelpText // keep this synced with szRebelCommandHelpText in the
|
||||
RCHT_LOYALTY,
|
||||
RCHT_MAX_LOYALTY,
|
||||
RCHT_GRANT_SUPPLIES,
|
||||
RCHT_AA_TOWN_ONLY,
|
||||
RCHT_AA_TOWN_PLUS_ONE,
|
||||
RCHT_AA_TOWN_PLUS_TWO,
|
||||
RCHT_AA_TOWN_PLUS_THREE,
|
||||
};
|
||||
|
||||
// this must be kept in the same order as RebelCommandDirectives in the header
|
||||
@@ -245,6 +250,7 @@ std::vector<INT32> btnIds;
|
||||
ChangeAdminActionState adminActionChangeState;
|
||||
|
||||
// help text regions
|
||||
MOUSE_REGION adminActionHelpTextRegion[6];
|
||||
MOUSE_REGION adminTeamHelpTextRegion;
|
||||
MOUSE_REGION directiveDescriptionHelpTextRegion;
|
||||
MOUSE_REGION loyaltyHelpTextRegion;
|
||||
@@ -290,6 +296,8 @@ void ClearAllButtons()
|
||||
|
||||
void ClearAllHelpTextRegions()
|
||||
{
|
||||
for (int a = 0; a < 6; a++)
|
||||
MSYS_RemoveRegion(&adminActionHelpTextRegion[a]);
|
||||
MSYS_RemoveRegion(&adminTeamHelpTextRegion);
|
||||
MSYS_RemoveRegion(&directiveDescriptionHelpTextRegion);
|
||||
MSYS_RemoveRegion(&loyaltyHelpTextRegion);
|
||||
@@ -528,6 +536,7 @@ void SetupAdminActionBox(const UINT8 actionIndex, const UINT16 descriptionText,
|
||||
CHAR16 text[200];
|
||||
INT16 x;
|
||||
INT16 y;
|
||||
INT16 helpTextY;
|
||||
|
||||
switch (actionIndex % 3)
|
||||
{
|
||||
@@ -537,6 +546,7 @@ void SetupAdminActionBox(const UINT8 actionIndex, const UINT16 descriptionText,
|
||||
}
|
||||
|
||||
y = WEBSITE_TOP + 125 + 110 * (actionIndex / 3);
|
||||
helpTextY = y;
|
||||
|
||||
if (actionIndex < 5 || adminActionChangeState == CAAS_INIT)
|
||||
{
|
||||
@@ -569,6 +579,8 @@ void SetupAdminActionBox(const UINT8 actionIndex, const UINT16 descriptionText,
|
||||
y += 13;
|
||||
DisplayWrappedString(x, y, 140, 2, FONT10ARIAL, FONT_MCOLOR_BLACK, szRebelCommandAdminActionsText[descriptionText], FONT_MCOLOR_BLACK, FALSE, 0);
|
||||
|
||||
helpTextY = y;
|
||||
|
||||
// special case for index 5: show state change button
|
||||
if (actionIndex == 5)
|
||||
{
|
||||
@@ -591,6 +603,8 @@ void SetupAdminActionBox(const UINT8 actionIndex, const UINT16 descriptionText,
|
||||
y += 22;
|
||||
DisplayWrappedString(x, y, 140, 2, FONT10ARIAL, FONT_MCOLOR_BLACK, szRebelCommandAdminActionsText[newAction*2+1], FONT_MCOLOR_BLACK, FALSE, 0);
|
||||
|
||||
helpTextY = y;
|
||||
|
||||
y += 81;
|
||||
INT32 btnId = CreateTextButton(szRebelCommandText[RCT_CANCEL], FONT10ARIAL, FONT_MCOLOR_LTYELLOW, FONT_BLACK, BUTTON_USE_DEFAULT, x, y, 140, 18, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, [](GUI_BUTTON* btn, INT32 reason)
|
||||
{
|
||||
@@ -639,6 +653,46 @@ void SetupAdminActionBox(const UINT8 actionIndex, const UINT16 descriptionText,
|
||||
});
|
||||
btnIds.push_back(btnId);
|
||||
}
|
||||
|
||||
// admin action help text region
|
||||
MSYS_DefineRegion(&adminActionHelpTextRegion[actionIndex], x, helpTextY, x + 140, helpTextY + 68, MSYS_PRIORITY_HIGH,
|
||||
CURSOR_LAPTOP_SCREEN, [](MOUSE_REGION* pRegion, INT32 iReason)
|
||||
{
|
||||
const INT32 index = MSYS_GetRegionUserData(pRegion, 0);
|
||||
const RebelCommandAdminActions aa = (index == 5 && adminActionChangeState == CAAS_CHANGING) ?
|
||||
adminActionChangeList[adminActionChangeIndex] :
|
||||
rebelCommandSaveInfo.regions[iCurrentRegionId].actions[index];
|
||||
|
||||
CHAR16 text[250];
|
||||
switch (aa)
|
||||
{
|
||||
case RCAA_SAFEHOUSES:
|
||||
// 1 tile range
|
||||
swprintf(text, szRebelCommandHelpText[RCHT_AA_TOWN_PLUS_ONE]);
|
||||
break;
|
||||
|
||||
case RCAA_SUPPLY_DISRUPTION:
|
||||
case RCAA_PATHFINDERS:
|
||||
case RCAA_HARRIERS:
|
||||
// 1-2 tile range
|
||||
swprintf(text, szRebelCommandHelpText[RCHT_AA_TOWN_PLUS_TWO]);
|
||||
break;
|
||||
|
||||
case RCAA_SCOUTS:
|
||||
// 2-3 tile range
|
||||
swprintf(text, szRebelCommandHelpText[RCHT_AA_TOWN_PLUS_THREE]);
|
||||
break;
|
||||
|
||||
default:
|
||||
// apply in cities only
|
||||
swprintf(text, szRebelCommandHelpText[RCHT_AA_TOWN_ONLY]);
|
||||
break;
|
||||
}
|
||||
|
||||
SetRegionFastHelpText(&adminActionHelpTextRegion[index], text);
|
||||
}, MSYS_NO_CALLBACK);
|
||||
MSYS_AddRegion(&adminActionHelpTextRegion[actionIndex]);
|
||||
MSYS_SetRegionUserData(&adminActionHelpTextRegion[actionIndex], 0, actionIndex);
|
||||
}
|
||||
|
||||
void SetDirectiveDescriptionHelpText(INT32 reason, MOUSE_REGION& region, RebelCommandDirectives text)
|
||||
|
||||
@@ -11912,6 +11912,10 @@ STR16 szRebelCommandHelpText[] =
|
||||
L"|忠|诚|度\n \n许多行政命令的有效性取决于\n该地区的忠诚度,提高忠诚度\n能得到最大利益化。", //L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|最|高|忠|诚|度\n \n你需要说服当地人完全信任你。这可以\n通过为他们建立物资供应来实现,表明\n你打算改善他们的生活质量。", //L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|援|助|物|资\n \n将物资送到此处的反抗军手里,并允许\n他们根据需要使用。这将少量增加\n该地区的忠诚度,但是会略微增加制定\n该地区政策的成本。", //L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11908,6 +11908,10 @@ STR16 szRebelCommandHelpText[] = // TODO.Translate
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11912,6 +11912,10 @@ STR16 szRebelCommandHelpText[] =
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.",
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11890,6 +11890,10 @@ STR16 szRebelCommandHelpText[] = // TODO.Translate
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11813,6 +11813,10 @@ STR16 szRebelCommandHelpText[] = // TODO.Translate
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11899,6 +11899,10 @@ STR16 szRebelCommandHelpText[] = // TODO.Translate
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11912,6 +11912,10 @@ STR16 szRebelCommandHelpText[] = // TODO.Translate
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
@@ -11906,6 +11906,10 @@ STR16 szRebelCommandHelpText[] = // TODO.Translate
|
||||
L"|L|o|y|a|l|t|y\n \nThe effectiveness of many Administrative Actions depends on\nthe region's loyalty to your cause. It is in your best interest\nto raise loyalty as high as possible.",
|
||||
L"|M|a|x|i|m|u|m |L|o|y|a|l|t|y\n \nYou will need to convince the locals to fully trust you. This\ncan be done by creating a supply line to them, showing that\nyou intend to improve their quality of life.",
|
||||
L"|G|r|a|n|t |S|u|p|p|l|i|e|s\n \nSend supplies to the admin team here and allow them to use them\nas needed. This will increase the region's loyalty by a small amount\neach time you do this. However, doing this will slightly increase\nthe cost of enacting regional policies.",
|
||||
L"This Admin Action applies its bonus to town sectors only.", //TODO.Translate
|
||||
L"This Admin Action applies its bonus to town sectors, and\nsectors immediately adjacent to them.",
|
||||
L"This Admin Action applies its bonus to town sectors, one\nsector away at Tier 1, and up to two sectors away at Tier 2.",
|
||||
L"This Admin Action applies its bonus to town sectors, up to\ntwo sectors away at Tier 1, and up to three sectors away at Tier 2.",
|
||||
};
|
||||
|
||||
// follows a specific format:
|
||||
|
||||
Reference in New Issue
Block a user