Skip to content

Commit

Permalink
TabView added disabled item checks
Browse files Browse the repository at this point in the history
  • Loading branch information
manups4e committed May 11, 2022
1 parent 903f935 commit 5249308
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion MenuExample/MenuExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CitizenFX.Core.Client, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CitizenFX.Core.Client.1.0.5539\lib\net45\CitizenFX.Core.Client.dll</HintPath>
<HintPath>..\packages\CitizenFX.Core.Client.1.0.5546\lib\net45\CitizenFX.Core.Client.dll</HintPath>
</Reference>
<Reference Include="ScaleformUI, Version=1.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion MenuExample/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CitizenFX.Core.Client" version="1.0.5539" targetFramework="net452" />
<package id="CitizenFX.Core.Client" version="1.0.5546" targetFramework="net452" />
</packages>
17 changes: 15 additions & 2 deletions ScaleformUI_Csharp/PauseMenu/TabView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ public async void Select(bool playSound)
var leftItem = Tabs[Index].LeftItemList[LeftItemIndex];
if (leftItem.ItemType == LeftItemType.Settings)
{

if (leftItem.ItemList[RightItemIndex] is SettingsItem rightItem)
{
if (!rightItem.Enabled)
Expand Down Expand Up @@ -549,7 +548,7 @@ public async void GoRight()
private int context = 0;
private int unused = 0;

public override void ProcessMouse()
public override async void ProcessMouse()
{
if (!IsUsingKeyboard(2))
{
Expand All @@ -574,6 +573,13 @@ public override void ProcessMouse()
_pause.SelectTab(itemId);
FocusLevel = 1;
Index = itemId;
if (Tabs[Index].LeftItemList.All(x => !x.Enabled)) break;
while (!Tabs[Index].LeftItemList[leftItemIndex].Enabled)
{
await BaseScript.Delay(0);
leftItemIndex++;
_pause._pause.CallFunction("SELECT_LEFT_ITEM_INDEX", leftItemIndex);
}
break;
/* TODO: CHANGE IT WITH SPRITE LIKE THE ACTUAL PAUSE MENU
case 1:
Expand Down Expand Up @@ -603,6 +609,13 @@ public override void ProcessMouse()
{
case 0: // going from unfocused to focused
FocusLevel = 1;
if (Tabs[Index].LeftItemList.All(x => !x.Enabled)) break;
while (!Tabs[Index].LeftItemList[leftItemIndex].Enabled)
{
await BaseScript.Delay(0);
leftItemIndex++;
_pause._pause.CallFunction("SELECT_LEFT_ITEM_INDEX", leftItemIndex);
}
break;
case 1: // left item in subitem tab pressed
if (focusLevel != 1)
Expand Down
19 changes: 14 additions & 5 deletions ScaleformUI_Csharp/ScaleformUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="CitizenFX.Core.Client, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CitizenFX.Core.Client.1.0.5020\lib\net45\CitizenFX.Core.Client.dll</HintPath>
<Reference Include="CitizenFX.Core.Client, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CitizenFX.Core.Client.1.0.5546\lib\net45\CitizenFX.Core.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
Expand All @@ -49,14 +49,23 @@
<Compile Include="Hud\Notifications\NotificationChars.cs" />
<Compile Include="Hud\Notifications\Notifications.cs" />
<Compile Include="Items\UIMenuStatsItem.cs" />
<Compile Include="LobbyMenu\Items\FriendItem.cs" />
<Compile Include="LobbyMenu\Items\LobbyItem.cs" />
<Compile Include="LobbyMenu\Items\MMPLayerItem.cs" />
<Compile Include="LobbyMenu\MainView.cs" />
<Compile Include="PauseMenuBase.cs" />
<Compile Include="PauseMenu\Items\BasicTabItem.cs" />
<Compile Include="PauseMenu\Items\KeymapItem.cs" />
<Compile Include="PauseMenu\Items\SettingsTabItem.cs" />
<Compile Include="PauseMenu\Items\SettingsItems\SettingsProgressItem.cs" />
<Compile Include="PauseMenu\Items\SettingsItems\SettingsCheckboxItem.cs" />
<Compile Include="PauseMenu\Items\SettingsItems\SettingsListItem.cs" />
<Compile Include="PauseMenu\Items\SettingsItems\SettingsSliderItem.cs" />
<Compile Include="PauseMenu\Items\SettingsItems\SettingsItem.cs" />
<Compile Include="PauseMenu\Items\StatsTabItem.cs" />
<Compile Include="PauseMenu\Tabs\BaseTab.cs" />
<Compile Include="PauseMenu\Tabs\TabSubmenuItem.cs" />
<Compile Include="PauseMenu\Tabs\SubmenuTab.cs" />
<Compile Include="PauseMenu\Tabs\TabLeftItem.cs" />
<Compile Include="PauseMenu\Tabs\TabTextItem.cs" />
<Compile Include="PauseMenu\Tabs\TextTab.cs" />
<Compile Include="PauseMenu\TabView.cs" />
<Compile Include="Scaleforms\BigMessage\BigMessage.cs" />
<Compile Include="Controls.cs" />
Expand Down
2 changes: 1 addition & 1 deletion ScaleformUI_Csharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CitizenFX.Core.Client" version="1.0.5020" targetFramework="net452" />
<package id="CitizenFX.Core.Client" version="1.0.5546" targetFramework="net452" />
</packages>

0 comments on commit 5249308

Please sign in to comment.