Exemplo n.º 1
0
void CzMarket::setCurrentProductID(const char* product_id)
{
	// If resource system iniitialised then update system variable with new id
	if (CZ_GLOBAL_RESOURCES != NULL)
	{
		CzXomlVariableArrayInt* system = (CzXomlVariableArrayInt*)CZ_GLOBAL_RESOURCES->getVariableManager()->findVariable("system");
		if (system != NULL)
			system->setValue(CzApp::SYS_LAST_PURCHASE_ID, product_id);
	}
	
	CurrentProductID = product_id;
}
Exemplo n.º 2
0
void CzApp::NotifyOrientationChanged()
{
	CzXomlVariableArrayInt* arr = (CzXomlVariableArrayInt*)CZ_GLOBAL_RESOURCES->getVariableManager()->findVariable("system");
	arr->getElement(SYS_SCREEN_ORIENTATION)->setValue(CzString(ScreenOrientation).c_str());

	IzPlatformDisplay* display = PLATFORM_DISPLAY;
	CzUIBase::UpdatePresetAnimations();
	ScreenSize.x = display->getCurrentWidth();
	ScreenSize.y = display->getCurrentHeight();

	for (_Iterator it = begin(); it != end(); it++)
	{
		if (!(*it)->isDestroyed())
		{
			(*it)->NotifyOrientationChanged();
		}
	}
}
Exemplo n.º 3
0
void CzApp::UpdateSystemTouches()
{
	CzXomlVariableArrayInt* arr = (CzXomlVariableArrayInt*)CZ_GLOBAL_RESOURCES->getVariableManager()->findVariable("touches");

	// Update system array
	int count = 1;
	if (CZ_INPUT->isMultiTouch())
		count = 5;
	CzString num;
	num.setAutoHash(false);
	int index = 0;
	for (int t = 0; t < 5; t++)
	{
		CzXomlVariableInt* var = (CzXomlVariableInt*)arr->getElement(index++);
		CzTouch* touch = CZ_INPUT->getTouch(t);
		if (touch->x != var->NativeValue)
		{
			var->NativeValue = touch->x;
			num = var->NativeValue;
			var->setValueText(num.c_str());
		}
		var = (CzXomlVariableInt*)arr->getElement(index++);
		if (touch->y != var->NativeValue)
		{
			var->NativeValue = touch->y;
			num = var->NativeValue;
			var->setValueText(num.c_str());
		}
		var = (CzXomlVariableInt*)arr->getElement(index++);
		if ((int)touch->touched != var->NativeValue)
		{
			var->NativeValue = (int)touch->touched;
			num = var->NativeValue;
			var->setValueText(num.c_str());
		}
	}
}
Exemplo n.º 4
0
void CzApp::CreateSystemArray()
{
	IzPlatformDisplay* display = PLATFORM_DISPLAY;

	// Create the system variable array
	int width = display->getCurrentWidth();
	int height = display->getCurrentHeight();
	CzXomlVariableArrayInt* system = new CzXomlVariableArrayInt();
	system->Init(SYS_MAX);
	system->Name = "system";
	system->setValue(SYS_SCREEN_WIDTH, CzString(width).c_str());
	system->setValue(SYS_SCREEN_HEIGHT, CzString(height).c_str());
	system->setValue(SYS_SCREEN_SIZE_HINT, CzString((width + height) / 400).c_str());
	system->setValue(SYS_SCREEN_MODE, CzString(CzUtils::GetGraphicModeIndex(width, height)).c_str());
	system->setValue(SYS_DEVICE_TYPE, CzString((int)PLATFORM_SYS->getDeviceType()).c_str());
	if (CZ_INPUT->isMultiTouch())
		system->setValue(SYS_HAS_MULTITOUCH, "1");
	else
		system->setValue(SYS_HAS_MULTITOUCH, "0");
	if (CZ_INPUT->isAccelerometerAvailable())
		system->setValue(SYS_HAS_ACCELEROMETER, "1");
	else
		system->setValue(SYS_HAS_ACCELEROMETER, "0");
	if (CZ_INPUT->isCompassAvailable())
		system->setValue(SYS_HAS_COMPASS, "1");
	else
		system->setValue(SYS_HAS_COMPASS, "0");
	if (CZ_INPUT->isKeysAvailable())
		system->setValue(SYS_HAS_KEYS, "1");
	else
		system->setValue(SYS_HAS_KEYS, "0");
	if (CZ_INPUT->isPointerAvailable())
		system->setValue(SYS_HAS_POINTER, "1");
	else
		system->setValue(SYS_HAS_POINTER, "0");
	system->setValue(SYS_LAST_PURCHASE_ID, "");
	system->setValue(SYS_SCREEN_ORIENTATION, CzString(PLATFORM_DISPLAY->getOrientation()).c_str());
	CZ_GLOBAL_RESOURCES->getVariableManager()->addVariable(system);

	// Create the touch input system array
	CzXomlVariableArrayInt* touches = new CzXomlVariableArrayInt();
	touches->Init(TOUCH_MAX);
	touches->Name = "touches";
	for (int t = 0; t < TOUCH_MAX; t++)
		touches->setValue(t, "0");
	CZ_GLOBAL_RESOURCES->getVariableManager()->addVariable(touches);

}