Exemple #1
0
void Kodi::update()
{
    QVariantMap params;
    QVariantList properties;
    properties.append("volume");
    properties.append("muted");
    properties.append("name");
    properties.append("version");
    params.insert("properties", properties);

    m_jsonHandler->sendData("Application.GetProperties", params, ActionId());
}
Exemple #2
0
// Scriptbinds
void CScriptbind_Input::RegisterAction(mono::string actionName)
{
	if(!s_actionHandler.GetHandler(ActionId(ToCryString(actionName))))
		s_actionHandler.AddHandler(ActionId(ToCryString(actionName)), &CScriptbind_Input::OnActionTriggered);
}
bool CControllerInputRenderInfo::CreateForInput(const char * mapName, const char * inputName)
{
	CRY_ASSERT(gEnv);
	CRY_ASSERT(gEnv->pGame);
	CRY_ASSERT(gEnv->pGame->GetIGameFramework());
	CRY_ASSERT(gEnv->pGame->GetIGameFramework()->GetIActionMapManager());

	IActionMap* pActionMap = gEnv->pGame->GetIGameFramework()->GetIActionMapManager()->GetActionMap(mapName);
	if (pActionMap)
	{
		const IActionMapAction* pAction = pActionMap->GetAction(ActionId(inputName));
		if (!pAction)
			return false;

		int iNumActionInputs = pAction->GetNumActionInputs();
		for (int i = 0; i < iNumActionInputs; i++)
		{
			const SActionInput* pActionInput = pAction->GetActionInput(i);
			CRY_ASSERT(pActionInput != NULL);

			// TODO: Make data driven!

#if CRY_PLATFORM_ORBIS
			if (0 == strcmp(pActionInput->input, "pad_square"))
			{
				return SetIcon("controller_face_left");
			}
			else if (0 == strcmp(pActionInput->input, "pad_cross"))
			{
				return SetIcon("controller_face_down");
			}
			else if (0 == strcmp(pActionInput->input, "pad_circle"))
			{
				return SetIcon("controller_face_right");
			}
			else if (0 == strcmp(pActionInput->input, "pad_triangle"))
			{
				return SetIcon("controller_face_up");
			}
			else if (0 == strcmp(pActionInput->input, "pad_r2"))
			{
				return SetText("@ui_inputName_rightTrigger");	// TODO: An icon would be better...
			}
			else if (0 == strcmp(pActionInput->input, "pad_l2"))
			{
				return SetText("@ui_inputName_leftTrigger");	// TODO: An icon would be better...
			}
			else if (0 == strcmp(pActionInput->input, "pad_r3"))
			{
				return SetText("@ui_inputName_clickRightStick");	// TODO: An icon would be better...
			}
			else if (0 == strcmp(pActionInput->input, "pad_l3"))
			{
				return SetText("@ui_inputName_clickLeftStick");	// TODO: An icon would be better...
			}
#else
			if (0 == strcmp(pActionInput->input, "xi_x"))
			{
				return SetIcon("controller_face_left");
			}
			else if (0 == strcmp(pActionInput->input, "xi_a"))
			{
				return SetIcon("controller_face_down");
			}
			else if (0 == strcmp(pActionInput->input, "xi_b"))
			{
				return SetIcon("controller_face_right");
			}
			else if (0 == strcmp(pActionInput->input, "xi_y"))
			{
				return SetIcon("controller_face_up");
			}
			else if (0 == strcmp(pActionInput->input, "xi_triggerr_btn"))
			{
				return SetText("@ui_inputName_rightTrigger");	// TODO: An icon would be better...
			}
			else if (0 == strcmp(pActionInput->input, "xi_triggerl_btn"))
			{
				return SetText("@ui_inputName_leftTrigger");	// TODO: An icon would be better...
			}
			else if (0 == strcmp(pActionInput->input, "xi_thumbr"))
			{
				return SetText("@ui_inputName_clickRightStick");	// TODO: An icon would be better...
			}
			else if (0 == strcmp(pActionInput->input, "xi_thumbl"))
			{
				return SetText("@ui_inputName_clickLeftStick");	// TODO: An icon would be better...
			}
#endif
		}
	}

#if WATCH_CONTROLLER_INPUT_ICON_FAILURES || ASSERT_ON_CONTROLLER_INPUT_ICON_FAILURES
	string error;

	if (pActionMap)
	{
		const IActionMapAction* pAction = pActionMap->GetAction(ActionId(inputName));
		if (pAction)
		{
			int iNumActionInputs = pAction->GetNumActionInputs();
			if (iNumActionInputs > 0)
			{			
				error.Format("%d input(s) =", iNumActionInputs);
			}
			else
			{
				error = "no such input";
			}

			for (int i = 0; i < iNumActionInputs; i++)
			{
				const SActionInput* pActionInput = pAction->GetActionInput(i);
				CRY_ASSERT(pActionInput != NULL);

				error = string(error + " '" + pActionInput->input.c_str() + "'");
			}
		}
		else
		{
			error.Format("\"%s\" action not found", mapName);
		}
	}
	else
	{
		error.Format("\"%s\" action map not found", mapName);
	}

#if WATCH_CONTROLLER_INPUT_ICON_FAILURES
	CryWatch("No HUD prompt icon/text for \"%s.%s\": %s", mapName, inputName, error.c_str());
#endif

#if ASSERT_ON_CONTROLLER_INPUT_ICON_FAILURES
	CRY_ASSERT_MESSAGE(false, string().Format("No HUD prompt icon/text for \"%s.%s\": %s", mapName, inputName, error.c_str()));
#endif

#endif

	return false;
}
Exemple #4
0
void Kodi::checkVersion()
{
    m_jsonHandler->sendData("JSONRPC.Version", QVariantMap(), ActionId());
}