diff --git a/ClassicalSharp/2D/Widgets/TableWidget.cs b/ClassicalSharp/2D/Widgets/TableWidget.cs index eb31dc49b..e686d0fe8 100644 --- a/ClassicalSharp/2D/Widgets/TableWidget.cs +++ b/ClassicalSharp/2D/Widgets/TableWidget.cs @@ -155,6 +155,8 @@ namespace ClassicalSharp.Gui.Widgets { for (int i = 0; i < Elements.Length; i++) { if (Elements[i] == block) SelectedIndex = i; } + // When holding air, inventory should open at middle + if (block == Block.Air) SelectedIndex = -1; scroll.ScrollY = (SelectedIndex / ElementsPerRow) - (MaxRowsDisplayed - 1); scroll.ClampScrollY(); diff --git a/src/Client/AsyncDownloader.h b/src/Client/AsyncDownloader.h index 0771eae59..7c71edf39 100644 --- a/src/Client/AsyncDownloader.h +++ b/src/Client/AsyncDownloader.h @@ -18,7 +18,7 @@ typedef struct AsyncRequest_ { DateTime TimeAdded; DateTime TimeDownloaded; - UInt8 RequestType; + UInt16 ResponseCode; union { struct { void* Ptr; UInt32 Size; } ResultData; @@ -29,6 +29,7 @@ typedef struct AsyncRequest_ { DateTime LastModified; /* Time item cached at (if at all) */ UInt8 Etag[String_BufferSize(STRING_SIZE)]; /* ETag of cached item (if any) */ + UInt8 RequestType; } AsyncRequest; void ASyncRequest_Free(AsyncRequest* request); diff --git a/src/Client/Widgets.c b/src/Client/Widgets.c index 8c6cf5804..d2890e60c 100644 --- a/src/Client/Widgets.c +++ b/src/Client/Widgets.c @@ -867,6 +867,8 @@ void TableWidget_SetBlockTo(TableWidget* widget, BlockID block) { for (i = 0; i < widget->ElementsCount; i++) { if (widget->Elements[i] == block) widget->SelectedIndex = i; } + /* When holding air, inventory should open at middle */ + if (block == BLOCK_AIR) widget->SelectedIndex = -1; widget->Scroll.ScrollY = widget->SelectedIndex / widget->ElementsPerRow; widget->Scroll.ScrollY -= (TABLE_MAX_ROWS_DISPLAYED - 1);