void script_4851(int arg0,int arg1,int arg2,int arg3,int arg4,int arg5) {
	int ivar6;
	int ivar7;
	int ivar8;
	int ivar9;
	int ivar10;
	int ivar11;
	int ivar12;
	int ivar13;
	int ivar14;
	int ivar15;
	setWidgetIsHidden(true, new WidgetPointer(1092,938));
	deleteAllExtraChilds(new WidgetPointer(arg2));
	deleteAllExtraChilds(new WidgetPointer(arg3));
	deleteAllExtraChilds(new WidgetPointer(arg4));
	ivar6 = 0;
	ivar7 = 0;
	ivar8 = 1;
	ivar9 = 0;
	ivar10 = 28;
	ivar11 = -1;
	ivar12 = -1;
	ivar13 = -1;
	ivar14 = 0;
	ivar15 = 0;
	switch (bitconfig_9558) {
		case 1:
			ivar14 = bitconfig_9562;
			ivar15 = bitconfig_9566;
			break;
		case 2:
			ivar14 = bitconfig_9571;
			ivar15 = bitconfig_9575;
			break;
		case 3:
			ivar14 = bitconfig_9580;
			ivar15 = bitconfig_9584;
	}
	createExtraChild(new WidgetPointer(arg4), 3, 0);
	setWidgetHidden(1);
	createExtraChild(new WidgetPointer(arg2), 4, 0);
	setWidgetHidden(1);
	createExtraChild(new WidgetPointer(arg3), 5, 0);
	setWidgetHidden(1);
	if (((boolean)ivar15)) {
		ivar11 = script_4819(bitconfig_9558);
		ivar12 = script_4822(bitconfig_9558);
		ivar13 = script_4825(bitconfig_9558);
		if (((ivar11 == -1) || (ivar12 == -1)) || (ivar13 == -1)) {
			return;
		}
		ivar6 = min(min(getCommonDefinitionSize(ivar11), getCommonDefinitionSize(ivar13)), getCommonDefinitionSize(ivar12));
		while (ivar8 <= ivar6) {
			ivar7 = cs2method_3408(105, 105, ivar11, ivar8);
			createExtraChild(new WidgetPointer(arg4), 3, ivar8);
			setWidgetSize(0, ivar10, 1, 0);
			setWidgetFilled(1);
			if (((boolean)mod(ivar8, 2))) {
				setWidgetRGB(new Color(32, 31, 26));
				setScriptCallOnMouseExit(1356, new WidgetPointer(-32768,3), -2147483643, 2105114, "Iii");
			} else {
				setWidgetRGB(new Color(26, 23, 18));
				setScriptCallOnMouseExit(1356, new WidgetPointer(-32768,3), -2147483643, 1709842, "Iii");
			}
			setWidgetPosition(0, ivar9, 0, 0);
			if (((boolean)script_4828(bitconfig_9558))) {
				setScriptCallOnClickContextMenu(4803, ivar8, "i");
				setWidgetContextMenuOption(1, "Select");
				setScriptCallOnMouseEntered(1356, new WidgetPointer(-32768,3), -2147483643, 4537648, "Iii");
			}
			if (ivar14 == ivar7) {
				setWidgetIsHidden(false, new WidgetPointer(1092,938));
				setWidgetPosition(0, ivar9, 0, 0, new WidgetPointer(1092,938));
			}
			createExtraChild(new WidgetPointer(arg2), 4, ivar8);
			setWidgetSize(30, ivar10, 1, 0);
			setWidgetPosition(30, ivar9, 0, 0);
			setWidgetText(cs2method_3408(105, 115, ivar12, ivar7));
			setWidgetRGB(new Color(229, 225, 187));
			setWidgetFont(494);
			setWidgetTextAlignment(0, 1, 0);
			createExtraChild(new WidgetPointer(arg3), 5, ivar8);
			setWidgetSize(22, 22, 0, 0);
			setWidgetPosition(5, add(4, ivar9), 0, 0);
			setWidgetSprite(cs2method_3408(105, 100, ivar13, ivar7));
			ivar9 = multiply(ivar10, ivar8);
			ivar8 = add(ivar8, 1);
		}
	} else {
		createExtraChild(new WidgetPointer(arg4), 3, ivar8);
		setWidgetSize(0, ivar10, 1, 0);
		setWidgetFilled(1);
		if (((boolean)mod(ivar8, 2))) {
			setWidgetRGB(new Color(32, 31, 26));
			setScriptCallOnMouseExit(1356, new WidgetPointer(-32768,3), -2147483643, 2105114, "Iii");
		} else {
			setWidgetRGB(new Color(26, 23, 18));
			setScriptCallOnMouseExit(1356, new WidgetPointer(-32768,3), -2147483643, 1709842, "Iii");
		}
		setWidgetPosition(0, ivar9, 0, 0);
		setScriptCallOnClickContextMenu(4803, ivar8, "i");
		setWidgetContextMenuOption(1, "Select");
		setScriptCallOnMouseEntered(1356, new WidgetPointer(-32768,3), -2147483643, 4537648, "Iii");
		setWidgetIsHidden(false, new WidgetPointer(1092,938));
		setWidgetPosition(0, ivar9, 0, 0, new WidgetPointer(1092,938));
		createExtraChild(new WidgetPointer(arg2), 4, ivar8);
		setWidgetSize(30, ivar10, 1, 0);
		setWidgetPosition(30, ivar9, 0, 0);
		setWidgetText("Reset hotspot");
		setWidgetRGB(new Color(229, 225, 187));
		setWidgetFont(494);
		setWidgetTextAlignment(0, 1, 0);
		createExtraChild(new WidgetPointer(arg3), 5, ivar8);
		setWidgetSize(22, 22, 0, 0);
		setWidgetPosition(5, add(4, ivar9), 0, 0);
		setWidgetSprite(6496);
		cs2method1106(49149);
		ivar9 = multiply(ivar10, ivar8);
	}
	cs2method2100(0, 0, new WidgetPointer(arg0));
	setWidgetScrollMax(0, ivar9, new WidgetPointer(arg0));
	script_31(arg1, arg0, 5666, 5663, 5664, 5665, 5686, 5685);
	return;
}
