1. Trying to show movement cost:
- Код: Выделить всё
_LHF_(MapHintCoordinates)
{
H3Position coord = P_AdventureMgr->mousePosition;
H3AdventureManager *adv = P_AdventureMgr;
UINT32 mixedDestination = adv->mousePosition.Mixed();
adv->MovementCalculations(mixedDestination);
H3TileMovement *mvmt = P_MovementMgr->GetMovementInfo(mixedDestination);
if (!mvmt->access.accessible)
return EXEC_DEFAULT;;
UINT16 cost = mvmt->movementCost;
sprintf(h3_TextBuffer, "%s Movements: %d", h3_TextBuffer , cost);
//sprintf(h3_TextBuffer, "%s {~%s}(%d, %d, %d)}", h3_TextBuffer, SODSP_COLOR.adventure_coordinates.String(), coord.x, coord.y, coord.z);
return EXEC_DEFAULT;
}
But having crashes with sprintf.
2. What is analog of this:
- Код: Выделить всё
sprintf(o_TextBuffer, "Test");
b_MsgBox(o_TextBuffer, 1);
3. Can I ask "SP_SpellText"?
Extended spellbook description works fine!
I am only missing "SP_SpellText".
update:3. Founded texts ini-files. Interesting how it could be done without text files, but with structures in the code.
At least I don't know how to get language settings.
1. Try working with a buffer then strcat() the buffer to h3_TextBuffer;
2. h3_MessageBox(text)
h3_MessageBoxChoice(text)
h3_MessageBoxRMB(text)
3. I simply grab the line off the .txt file.
See struct H3TextFile.