[Include] Alternative Dialogs - Dialogs with the new design
#1

Alternative Dialogs

by Nexius


Description:

Alternative Dialogs - dialogs with a new design.
They have nearly all of the functions that the default dialogs have, but they can be used together.
The new design drawn via textdraws, it will radically change the interface of your server.

How do they look:

AD_STYLE_LIST / SKINS


To choose any of the available skins, just write the following before connecting the include:
Code:
#define AD_SKIN_1 //1 - ID of the skin
Functions:
  • ShowPlayerAltDialog(playerid, dialogid, style, caption[], info[], button1[], button2[] = "") - use to show the dialog for a player
  • OnAltDialogResponse(playerid, dialogid, response, listitem) - called when a player "response" on the dialog
  • GetPlayerAltDialog(playerid) - use to get a player's current dialog ID
How to install:

Download alt_dialogs.inc by the link below.

Include it to the desired gamemode thus:

Code:
#include <alt_dialogs>
And recompile your script.

Then you can use any of the available above features in your script.

Download:

* v6.5: MediaFire Pastebin

Example usage:
Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/wdialog", cmdtext, true)) return cmd_wdialog(playerid);
	return 0;
}

forward cmd_wdialog(playerid);
public cmd_wdialog(playerid)
{
	ShowPlayerAltDialog(playerid, 0, AD_STYLE_LIST, "Weapons", "AK47\nM4\nSniper Rifle", "Ok", "Cancel");
	return 1;
}

public OnAltDialogResponse(playerid, dialogid, response, listitem)
{
	if(dialogid == 0)
	{
		if(response == 1)
		{
			switch(listitem)
			{
				case 0: GivePlayerWeapon(playerid, 30, 100);
				case 1: GivePlayerWeapon(playerid, 31, 100);
				case 2: GivePlayerWeapon(playerid, 34, 50);
			}
			return 1;
		}
	}
	return 0;
}
Bugs:

Currently they were not found. If you found a bug, please let me know about it in this thread.

Changelog:
Code:
v1.5
- Minor bugfix

v2.0
- Added Scroll-Bar (visually)
- Changed the color of some dialog elements
- Fixed minor bugs

v2.5
- Minor optimization
- Added the ability to call items only by quick double click
- Fixed a bug with call ShowPlayerAltDialog in OnAltDialogResponse

v3.0
- Fixed hook OnPlayerClickPlayerTextDraw

v3.5
- Added compatibility with y_hooks

v4.0
- Added new skins for dialogs
- Now to select the dialog you need to quickly click on it twice by default
- Minor bug fixes

v4.5
- Added new skins for dialogs

v5.0
- Fixed return values in some callback functions

v5.5
- Memory usage optimization
- Minor fixes

v6.0
- Ability to place defines with the settings before the include
- Removed additional y_hooks support
- Minor improvements and fixes

v6.5
- Define "FAST_DOUBLE_CLICK" renamed to "AD_FAST_DOUBLE_CLICK"
- Define "MAX_CLICK_INTERVAL" renamed to "AD_MAX_CLICK_INTERVAL"
Thanks:

Zamaroht and adri1 for Zamaroht's Textdraw Editor

Frequently asked Questions:

Q: How to hide the dialog shown?
A: This can be done like in default dialogs.
Use ShowPlayerAltDialog function, specifying dialogid parameter with a value of -1

Q: What does the response parameter mean with the value of 2 in OnAltDialogResponse?
A: This means that the dialog was closed by pressing the "cross" button or by ESC

Q: How to make the separate words in the dialog colored?
A: In this case you can use that.

This section will be updated as questions are received.

Enjoy using!
Reply


Messages In This Thread
Alternative Dialogs - Dialogs with the new design - by OstGot - 05.01.2016, 11:53
Re: Alternative Dialogs - Dialogs with the new design - by Untonyst - 05.01.2016, 12:21
Re: Alternative Dialogs - Dialogs with the new design - by SoFahim - 05.01.2016, 14:57
Re: Alternative Dialogs - Dialogs with the new design - by Marcuse - 05.01.2016, 17:42
Re: Alternative Dialogs - Dialogs with the new design - by Crayder - 05.01.2016, 18:17
Respuesta: Alternative Dialogs - Dialogs with the new design - by Z0MBERTH - 05.01.2016, 18:24
Re: Alternative Dialogs - Dialogs with the new design - by Stanford - 06.01.2016, 03:23
Re: Alternative Dialogs - Dialogs with the new design - by Sellize - 06.01.2016, 11:08
Re: Alternative Dialogs - Dialogs with the new design - by SpikY_ - 06.01.2016, 13:09
Re: Alternative Dialogs - Dialogs with the new design - by Mr.R - 06.01.2016, 13:52
Re: Alternative Dialogs - Dialogs with the new design - by Crayder - 06.01.2016, 16:04
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 10.01.2016, 13:12
Re: Alternative Dialogs - Dialogs with the new design - by Crayder - 10.01.2016, 14:55
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 10.01.2016, 18:49
Re: Alternative Dialogs - Dialogs with the new design - by SpikY_ - 11.01.2016, 16:14
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 12.01.2016, 10:40
Re: Alternative Dialogs - Dialogs with the new design - by Crystallize - 16.01.2016, 12:46
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 16.01.2016, 19:10
Re: Alternative Dialogs - Dialogs with the new design - by Crystallize - 16.01.2016, 20:52
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 17.01.2016, 09:06
Re: Alternative Dialogs - Dialogs with the new design - by Crystallize - 17.01.2016, 09:36
Re: Alternative Dialogs - Dialogs with the new design - by HaRdiiZin - 17.01.2016, 14:26
Re: Alternative Dialogs - Dialogs with the new design - by wampiros6 - 17.01.2016, 16:08
Re: Alternative Dialogs - Dialogs with the new design - by Delete_ - 17.01.2016, 23:49
Re: Alternative Dialogs - Dialogs with the new design - by Crayder - 18.01.2016, 01:39
Re: Alternative Dialogs - Dialogs with the new design - by Delete_ - 21.01.2016, 14:47
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 21.01.2016, 16:32
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 26.03.2016, 08:22
Re: Alternative Dialogs - Dialogs with the new design - by HydraHumza - 26.03.2016, 12:11
Re: Alternative Dialogs - Dialogs with the new design - by Hellman92 - 26.03.2016, 12:54
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 04.06.2016, 10:47
Re: Alternative Dialogs - Dialogs with the new design - by Amunra - 04.06.2016, 11:04
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 14.06.2016, 17:00
Re: Alternative Dialogs - Dialogs with the new design - by zSuYaNw - 14.06.2016, 17:31
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 22.11.2016, 13:49
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 27.11.2016, 09:01
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 19.03.2017, 08:34
Re: Alternative Dialogs - Dialogs with the new design - by OstGot - 09.08.2017, 20:38
Re: Alternative Dialogs - Dialogs with the new design - by PT - 09.08.2017, 23:29
Re: Alternative Dialogs - Dialogs with the new design - by RogueDrifter - 16.12.2017, 23:06

Forum Jump:


Users browsing this thread: 3 Guest(s)