Skip to content

Commit 9f56a0b

Browse files
committed
Fixed #8817 (Possibility to write in disabled Edit Field)
Added missing Vehicle.getUpgradeOnSlot (serverside version is already available)
1 parent b869516 commit 9f56a0b

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

MTA10/gui/CGUITabList.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,35 @@ void CGUITabList::SelectNext ( CGUITabListItem* pBase )
1818
bool bFound = false;
1919
for ( CGUITabIterator iter = m_Items.begin (); iter != m_Items.end () ; ++ iter )
2020
{
21-
if ( (*iter) == pBase )
21+
CGUITabListItem* pItem = *iter;
22+
23+
if ( pItem == pBase )
2224
{
2325
bFound = true;
2426
}
25-
else if ( bFound && (*iter)->ActivateOnTab () )
27+
else if ( bFound && pItem->IsEnabled () )
2628
{
2729
// we found an element that wants to get selected
30+
pItem->ActivateOnTab ();
2831
return;
2932
}
3033
}
3134

3235
// Contine to search an element from the beginning
3336
for ( CGUITabIterator iter = m_Items.begin (); iter != m_Items.end (); ++ iter )
3437
{
35-
if ( (*iter) == pBase )
38+
CGUITabListItem* pItem = *iter;
39+
40+
if ( pItem == pBase )
3641
{
3742
// just where we started, so we don't have to do anything
3843
return;
3944
}
40-
else if ( (*iter)->ActivateOnTab () )
45+
else if ( pItem->IsEnabled () )
4146
{
42-
// finally found something different than the current element
43-
return;
47+
// finally found something different than the current element
48+
pItem->ActivateOnTab ();
49+
return;
4450
}
4551
}
4652
}

MTA10/gui/CGUITabListItem.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
* Multi Theft Auto is available from http://www.multitheftauto.com/
1010
*
1111
*****************************************************************************/
12-
1312
#ifndef __CGUITABLISTITEM_H
1413
#define __CGUITABLISTITEM_H
1514

16-
class CGUITabListItem
15+
#include <gui/CGUI.h>
16+
17+
class CGUITabListItem : public CGUIElement
1718
{
1819
public:
1920
virtual bool ActivateOnTab ( void ) = 0;

MTA10/mods/shared_logic/lua/CLuaMain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ void CLuaMain::AddVehicleClass ( lua_State* luaVM )
308308
lua_classfunction ( luaVM, "getUpgrades", "getVehicleUpgrades" );
309309
lua_classfunction ( luaVM, "getUpgradeSlotName", "getVehicleUpgradeSlotName" );
310310
lua_classfunction ( luaVM, "getCompatibleUpgrades", "getVehicleCompatibleUpgrades" );
311+
lua_classfunction ( luaVM, "getUpgradeOnSlot", "getVehicleUpgradeOnSlot" );
311312

312313
lua_classfunction ( luaVM, "setComponentVisible", "setVehicleComponentVisible" );
313314
lua_classfunction ( luaVM, "setSirensOn", "setVehicleSirensOn" );

0 commit comments

Comments
 (0)