samp.directory
← Skrypty i biblioteki

Shiska/nDialog

Simple dialog system for sa-mp

Biblioteka★ 0zaktualizowano kwi 2020Brak licencjiPawnsampctl
Otwórz na GitHubie

To repozytorium nie ma pliku licencji. Jest publiczne do odczytu, ale samo to nie daje pozwolenia na ponowne użycie.

Zainstaluj za pomocą sampctl

sampctl package install Shiska/nDialog

Uruchom to w folderze swojego projektu. sampctl pobiera pakiet i to, od czego zależy.

Wypróbuj w kompilatorze Pawn →

Dodaje jej pliki include, razem z bibliotekami, od których zależy, do kompilatora Pawn w twojej przeglądarce, gotowe do dołączenia w skrypcie.

Zależy od 1 pakietu

README.md

nDialog

Dialog system similar to easyDialog but

  • No OnDialogPerformed, never saw any use for it, just put the code directly into the dialog
  • No format parameters in Dialog_Show, just format the string before calling the dialog
  • Uses ndi_ instead of debug_ as function prefix, you shouldn't call them manually anyways

Raison d'être: Just releasing old stuff which might by useful for someone

Installation

Simply install to your project:

sampctl package install Shiska/nDialog

Include in your code and begin using the library:

#include <nDialog>

Functions

Similar to easyDialog

native Dialog_Show(const playerid, _FUNCTION_, const style, const caption[], const info[], const button1[], const button2[]);
native Dialog_Close(const playerid);
native Dialog_Opened(const playerid);

Additional functions for OnDialogRepsonse
Could be used to replicate OnDialogPerformed by using ndi_IsDialog

// To check if the dialogid is part of the system
ndi_IsDialog(const dialogid);
// To get the dialog name (function name without prefix) of the dialogid
ndi_GetDialogName(const dialogid, buffer[32]);

Example

To call the dialog

Dialog_Show(playerid, MyDialog, DIALOG_STYLE_MSGBOX, "Caption", "Info", "Ok", "");

With the matching function handle called "MyDialog"

Dialog:MyDialog(playerid, response, listitem, inputtext[]) {
    //code
}

Testing

To test, simply run the package:

sampctl package run

dialogeasydialogpawnsa-mpsampctl

Ta strona jest zbudowana z tego, co GitHub publikuje o repozytorium. samp.directory nie hostuje kodu. Zgłoś problem z tym wpisem

Shiska/nDialog: Biblioteka SA-MP | samp.directory