[Include] Dialogs include - Adding new styles to SAMP GUI

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Show your code.
Does any of your scripts uses OnPlayerClickTextDraw?

Update 2.0.3 (minor change):
  • Added return 1; in OnPlayerClickTextDraw callback to resist calling it on other scripts
  • Removed SVar code, now compatiable with SAMP 0.3 earlier versions (except the one which don't support preview models)
I think that is bad you should use all the recent things on the last version of sa-mp and not think on older versions, because they are outdated...
Reply

Quote:
Originally Posted by PT
Посмотреть сообщение
That is an sa-mp problem not this include problem
you can write Russian text in the description in the next version of the script or not? or is it not possible?
Reply

Quote:
Originally Posted by Minikole
Посмотреть сообщение
Hello friends. I am using the include Dialog.inc created by Gammix. I have a problem with pages of dialogs:

I'm using DIALOG_STYLE_PREVMODEL_LIST whose maximum space are 5. I use 311 items (the skin of sa-mp), but it does not appear to move to the next page.
Hi there.

I can help you out if you can show me your code related to the dialog. Also make sure you have DIALOG_MAX_LISTITEMS greater than 311 (or more) so you can have that much items.
Reply

Hi!, i have a problem with lettersize. Is there any solution? Because the letter size is very small and i cannot read well the text jejeje
Reply

Код:
	    for(new i = 0;i < MAX_EQUIPEMENT_POINT;i++)
	    {
			if(EQUIP_CASE[EquipID][i][EQUIPC_TYPE]==cType)
			{
				format(string, sizeof(string), "%s%d\n%s\n",string,EQUIP_CASE[EquipID][i][EQUIPC_MODEL],EQUIP_CASE[EquipID][i][EQUIPC_NAME]);
			}
	    }
	    ShowPlayerDialog(playerid, DIALOGID+383, DIALOG_STYLE_PREVMODEL_LIST, EquipType[cType],string,"Changer","Retour");
If i have juste one line, box is show but i can't see my line, however if i have more two line, it's ok
Reply

Quote:
Originally Posted by Minikole
Посмотреть сообщение
Hi!, i have a problem with lettersize. Is there any solution? Because the letter size is very small and i cannot read well the text jejeje
You can now edit your listitems via Dialog_SetListitem.

Read the How to use? > How to edit listitems?.

Quote:
Originally Posted by Eloctro
Посмотреть сообщение
Код:
	    for(new i = 0;i < MAX_EQUIPEMENT_POINT;i++)
	    {
			if(EQUIP_CASE[EquipID][i][EQUIPC_TYPE]==cType)
			{
				format(string, sizeof(string), "%s%d\n%s\n",string,EQUIP_CASE[EquipID][i][EQUIPC_MODEL],EQUIP_CASE[EquipID][i][EQUIPC_NAME]);
			}
	    }
	    ShowPlayerDialog(playerid, DIALOGID+383, DIALOG_STYLE_PREVMODEL_LIST, EquipType[cType],string,"Changer","Retour");
If i have juste one line, box is show but i can't see my line, however if i have more two line, it's ok
Thanks for reporting that bug, i haven't figured out what is causing that, but will be fixed early.

Update v2.1.0:
  • Ability to edit listitems per player (edit individual listitem)
    pawn Код:
    Dialog_SetListitem(playerid, listitem, string[] = "", model = -1, Float:x = -1000.0, Float:y = -1000.0, Float:z = -1000.0, Float:zoom = -1000.0, font = -1, Float:fontsize = 0.0);
  • Fixed run time error.
Reply

Can I use that with easyDialog by Emmet_?
Reply

Quote:
Originally Posted by Sioux
Посмотреть сообщение
Can I use that with easyDialog by Emmet_?
Yes, there should be no problem with it. (*add this library before including easydialog).
Reply

nice work
Reply

Compatible with y_dialogs?
Reply

Quote:
Originally Posted by PT
Посмотреть сообщение
Compatible with y_dialogs?
Should be because this include only adds new styles. It may cause error (in game*) if y_dialog have dialog style checks.

Just add this include before y_dialog or easydialog.
Reply

I have resolve bug, when we have juste one line.
In
Код:
static Dialog_ShowList(playerid, info[], page, selected)
You must replace:
Код:
        if ((t_iSplitItems % 2) > 0) {
        t_iSplitItems -= 1;
	}
by
Код:
	if (t_iSplitItems == 0) {
        t_iSplitItems -= 1;
	}
And i find a solution for resolution problem with certain player.

Put this in the top of include:
Код:
#define T_DIALOG_SIZE 2
#define T_DIALOG_DECAL 4.0
In
Код:
static Dialog_PTDCreate
Replace:
Код:
PlayerTextDrawLetterSize(playerid, var, lettersizeX, lettersizeY);
by
Код:
PlayerTextDrawLetterSize(playerid, var, lettersizeX*T_DIALOG_SIZE, lettersizeY*T_DIALOG_SIZE);
And in:
Код:
static Dialog_ShowHUDS
Replace:
Код:
stock static Dialog_ShowHUDS(playerid, title[], button1[], button2[]) {
	Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogTitle], playerid, 173.000000, 121.000000, title, 50, 1, 0.129998, 0.799998, -36, 0, 0, 1, 1, 0);
	PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogTitle]);

	if (button2[0]) {
		Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonLeft], playerid, 278.000000, 311.000000, button1, 50, 1, 0.129998, 0.799998, -36, 2, 0, 1, 1, 0);
		PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonLeft]);

		Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonRight], playerid, 348.000000, 311.000000, button2, 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0);
		PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonRight]);

		g_PlayerDialogInfo[playerid][e_pDialogDualButtons] = true;
	}
	else {
		Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonCenter], playerid, 317.000000, 311.000000, button1, 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0);
		PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonCenter]);

		g_PlayerDialogInfo[playerid][e_pDialogDualButtons] = false;
	}
}
by:
Код:
stock static Dialog_ShowHUDS(playerid, title[], button1[], button2[]) {
	Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogTitle], playerid, 173.000000, 121.000000-T_DIALOG_DECAL, title, 50, 1, 0.129998, 0.799998, -36, 0, 0, 1, 1, 0);
	PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogTitle]);

	if (button2[0]) {
		Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonLeft], playerid, 278.000000, 311.000000-T_DIALOG_DECAL, button1, 50, 1, 0.129998, 0.799998, -36, 2, 0, 1, 1, 0);
		PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonLeft]);

		Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonRight], playerid, 348.000000, 311.000000-T_DIALOG_DECAL, button2, 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0);
		PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonRight]);

		g_PlayerDialogInfo[playerid][e_pDialogDualButtons] = true;
	}
	else {
		Dialog_PTDCreate(g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonCenter], playerid, 317.000000, 311.000000-T_DIALOG_DECAL, button1, 50, 1, 0.140000, 0.899999, -36, 2, 0, 1, 1, 0);
		PlayerTextDrawShow(playerid, g_PlayerDialogHUDS[playerid][e_txtPlayerDialogButtonCenter]);

		g_PlayerDialogInfo[playerid][e_pDialogDualButtons] = false;
	}
}
So if you want keep orginal dimension you have juste to set define, like that:
Код:
#define T_DIALOG_SIZE 1
#define T_DIALOG_DECAL 0.0
Reply

Wow, very nice!
Reply

Nice job.
as change the color of the box?
transparent color.
Reply

Quote:
Originally Posted by vegaltasendai
Посмотреть сообщение
Nice job.
as change the color of the box?
transparent color.
It's built to look like SA-MP's dialogs. I believe it should remain this way. If you want it changed do it in the code (easy thing to do, just modify the textdraw colors).
Reply

I think this i have a problem with #pragma dynamic.

Any ideas?
Edit:
When i delete this line
Код:
#pragma dynamic (DIALOG_MAX_LISTITEMS * DIALOG_MAX_LISTITEM_SIZE * 4)
I recive an unknown command in game eror. I see the dialog but the listitems are not shown. I use a "print" debug method and this line not execute:
Код:
new t_sSplit[DIALOG_MAX_LISTITEMS][DIALOG_MAX_LISTITEM_SIZE];
Reply

Quote:
Originally Posted by ExTaZZ69
Посмотреть сообщение
I think this i have a problem with #pragma dynamic.

Any ideas?
Edit:
When i delete this line
Код:
#pragma dynamic (DIALOG_MAX_LISTITEMS * DIALOG_MAX_LISTITEM_SIZE * 4)
I recive an unknown command in game eror. I see the dialog but the listitems are not shown. I use a "print" debug method and this line not execute:
Код:
new t_sSplit[DIALOG_MAX_LISTITEMS][DIALOG_MAX_LISTITEM_SIZE];
That issue will be fixed in the upcoming new update with a resolution fix from Electro as well.But it might take time since i am busy in updating lot of my libraries.
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
That issue will be fixed in the upcoming new update with a resolution fix from Electro as well.But it might take time since i am busy in updating lot of my libraries.
When the update?
Reply

Try commenting #pragma dynamic line and replacing
stock static (line 100) with new
Reply

Quote:
Originally Posted by Kolstin
Посмотреть сообщение
When the update?
As soon as possible.

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Try commenting #pragma dynamic line and replacing
stock static (line 100) with new
That would cause trouble when storing the dialog info, resulting in less number of listitems than expected when using the new styles.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)