private void SetLevelSettings() { if (currentLevelSettings == null) { return; } if (!string.IsNullOrEmpty(currentLevelSettings.precode)) { PMWrapper.preCode = currentLevelSettings.precode; } if (currentLevelSettings.taskDescription != null && !ignorePlayingGuides) { PMWrapper.SetTaskDescription(currentLevelSettings.taskDescription.header, currentLevelSettings.taskDescription.body); } else { PMWrapper.SetTaskDescription("", ""); } if (currentLevelSettings.rowLimit > 0) { PMWrapper.codeRowsLimit = currentLevelSettings.rowLimit; } if (currentLevelSettings.availableFunctions != null) { List <IEmbeddedType> availableFunctions = CreateFunctionsFromStrings(currentLevelSettings.availableFunctions); PMWrapper.AddCompilerFunctions(availableFunctions); } }
public void UseSettings() { PMWrapper.codeRowsLimit = rowLimit; PMWrapper.SetTaskDescription(taskDescription); PMWrapper.preCode = preCode; PMWrapper.AddCodeAtStart(startCode); UISingleton.instance.levelHandler.currentLevel.caseHandler = new CaseHandler(caseCount); PMWrapper.codewalkerBaseSpeed = gameSpeed; PMWrapper.SetSmartButtons(smartButtons); PMWrapper.SetCompilerFunctions(functions); }
private void SetLevelSettings() { UISingleton.instance.saveData.ClearPreAndMainCode(); if (currentLevelSettings == null) { return; } if (!String.IsNullOrEmpty(currentLevelSettings.precode)) { PMWrapper.preCode = currentLevelSettings.precode; } if (!String.IsNullOrEmpty(currentLevelSettings.startCode)) { PMWrapper.AddCodeAtStart(currentLevelSettings.startCode); } if (currentLevelSettings.taskDescription != null) { PMWrapper.SetTaskDescription(currentLevelSettings.taskDescription.header, currentLevelSettings.taskDescription.body); } else { PMWrapper.SetTaskDescription("", ""); } if (currentLevelSettings.rowLimit > 0) { PMWrapper.codeRowsLimit = currentLevelSettings.rowLimit; } if (currentLevelSettings.availableFunctions != null) { var availableFunctions = CreateFunctionsFromStrings(currentLevelSettings.availableFunctions); PMWrapper.AddCompilerFunctions(availableFunctions); } }
private void ClearSettings() { PMWrapper.SetTaskDescription("", ""); PMWrapper.SetCompilerFunctions(); PMWrapper.preCode = ""; }