Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace ShipInventoryUpdated.Dependencies.InteractiveTerminalAPI;

public class ShipApplication : PageApplication
public class ShipApplication : PageApplication<CursorElement>
{
#region Application

Expand Down Expand Up @@ -95,7 +95,7 @@ Action<int> action
var entriesPerPage = GetEntriesPerPage<int>([]);

var cursorCount = items.Length;
(T[][] pageGroups, CursorMenu[] cursorMenus, IScreen[] screens) = GetPageEntries(items);
(T[][] pageGroups, BaseCursorMenu<CursorElement>[] cursorMenus, IScreen[] screens) = GetPageEntries(items);

for (var i = 0; i < pageGroups.Length; i++)
{
Expand Down Expand Up @@ -132,7 +132,7 @@ Action<int> action
};
}

cursorMenus[i] = new CursorMenu
cursorMenus[i] = new CursorMenu<CursorElement>
{
cursorIndex = 0,
elements = elements
Expand All @@ -155,7 +155,7 @@ Action<int> action
// Set the current page's cursor
cursorMenus[currentPageIndex].cursorIndex = currentCursorIndex;

currentPage = PageCursorElement.Create(currentPageIndex, screens, cursorMenus);
currentPage = PageCursorElement<CursorElement>.Create(currentPageIndex, screens, cursorMenus);
currentCursorMenu = currentPage.GetCurrentCursorMenu();
currentScreen = currentPage.GetCurrentScreen();

Expand All @@ -168,7 +168,7 @@ Action<int> action

private void LockedScreen()
{
var optionMenu = new CursorMenu
var optionMenu = new CursorMenu<CursorElement>
{
cursorIndex = 0,
elements =
Expand Down Expand Up @@ -197,7 +197,7 @@ private void LockedScreen()
optionMenu
]
);
currentPage = PageCursorElement.Create(0, [screen], [optionMenu]);
currentPage = PageCursorElement<CursorElement>.Create(0, [screen], [optionMenu]);
SwitchScreen(screen, optionMenu, true);
}

Expand All @@ -218,7 +218,7 @@ private void MainScreen()
InfoCursorElement()
};

var optionMenu = new CursorMenu
var optionMenu = new CursorMenu<CursorElement>
{
cursorIndex = Inventory.Count > 0 ? 0 : elements.Length - 1,
elements = elements
Expand All @@ -238,7 +238,7 @@ private void MainScreen()
optionMenu
]
);
currentPage = PageCursorElement.Create(0, [screen], [optionMenu]);
currentPage = PageCursorElement<CursorElement>.Create(0, [screen], [optionMenu]);
SwitchScreen(screen, optionMenu, true);
}

Expand All @@ -263,7 +263,7 @@ private void ConfirmElement(string message, Action? confirmCallback, Action? dec
// Elements
var automaticPositive = Configuration.Instance?.Terminal.AutomaticPositiveAnswer.Value ?? false;

var optionMenu = new CursorMenu
var optionMenu = new CursorMenu<CursorElement>
{
cursorIndex = automaticPositive ? 1 : 0,
elements =
Expand Down Expand Up @@ -300,7 +300,7 @@ private void ConfirmElement(string message, Action? confirmCallback, Action? dec
]
);

currentPage = PageCursorElement.Create(0, [screen], [optionMenu]);
currentPage = PageCursorElement<CursorElement>.Create(0, [screen], [optionMenu]);
SwitchScreen(screen, optionMenu, true);

RegisterExitAction(_ => _confirmExitCallback?.Invoke());
Expand Down Expand Up @@ -499,7 +499,7 @@ private void GetInfo()

var items = Inventory.Items;

var options = new CursorMenu
var options = new CursorMenu<CursorElement>
{
cursorIndex = 0,
elements = []
Expand All @@ -521,7 +521,7 @@ private void GetInfo()
]
);

currentPage = PageCursorElement.Create(0, [screen], [options]);
currentPage = PageCursorElement<CursorElement>.Create(0, [screen], [options]);
SwitchScreen(screen, options, true);

RegisterExitAction(_ => MainScreen());
Expand Down
2 changes: 1 addition & 1 deletion src/ShipInventoryUpdated/ShipInventoryUpdated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace ShipInventoryUpdated;

[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
// Hard
[BepInDependency("WhiteSpike.InteractiveTerminalAPI")]
[BepInDependency("WhiteSpike.InteractiveTerminalAPI", "1.3.0")]
[BepInDependency(LethalLib.Plugin.ModGUID)]
// Soft
[BepInDependency(LethalConfig.PluginInfo.Guid, BepInDependency.DependencyFlags.SoftDependency)]
Expand Down
2 changes: 1 addition & 1 deletion src/ShipInventoryUpdated/ShipInventoryUpdated.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- Hard -->
<PackageReference
Include="WhiteSpike-Interactive_Terminal_API"
Version="1.2.0"
Version="1.3.0"
PrivateAssets="all"
/>
<PackageReference
Expand Down