mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
take popup option names by const reference, not by pointer
POPUP_OPTION copies the name it is given -- `this->name = *newName` into a
std::wstring member -- but its constructor took a std::wstring*, so 64 call
sites spelled the argument `&std::wstring( pStr )`. Taking the address of a
temporary is ill-formed, and clang refuses it outright:
error: taking the address of a temporary object of type 'std::wstring'
It happens to work under MSVC because the temporary outlives the call, dying
at the end of the full expression rather than before the copy. Nothing was
corrupt; the code was just spelling "pass me a string" in a way the language
does not allow.
A const reference says what these functions actually want, so the call sites
lose the &, and the two places that allocated a string purely to have an
address to pass -- POPUP_SUB_POPUP_OPTION's default constructor, which carried
a "TODO: possible memmory leak!" saying as much, and a "Dummy generator"
option -- stop leaking one.
Converted: POPUP_OPTION's constructor and setName, POPUP::addOption and
addSubMenuOption, and both POPUP_SUB_POPUP_OPTION constructors. The popupDef
family in popup_definition.* keeps its std::wstring* because it owns what it
is handed and stores the pointer; that is a different design and a different
change. The three calls it makes into the converted API now dereference.
Verification:
grep -rn '&std::wstring' --include=*.cpp --include=*.h . # nothing
ninja -C build parse # no popup_* or SkillMenu sites remain
ninja -C build -k 0 # Release, four applications, green
ninja -C build-debug -k 0 # Debug, four applications, green
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
majcosta
co-authored by
Claude Opus 4.8
parent
83b637aa73
commit
5e2982c509
+35
-35
@@ -164,11 +164,11 @@ TraitSelection::Setup( UINT32 aVal )
|
||||
|
||||
if (traitarray[i] == AUTOBANDAGESKILLS)
|
||||
{
|
||||
pOption = new POPUP_OPTION(&std::wstring(pStr), new popupCallbackFunction<void, UINT32>(&Wrapper_Setup_AutobandageSelection, traitarray[i]));
|
||||
pOption = new POPUP_OPTION(std::wstring(pStr), new popupCallbackFunction<void, UINT32>(&Wrapper_Setup_AutobandageSelection, traitarray[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
pOption = new POPUP_OPTION(&std::wstring(pStr), new popupCallbackFunction<void, UINT32>(&Wrapper_Setup_SkillSelection, traitarray[i]));
|
||||
pOption = new POPUP_OPTION(std::wstring(pStr), new popupCallbackFunction<void, UINT32>(&Wrapper_Setup_SkillSelection, traitarray[i]));
|
||||
}
|
||||
|
||||
// if we cannot perform this skill, grey it out
|
||||
@@ -183,7 +183,7 @@ TraitSelection::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_TraitSelection, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_TraitSelection, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
|
||||
// grab soldier's x,y screen position
|
||||
@@ -243,11 +243,11 @@ SkillSelection::Setup( UINT32 aVal )
|
||||
swprintf( pStr, pTraitSkillsMenuStrings[uiCounter] );
|
||||
|
||||
if ( uiCounter == SKILLS_RADIO_ARTILLERY)
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Setup_ArtillerySector, uiCounter ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Setup_ArtillerySector, uiCounter ) );
|
||||
else if ( uiCounter == SKILLS_RADIO_CALLREINFORCEMENTS)
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Setup_ReinforcementSector, uiCounter ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Setup_ReinforcementSector, uiCounter ) );
|
||||
else
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
|
||||
// if we cannot perform this skill, grey it out
|
||||
if ( !(pSoldier->CanUseSkill(uiCounter, TRUE)) )
|
||||
@@ -267,7 +267,7 @@ SkillSelection::Setup( UINT32 aVal )
|
||||
{
|
||||
swprintf( pStr, pTraitSkillsMenuStrings[uiCounter] );
|
||||
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
|
||||
// if we cannot perform this skill, grey it out
|
||||
if ( !( pSoldier->CanUseSkill( uiCounter, TRUE, sTraitsMenuTargetGridNo ) ) )
|
||||
@@ -287,7 +287,7 @@ SkillSelection::Setup( UINT32 aVal )
|
||||
{
|
||||
swprintf( pStr, pTraitSkillsMenuStrings[uiCounter] );
|
||||
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
|
||||
// if we cannot perform this skill, grey it out
|
||||
if ( !( pSoldier->CanUseSkill( uiCounter, TRUE, sTraitsMenuTargetGridNo ) ) )
|
||||
@@ -308,9 +308,9 @@ SkillSelection::Setup( UINT32 aVal )
|
||||
swprintf( pStr, pTraitSkillsMenuStrings[uiCounter] );
|
||||
|
||||
if ( uiCounter == SKILLS_DRAG )
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Setup_DragSelection, uiCounter ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Setup_DragSelection, uiCounter ) );
|
||||
else
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_SkillSelection, uiCounter ) );
|
||||
|
||||
// if we cannot perform this skill, grey it out
|
||||
if ( !(pSoldier->CanUseSkill( uiCounter, TRUE, sTraitsMenuTargetGridNo )) )
|
||||
@@ -334,7 +334,7 @@ SkillSelection::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_SkillSelection, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_SkillSelection, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ ArtillerySector::Setup( UINT32 aVal )
|
||||
|
||||
swprintf( pStr, L"%c%d", loopY + 'A' - 1, loopX );
|
||||
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Setup_ArtilleryTeam, sectornr ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Setup_ArtilleryTeam, sectornr ) );
|
||||
|
||||
// grey out if no artillery can be called from this sector
|
||||
if ( !IsValidArtilleryOrderSector( loopX, loopY, pSoldier->bSectorZ, pSoldier->bTeam ) && !IsValidArtilleryOrderSector( loopX, loopY, pSoldier->bSectorZ, MILITIA_TEAM ) )
|
||||
@@ -459,7 +459,7 @@ ArtillerySector::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_ArtillerySector, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_ArtillerySector, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
|
||||
// certain traits have skills whose effects depend on wether someone is near to us (squadleader, commissar). We therefore display our radius of effect while this display is open
|
||||
@@ -503,7 +503,7 @@ ArtilleryTeam::Setup( UINT32 aVal )
|
||||
// order artillery from militia
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_MILITIA] );
|
||||
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ArtilleryTeam, MILITIA_TEAM ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ArtilleryTeam, MILITIA_TEAM ) );
|
||||
|
||||
// grey out if no ArtilleryTeam can be called from this sector
|
||||
if ( !IsValidArtilleryOrderSector( sSectorX, sSectorY, pSoldier->bSectorZ, MILITIA_TEAM ) )
|
||||
@@ -516,7 +516,7 @@ ArtilleryTeam::Setup( UINT32 aVal )
|
||||
// order artillery from our mercs
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_OTHERSQUADS] );
|
||||
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, INT8>( &Wrapper_Function_ArtilleryTeam, pSoldier->bTeam ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, INT8>( &Wrapper_Function_ArtilleryTeam, pSoldier->bTeam ) );
|
||||
|
||||
// grey out if no ArtilleryTeam can be called from this sector
|
||||
if ( !IsValidArtilleryOrderSector( sSectorX, sSectorY, pSoldier->bSectorZ, pSoldier->bTeam ) )
|
||||
@@ -528,7 +528,7 @@ ArtilleryTeam::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_ArtilleryTeam, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_ArtilleryTeam, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
|
||||
// certain traits have skills whose effects depend on wether someone is near to us (squadleader, commissar). We therefore display our radius of effect while this display is open
|
||||
@@ -604,7 +604,7 @@ ReinforcementSector::Setup( UINT32 aVal )
|
||||
|
||||
swprintf( pStr, L"%c%d", loopY + 'A' - 1, loopX );
|
||||
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Setup_ReinforcementNumber, sectornr ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Setup_ReinforcementNumber, sectornr ) );
|
||||
|
||||
// grey out if no reinforcements can be called from this sector
|
||||
if ( !CanRequestMilitiaReinforcements( pSoldier->sSectorX, pSoldier->sSectorY, loopX, loopY ) )
|
||||
@@ -617,7 +617,7 @@ ReinforcementSector::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Cancel_ReinforcementSector, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Cancel_ReinforcementSector, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
|
||||
// 5 militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 5 );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 5 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 5 ) );
|
||||
|
||||
if ( numberofmilitia < 5 )
|
||||
{
|
||||
@@ -665,7 +665,7 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
|
||||
// 10 militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 10 );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 10 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 10 ) );
|
||||
|
||||
if ( numberofmilitia < 10 )
|
||||
{
|
||||
@@ -677,7 +677,7 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
|
||||
// 15 militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 15 );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 15 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 15 ) );
|
||||
|
||||
if ( numberofmilitia < 15 )
|
||||
{
|
||||
@@ -689,7 +689,7 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
|
||||
// 20 militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 20 );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 20 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 20 ) );
|
||||
|
||||
if ( numberofmilitia < 20 )
|
||||
{
|
||||
@@ -699,7 +699,7 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
|
||||
// 30 militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 30 );
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 30 ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 30 ) );
|
||||
|
||||
if ( numberofmilitia < 30 )
|
||||
{
|
||||
@@ -709,7 +709,7 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
|
||||
// 40 militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_X_MILITIA], 40 );
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 40 ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, 40 ) );
|
||||
|
||||
if ( numberofmilitia < 40 )
|
||||
{
|
||||
@@ -722,12 +722,12 @@ ReinforcementNumber::Setup( UINT32 aVal )
|
||||
// all militia option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_ALL_MILITIA] );
|
||||
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, numberofmilitia ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_ReinforcementNumber, numberofmilitia ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Cancel_ReinforcementNumber, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Cancel_ReinforcementNumber, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ SoldierSelection::Setup( UINT32 aVal )
|
||||
{
|
||||
swprintf( pStr, L"%s", id->GetName() );
|
||||
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void, UINT16>( &Wrapper_Function_SoldierSelection, id ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void, UINT16>( &Wrapper_Function_SoldierSelection, id ) );
|
||||
|
||||
// grey out if no artillery can be called from this sector
|
||||
if ( 0 )
|
||||
@@ -809,7 +809,7 @@ SoldierSelection::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_SoldierSelection, 0 ) );
|
||||
pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Cancel_SoldierSelection, 0 ) );
|
||||
GetPopup()->addOption( *pOption );
|
||||
}
|
||||
|
||||
@@ -871,7 +871,7 @@ DragSelection::Setup( UINT32 aVal )
|
||||
{
|
||||
swprintf( pStr, L"%s", cnt->GetName( ) );
|
||||
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection, cnt ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection, cnt ) );
|
||||
|
||||
GetPopup( )->addOption( *pOption );
|
||||
}
|
||||
@@ -887,7 +887,7 @@ DragSelection::Setup( UINT32 aVal )
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CORPSES], pCorpse->name );
|
||||
|
||||
// we have to use an offset of NOBODY in order to differentiate between person and corpse
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection, (*it) + NOBODY ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection, (*it) + NOBODY ) );
|
||||
|
||||
GetPopup( )->addOption( *pOption );
|
||||
}
|
||||
@@ -914,7 +914,7 @@ DragSelection::Setup( UINT32 aVal )
|
||||
swprintf(pStr, L"%s (%s)", buf, FaceDirs[gOneCDirection[ubDirection]]);
|
||||
|
||||
// we have to use an offset of NOBODY in order to differentiate between person and corpse
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection_GridNo, sTempGridNo ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection_GridNo, sTempGridNo ) );
|
||||
|
||||
GetPopup()->addOption( *pOption );
|
||||
}
|
||||
@@ -923,7 +923,7 @@ DragSelection::Setup( UINT32 aVal )
|
||||
|
||||
// cancel option
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_CANCEL] );
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Cancel_DragSelection, 0 ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Cancel_DragSelection, 0 ) );
|
||||
GetPopup( )->addOption( *pOption );
|
||||
}
|
||||
|
||||
@@ -1052,7 +1052,7 @@ EquipmentSelection::Setup(UINT32 aVal)
|
||||
int nChars = MultiByteToWideChar( CP_ACP, 0, coca, -1, NULL, 0 );
|
||||
MultiByteToWideChar( CP_UTF8, 0, coca, -1, tmpchar, nChars );
|
||||
|
||||
pOption = new POPUP_OPTION( &std::wstring( tmpchar ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_EquipmentSelection, i ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( tmpchar ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_EquipmentSelection, i ) );
|
||||
|
||||
pOption->color_foreground = FONT_GREEN;
|
||||
|
||||
@@ -1063,13 +1063,13 @@ EquipmentSelection::Setup(UINT32 aVal)
|
||||
if ( gEquipmentSelectionMaxEntriesShown < gTemplateVector.size( ) )
|
||||
{
|
||||
swprintf( pStr, pSkillMenuStrings[SKILLMENU_MORE] );
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_EquipmentSelection, 99999 ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_EquipmentSelection, 99999 ) );
|
||||
GetPopup( )->addOption( *pOption );
|
||||
}
|
||||
|
||||
// cancel option
|
||||
swprintf(pStr, pSkillMenuStrings[SKILLMENU_CANCEL]);
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_EquipmentSelection, 99998 ) );
|
||||
pOption = new POPUP_OPTION( std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_EquipmentSelection, 99998 ) );
|
||||
GetPopup()->addOption(*pOption);
|
||||
|
||||
SetPos(usTraitMenuPosX, usTraitMenuPosY);
|
||||
|
||||
Reference in New Issue
Block a user