SA-MP Forums Archive
[Include] Alternative Dialogs - Dialogs with the new design - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Alternative Dialogs - Dialogs with the new design (/showthread.php?tid=597813)

Pages: 1 2


Alternative Dialogs - Dialogs with the new design - OstGot - 05.01.2016

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:
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!


Re: Alternative Dialogs - Dialogs with the new design - Untonyst - 05.01.2016

Nice job


Re: Alternative Dialogs - Dialogs with the new design - SoFahim - 05.01.2016

I will check it, Hope it will be nice


Re: Alternative Dialogs - Dialogs with the new design - Marcuse - 05.01.2016

Looks freakin' awesome!
Gonna test it later


Re: Alternative Dialogs - Dialogs with the new design - Crayder - 05.01.2016

It could be a bit less "stretched". Also, instead of using pre-defined constant values (mainly the colors) for the user customization, it'd be better if these values could be changed by the function itself.

Otherwise, sweet.


Respuesta: Alternative Dialogs - Dialogs with the new design - Z0MBERTH - 05.01.2016

Good Job, nice


Re: Alternative Dialogs - Dialogs with the new design - Stanford - 06.01.2016

The idea is awesome, you need to work on the design! Thanks Osgot for everything you do to boost up the community! (REP+ BOOST!)


Re: Alternative Dialogs - Dialogs with the new design - Sellize - 06.01.2016

That's a little ugly, I don't know why anyone would use it over the default dialogs but nice effort nonetheless.


Re: Alternative Dialogs - Dialogs with the new design - SpikY_ - 06.01.2016

The Method of using this Include is perfect but The dialog looks ugly as other people are also complementing at it. So hope that you will improve it. Thanks!


Re: Alternative Dialogs - Dialogs with the new design - Mr.R - 06.01.2016

Yeah looks good! And styles? MSG BOX or INPUTTEXT? Any photos?


Re: Alternative Dialogs - Dialogs with the new design - Crayder - 06.01.2016

Quote:
Originally Posted by Mr.R
Посмотреть сообщение
Yeah looks good! And styles? MSG BOX or INPUTTEXT? Any photos?
An input box is impossible without all-key detection.


Re: Alternative Dialogs - Dialogs with the new design - OstGot - 10.01.2016

Updated (v1.5)


Re: Alternative Dialogs - Dialogs with the new design - Crayder - 10.01.2016

What's new in 1.5? I don't see anything new. Add a changelog... xD


Re: Alternative Dialogs - Dialogs with the new design - OstGot - 10.01.2016

Quote:
Originally Posted by Crayder
Посмотреть сообщение
What's new in 1.5? I don't see anything new. Add a changelog... xD
See first post


Re: Alternative Dialogs - Dialogs with the new design - SpikY_ - 11.01.2016

Yeah, you mentioned "minor bug fixed" but can you tell us which minor bug you have fixed?


Re: Alternative Dialogs - Dialogs with the new design - OstGot - 12.01.2016

Quote:
Originally Posted by SpikY_
Посмотреть сообщение
Yeah, you mentioned "minor bug fixed" but can you tell us which minor bug you have fixed?
SpikY_, especially for you

Changelog (detailed) v1.5:
Код:
* Fixed a bug with the selectable of empty items
* Fixed a bug that caused a server crash if you enter a number of items greater than the defined max value



Re: Alternative Dialogs - Dialogs with the new design - Crystallize - 16.01.2016

Код:
error 025: function heading differs from prototype
Whenever I add OnAltDialogReponse i get this error.


Re: Alternative Dialogs - Dialogs with the new design - OstGot - 16.01.2016

Quote:
Originally Posted by Wizzard2H
Посмотреть сообщение
Код:
error 025: function heading differs from prototype
Whenever I add OnAltDialogReponse i get this error.
Maybe you added this public with argument "inputtext[]"? Try without


Re: Alternative Dialogs - Dialogs with the new design - Crystallize - 16.01.2016

Quote:
Originally Posted by OstGot
Посмотреть сообщение
Maybe you added this public with argument "inputtext[]"? Try without
Yes but then my login system wont work and wont even compile if i remove inputttext? Any idea what I could do?


Re: Alternative Dialogs - Dialogs with the new design - OstGot - 17.01.2016

Quote:
Originally Posted by Wizzard2H
Посмотреть сообщение
Yes but then my login system wont work and wont even compile if i remove inputttext? Any idea what I could do?
I'm sure that your login system work on default dialogs.
In this case you don't have to change anything in OnDialogResponse.

You just have to add a new public OnAltDialogResponse in your gamemode as below:
Код:
public OnAltDialogResponse(playerid, dialogid, response, listitem) //<- Without inputtext[]
{
	//Your code
	return 0;
}