Giter Club home page Giter Club logo

ndialog's Introduction

nDialog

sampctl

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

ndialog's People

Contributors

shiska avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.