← Betikler ve kütüphaneler
by-not/not_dialog_pages
Zero-dependency paginated dialog system (LIST, TABLIST, TABLIST_HEADERS) with packed memory storage for SA-MP and open.mp.
Kütüphane★ 0dün güncellendiMITPawn
GitHub’da açPawn derleyicisinde dene →
Include dosyalarını, bağımlı olduğu kütüphanelerle birlikte tarayıcındaki Pawn derleyicisine ekler; bir betikte include etmeye hazır olur.
README.md
not_dialog_pages
Language: English | Español
A lightweight, zero-dependency paginated dialog system for SA-MP and open.mp.
Features
- Supports
DIALOG_STYLE_LIST,DIALOG_STYLE_TABLIST, andDIALOG_STYLE_TABLIST_HEADERS. - Automatic pagination based on
items_per_pageand SA-MP's 4096-byte dialog size limit. - Packed (
char) item buffer for low AMX memory usage. - Customizable Next / Back navigation items.
- Clean
DialogPages:callback macro with automatic global index resolution. - Zero external dependencies (requires only
<a_samp>).
Installation
- Copy
not_dialog_pages.incto yourpawno/include/(orqawno/include/) folder. - Include it after
<a_samp>:
#include <a_samp>
// Optional configuration (define before including):
#define MAX_DIALOG_ITEMS 200
#define DIALOG_MAX_LISTITEM_SIZE 128
#define NDP_AUTO_REMOVE_NEW_LINE true
// #define NDP_DEBUG
#include <not_dialog_pages>
Quick Start
DialogPages:MyItems(playerid, response, listitem, inputtext[])
{
if(!response) return 1;
new msg[64];
format(msg, sizeof(msg), "Selected item #%d: %s", listitem, inputtext);
SendClientMessage(playerid, -1, msg);
return 1;
}
stock ShowMyItems(playerid)
{
ClearDialogListitems(playerid);
for(new i = 0; i < 50; i++)
{
new row[32];
format(row, sizeof(row), "Item #%d", i + 1);
AddDialogListitem(playerid, row);
}
ShowPlayerDialogPages(playerid, "MyItems", DIALOG_STYLE_LIST,
"Items List", "Select", "Close", 10);
}
API Reference
| Function | Description |
|---|---|
ClearDialogListitems(playerid) | Clears the player's buffered items and pagination state. |
AddDialogListitem(playerid, const itemstr[]) | Adds an item to the player's dialog buffer. |
ShowPlayerDialogPages(...) | Calculates pages and displays page 0 to the player. |
GetDialogPage(playerid) | Returns the current 0-based page index. |
GetDialogItemsCount(playerid) | Returns the total number of buffered items. |
bool:IsDialogOpen(playerid) | Returns true if a paginated dialog is currently open. |
bool:SetDialogPage(playerid, page) | Switches to a specific 0-based page while open. |
Credits
- Written and refactored by not.
- Inspired by the original SA-MP Dialog-Pages library by Nickk888.
License
Released under the MIT License.
dialogsgtasaopenmppaginationpawnsamp
Bu sayfa GitHub’ın depo hakkında yayımladıklarından oluşturulur. samp.directory kodu barındırmaz. Bu ilanla ilgili bir sorun bildir