Example #1
0
void NodeTerminal::onKeyPressed(int inputed)
{
	switch (inputed)
	{
	case CANCEL:
		LG::Core::open(MainPopUpMenu(*this));
		break;

	case LG::RENAME:
		if( ! focused) {
			NENode& chosen = castObject();			
			NEScriptEditor& se = Editor::getInstance().getScriptEditor();
			NECode new_one(se.getScriptHeader().getMaxCode(NECodeType::NAME));

			if (chosen.getNameCode() <= 0) {
				se.insertCode(++new_one);
				chosen.setCodes(new_one);
			}

			NETString& bank = se.getBanks().getBank(NECodeType::NAME)[chosen.getNameCode()];
			if (!&bank) {
				::Core::pushMessage("이 노드에 해당하는 NameBank를 찾을 수 없습니다.");
				return;
			}

			call(HeaderModifier::StringInputWindow(bank));
		}
		else if(focused == 2)
			ms_terminal.onKeyPressed(inputed);
		break;

	case CLOSE:
		delete_me = true;
		break;

	case LEFT:
		if( ! focused && enable.Gliph::back == CYAN	&& enable.getValue())
			return enable.onKeyPressed(inputed);
		if(focused == 0 && attributes.choosed == 1)
		{
			LG::Core::play(LG::Core::SND_TICK);
			if(codelist_display_index > -2)
				codelist_display_index--;
		}
		else if (focused > 0)
		{
			LG::Core::play(LG::Core::SND_TRANSITE);
			focused--;
		}

		break;

	case RIGHT:
		if( ! focused && enable.Gliph::back == CYAN && ! enable.getValue())
			return enable.onKeyPressed(inputed);
		if(focused == 0 && attributes.choosed == 1)
		{
			LG::Core::play(LG::Core::SND_TICK);
			if(codelist_display_index < castObject().getGroupCodes().getLengthLastIndex())
				codelist_display_index++;
		}
		else if (focused < 2)
		{
			LG::Core::play(LG::Core::SND_TRANSITE);
			focused++;
		}
		break;

	default:
		switch(focused)
		{
		case 0:
			switch(inputed)
			{
			case UP:
				if(attributes.choosed <= 0)
				{
					enable.Gliph::back = CYAN;
					enable.fore = LIGHTCYAN;
					attributes.choosed = -1;
				}
				break;
				
			case DOWN:
				if(attributes.choosed < 0)
				{
					enable.Gliph::back = DARKGRAY;
					enable.fore = LIGHTGRAY;
				}
				break;
			}

			if(enable.Gliph::back == CYAN)
				enable.onKeyPressed(inputed);
			else
				attributes.onKeyPressed(inputed);
			break;

		case 1:
			ks_terminal.onKeyPressed(inputed);
			break;

		case 2:
			ms_terminal.onKeyPressed(inputed);
			break;
		}
		break;
	}
}
Example #2
0
gkGameObject* gkPhysicsController::castObject(const btCollisionObject* colObj)
{
	return castObject(const_cast<btCollisionObject*>(colObj));
}