Esempio n. 1
0
	login::login()
	{
		app.getimgcache()->setmode(ict_login);
		nl::nx::view_file("UI");

		node title = nl::nx::nodes["UI"].resolve("Login.img/Title/");
		node common = nl::nx::nodes["UI"].resolve("Login.img/Common/");

		sprites.push_back(sprite(animation(title.resolve("11")), vector2d(410, 300)));
		sprites.push_back(sprite(animation(title.resolve("35")), vector2d(410, 260)));
		sprites.push_back(sprite(animation(title.resolve("Logo")), vector2d(410, 130)));
		sprites.push_back(sprite(animation(title.resolve("signboard")), vector2d(410, 300)));
		sprites.push_back(sprite(animation(common.resolve("frame")), vector2d(400, 290)));

		buttons[BT_LOGIN] = button(title.resolve("BtLogin"), 475, 248);
		buttons[BT_NEW] = button(title.resolve("BtNew"), 309, 320);
		buttons[BT_HOMEPAGE] = button(title.resolve("BtHomePage"), 382, 320);
		buttons[BT_PWDLOST] = button(title.resolve("BtPasswdLost"), 470, 300);
		buttons[BT_QUIT] = button(title.resolve("BtQuit"), 455, 320);
		buttons[BT_LOGINLOST] = button(title.resolve("BtLoginIDLost"), 395, 300);
		buttons[BT_SAVEID] = button(title.resolve("BtLoginIDSave"), 325, 300);

		bool saveid = config.accsaved();
		saveidcheck = sprite(animation(title.resolve("check")), vector2d(313, 304));

		string defaultacc;
		if (saveid)
			defaultacc = config.getdefaultacc();
		else
			defaultacc = "";

		textfields[TXT_ACC] = textfield(app.getfonts()->getfont(DWF_LEFT), txc_white, defaultacc, vector2d(315, 249), 12);
		textfields[TXT_ACC].setbg(texture(title.resolve("ID")), -5, 0);

		textfields[TXT_PASS] = textfield(app.getfonts()->getfont(DWF_LEFT), txc_white, "", vector2d(315, 275), 12);
		textfields[TXT_PASS].setbg(texture(title.resolve("PW")), -5, 0);

		if (!saveid)
		{
			textfields[TXT_ACC].setstate("active");
			app.getui()->settextfield(&textfields[0]);
		}
		else
		{
			textfields[TXT_PASS].setstate("active");
			app.getui()->settextfield(&textfields[1]);
		}

		nl::nx::unview_file("UI");
		app.getimgcache()->unlock();
		position = vector2d(0, 0);
		dimensions = vector2d(800, 600);
		active = true;
		visible = true;
	}
Esempio n. 2
0
	login::login()
	{
		app.getimgcache()->setmode(ict_login);

		node title = nl::nx::nodes["UI"]["Login.img"]["Title"];
		node common = nl::nx::nodes["UI"]["Login.img"]["Common"];

		sprites.push_back(sprite(animation(title["11"]), vector2d(410, 300)));
		sprites.push_back(sprite(animation(title["35"]), vector2d(410, 260)));
		sprites.push_back(sprite(animation(title["Logo"]), vector2d(410, 130)));
		sprites.push_back(sprite(animation(title["signboard"]), vector2d(410, 300)));
		sprites.push_back(sprite(animation(common["frame"]), vector2d(400, 290)));

		buttons[BT_LOGIN] = button(title["BtLogin"], 475, 248);
		buttons[BT_NEW] = button(title["BtNew"], 309, 320);
		buttons[BT_HOMEPAGE] = button(title["BtHomePage"], 382, 320);
		buttons[BT_PWDLOST] = button(title["BtPasswdLost"], 470, 300);
		buttons[BT_QUIT] = button(title["BtQuit"], 455, 320);
		buttons[BT_LOGINLOST] = button(title["BtLoginIDLost"], 395, 300);
		buttons[BT_SAVEID] = button(title["BtLoginIDSave"], 325, 300);

		string defaultacc = config.getdefaultacc();
		saveid = config.getsaveid();

		saveidcheck[false] = texture(title["check"]["0"]);
		saveidcheck[true] = texture(title["check"]["1"]);

		textfields[TXT_ACC] = textfield(TXT_ACC, DWF_14L, TXC_WHITE, defaultacc, vector2d(315, 249), 12);
		textfields[TXT_ACC].setbg(texture(title["ID"]), -5, 0);

		textfields[TXT_PASS] = textfield(TXT_PASS, DWF_14L, TXC_WHITE, "", vector2d(315, 275), 12);
		textfields[TXT_PASS].setbg(texture(title["PW"]), -5, 0);

		if (saveid)
		{
			textfields[TXT_PASS].setfocus(true);
			app.getui()->settextfield(&textfields[TXT_PASS]);
		}
		else
		{
			textfields[TXT_ACC].setfocus(true);
			app.getui()->settextfield(&textfields[TXT_ACC]);
		}

		app.getimgcache()->unlock();
		position = vector2d(0, 0);
		dimensions = vector2d(800, 600);
		active = true;
		dragged = false;
		buttoncd = 0;
	}
Esempio n. 3
0
	chatbar::chatbar()
	{
		app.getimgcache()->setmode(ict_sys);

		node mainbar = nx::nodes["UI"]["StatusBar2.img"]["mainBar"];
		node chat = nx::nodes["UI"]["StatusBar2.img"]["chat"];

		open = config.getconfig()->chatopen;

		buttons[BT_BAR_OPENCHAT] = button(mainbar["chatOpen"]);
		buttons[BT_BAR_CLOSECHAT] = button(mainbar["chatClose"]);
		buttons[BT_BAR_SCROLLUP] = button(mainbar["scrollUp"]);
		buttons[BT_BAR_SCROLLDOWN] = button(mainbar["scrollDown"]);
		buttons[BT_BAR_CHATTARGET] = button(mainbar["chatTarget"]["base"]);
		buttons[BT_BAR_CHATTARGET].setactive(open);

		buttons[open ? BT_BAR_OPENCHAT : BT_BAR_CLOSECHAT].setactive(false);

		chatspace[false] = texture(mainbar["chatSpace"]);
		chatspace[true] = texture(mainbar["chatEnter"]);
		chatenter = texture(mainbar["chatSpace2"]);
		chatcover = texture(mainbar["chatCover"]);

		chattargets[CHT_ALL] = texture(mainbar["chatTarget"]["all"]);
		chattargets[CHT_BUDDY] = texture(mainbar["chatTarget"]["friend"]);
		chattargets[CHT_GUILD] = texture(mainbar["chatTarget"]["guild"]);
		chattargets[CHT_ALLIANCE] = texture(mainbar["chatTarget"]["association"]);
		chattargets[CHT_PARTY] = texture(mainbar["chatTarget"]["party"]);
		chattargets[CHT_SQUAD] = texture(mainbar["chatTarget"]["expedition"]);

		textfields[TXT_CHAT] = textfield(TXT_CHAT, DWF_12L, TXC_BLACK, "", vector2d(-430, -60), 64);
		textfields[TXT_CHAT].setactive(open);

		closedtext = textlabel(DWF_12L, TXC_WHITE, "");

		app.getimgcache()->unlock();

		position = vector2d(512, 590);
		dimensions = vector2d(500, 80);
		active = true;
		dragged = false;
		buttoncd = 0;
		chattarget = CHT_ALL;
	}