Skip to content

Commit 6cb6772

Browse files
committed
Fix russifier resetting after selection cancelation
1 parent 0e599cd commit 6cb6772

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

russifier.inc

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static
5959
Text:TD_Background = Text:INVALID_TEXT_DRAW,
6060
Text:TD_Text[RussifierType] = {INVALID_TEXT_DRAW, ...},
6161
bool:IsSettingsShowed[MAX_PLAYERS char],
62+
RussifierType:gPlayerRussifier[MAX_PLAYERS char],
6263
gSettingsText[RUSSIFIER_TEXT_LENGTH char] = !"ß ìîãó ïðî÷èòàòü ýòîò òåêñò, ýòî ìîé ðóñèôèêàòîð";
6364

6465
const
@@ -207,7 +208,7 @@ public OnPlayerClickTextDraw(playerid, Text:clickedid)
207208

208209
for (new RussifierType:type; type < TEXT_RUSSIFIERS_COUNT; type++) {
209210
if (TD_Text[type] == clickedid) {
210-
SetPlayerRussifierType(playerid, type);
211+
gPlayerRussifier{playerid} = type;
211212
HidePlayerRussifierSettings(playerid);
212213
CallLocalFunction("OnPlayerRussifierSelect", "iii", playerid, true, _:type);
213214
return 1;
@@ -258,6 +259,8 @@ stock ShowPlayerRussifierSettings(playerid)
258259
return 0;
259260
}
260261

262+
gPlayerRussifier{playerid} = GetPlayerRussifierType(playerid);
263+
261264
for (new RussifierType:type; type < TEXT_RUSSIFIERS_COUNT; type++) {
262265
SetPlayerRussifierType(playerid, type);
263266
TextDrawShowForPlayer(playerid, TD_Text[type]);
@@ -275,6 +278,8 @@ stock HidePlayerRussifierSettings(playerid)
275278
return 0;
276279
}
277280

281+
SetPlayerRussifierType(playerid, gPlayerRussifier{playerid});
282+
278283
for (new RussifierType:type; type < TEXT_RUSSIFIERS_COUNT; type++) {
279284
TextDrawHideForPlayer(playerid, TD_Text[type]);
280285
TextDrawHideForPlayer(playerid, TD_Background);

0 commit comments

Comments
 (0)