Код:
TwAddButton(twBar_SPPatches, set.patch[i].name, applyRemoveGTAPatch, (void *)&set.patch[i], NULL);
------------------------------------- Заменить на ------------------------------------------->
TwAddVarCB(twBar_SPPatches, set.patch[i].name, TW_TYPE_BOOLCPP, SetPatchCallback, GetPatchCallback, (void *)&set.patch[i], NULL);
Код:
TwAddButton(twBar_SAMPPatches, set.sampPatch[i].name, applyRemoveSAMPPatch, (void *)&set.sampPatch[i], NULL);
------------------------------------- Заменить на ------------------------------------------->
TwAddVarCB(twBar_SAMPPatches, set.sampPatch[i].name, TW_TYPE_BOOLCPP, SetPatchCallback, GetPatchCallback, (void *)&set.sampPatch[i], NULL);
Код:
void TW_CALL applyRemoveGTAPatch(void *clientData)
{
if(clientData)
{
struct patch_set patch = *(struct patch_set *)clientData;
if(patch.installed || patch.failed)
patcher_remove(&patch);
else
patcher_install(&patch);
}
}
void TW_CALL applyRemoveSAMPPatch(void *clientData)
{
if(clientData)
{
struct patch_set patch = *(struct patch_set *)clientData;
if(patch.installed || patch.failed)
patcher_remove(&patch);
else
patcher_install(&patch);
}
}
------------------------------------- Заменить на ------------------------------------------->
void TW_CALL SetPatchCallback(const void *value, void *clientData)
{
if(clientData)
{
struct patch_set *patch = (struct patch_set *)clientData;
if(*(bool *)value)
patcher_install(patch);
else
patcher_remove(patch);
}
}
void TW_CALL GetPatchCallback(void *value, void *clientData)
{
if(clientData)
{
struct patch_set *patch = (struct patch_set *)clientData;
*(bool *)value = patch->installed ? 1 : 0;
}
}