Beispiel #1
0
void _fastcall
CC_PutCondition(DWORD This, DWORD OutClass, char* name, DWORD index)
{
  char NewName[260];
  BLZSStrPrintf(NewName, 260, "%sFunc%03d", name, index+1);

  CC_PutConditionEx(This, OutClass, NewName);
}
Beispiel #2
0
void _fastcall
CC_PutVar_Code(DWORD This, DWORD OutClass, char* name, DWORD index, DWORD Type)
{
  char NewName[260];
  DWORD VarClass = GetGUIVar_Class(This, index);

  if (VarClass != 0)
  {
    BLZSStrPrintf(NewName, 260, "%s%03d", name, index+1);
    if (Type == CC_GUI_TYPE_CONDITION)
    {
      CC_PutConditionEx(VarClass, OutClass, NewName);
    }
    else
    {
      CC_PutActionEx_Hook(VarClass, 0, OutClass, NewName, CC_GUI_TYPE_ACTION, 0);
    }
  }
}
Beispiel #3
0
void _fastcall CC_PutExternFuncEx_TopDown(DWORD This, DWORD OutClass, char* name)
{
	char NewName[260];
	char buff[260];
	DWORD nVar, VarClass, Var, i;
	LONG flag = -1;

	nVar = *(DWORD*)(This+0x128);

	for (i = 0; i < nVar; i++)
	{
		Var = ((DWORD*)(*(DWORD*)((This)+0x12C)))[i];
		VarClass = GetGUIVar_Class(This, i);

		switch (GetGUIVar_Type(This, i))
		{
		case CC_VARTYPE_boolexpr:
		case CC_VARTYPE_boolcall:
			flag = 1;
			break;
		case CC_VARTYPE_code:
			flag = 2;
			break;
		case CC_VARTYPE_eventcall:
			flag = 0;
			break;
		default:
			flag = -1;
			break;
		}

		if ((2 == (*(DWORD*)(Var+0x08))) && (0 == BLZSStrCmp((char*)(Var+0x0C), "boolexpr", 0xFFFFFFFF)))
		{
			flag = 1;
		}
		else if (flag == -1 && VarClass == 0)
		{
			continue;
		}

		if (0 == BLZSStrCmp((char*)(VarClass+0x20), "Null", 0xFFFFFFFF))
			continue;

		BLZSStrPrintf(NewName, 260, "%s%03d", name, i+1);
		CC_PutExternFuncEx(VarClass, OutClass, NewName);

		if (*(DWORD*)(VarClass+0x138) == CC_GUIID_ReturnAction)
			continue;

		switch (*(DWORD*)(This+0x138))
		{   
		case CC_GUIID_IfThenElse:
		case CC_GUIID_GetBooleanAnd:
		case CC_GUIID_GetBooleanOr:
			flag = -1;
			break;
		}

		if (flag == 1)
		{
			BLZSStrPrintf(buff, 260, "function %s takes nothing returns boolean", NewName);
			PUT_CONST(buff, 1);

			CC_PutBegin();
			PUT_CONST("return (", 0); 
			CC_PutConditionEx(VarClass, OutClass, NewName);
			PUT_CONST(")", 1); 
			CC_PutEnd();

			PUT_CONST("endfunction", 1);
			PUT_CONST("", 1);
		}
		else if ((flag == 2) && (!((CC_GUIID_IfThenElse <= *(DWORD*)(This+0x138)) && (*(DWORD*)(This+0x138) <= CC_GUIID_ForLoopVarMultiple))))
		{
			BLZSStrPrintf(buff, 260, "function %s takes nothing returns nothing", NewName);
			PUT_CONST(buff, 1);

			CC_PutActionEx_Hook(VarClass, 0, OutClass, NewName, CC_GUI_TYPE_ACTION, 0);

			PUT_CONST("endfunction", 1);
			PUT_CONST("", 1);
		}
	}

	CC_PutExternFuncEx_Item(This, OutClass, name);

	switch (*(DWORD*)(This+0x138))
	{
	case CC_GUIID_ForGroupMultiple:
	case CC_GUIID_ForForceMultiple:
	case CC_GUIID_EnumDestructablesInRectAllMultiple:
	case CC_GUIID_EnumDestructablesInCircleBJMultiple:
	case CC_GUIID_EnumItemsInRectBJMultiple:
		{
			BLZSStrPrintf(buff, 260, "function %sA takes nothing returns nothing", name);
			PUT_CONST(buff, 1);

			CC_PutLocal_Begin(This, OutClass, FALSE, FALSE);

			CC_PutBlock_Action(This, OutClass, name, -1);

			CC_PutLocal_End(This, OutClass, FALSE, TRUE);

			PUT_CONST("endfunction", 1);
			PUT_CONST("", 1);
		}
		break;
	default:
		break;
	}
}