private void GoToStep(int step) { btnBack.Enabled = step > 0; if (step >= stepsList.Count) { return; } KillCurrentStep(); currentStepIndex = step; currentStep = stepsList[step]; currentStep.Size = StepPanel.Size; currentStep.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; btn_Next.Visible = currentStep.CanProceed && step != stepsList.Count - 1; if (currentStep.Profile != currentProfile)// dont reinitialize, user is coming back { currentStep.Initialize(currentGameInfo, currentProfile); } StepPanel.Controls.Add(currentStep); currentStep.Size = StepPanel.Size; // for some reason this line must exist or the PositionsControl get messed up label_StepTitle.Text = currentStep.Title; }
private void GoToStep(int step) { if (step == 1 && DoesntNeedOptions()) { step++; } BrowserBtns.SetPreviousButtonState(step > 0); if (step >= stepsList.Count) { return; } else if (step >= 2) { // Custom steps #if false List <CustomStep> customSteps = handlerData.CustomSteps; int customStepIndex = step - 2; CustomStep customStep = customSteps[0]; if (customStep.Required) { jsControl.CustomStep = customStep; jsControl.DataManager = handlerDataManager; } else { BrowserBtns.SetPlayButtonState(true); return; } #endif } KillCurrentStep(); currentStepIndex = step; currentStep = stepsList[step]; currentStep.Size = panel_steps.Size; currentStep.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; #if false currentStep.Initialize(handlerData, userGame, currentProfile); #endif BrowserBtns.SetNextButtonState(currentStep.CanProceed && step != stepsList.Count - 1); panel_steps.Controls.Add(currentStep); currentStep.Size = panel_steps.Size; // for some reason this line must exist or the PositionsControl get messed up MainForm.Instance.ChangeTitle(currentStep.Title, currentStep.Image); }
private void GoToStep(int step) { btnBack.Enabled = step > 0; if (step >= stepsList.Count) { return; } if (step >= 2) { // Custom steps List <CustomStep> customSteps = currentGame.CustomSteps; int customStepIndex = step - 2; CustomStep customStep = customSteps[0]; if (customStep.UpdateRequired != null) { customStep.UpdateRequired(); } if (customStep.Required) { jsControl.CustomStep = customStep; jsControl.Content = content; } else { EnablePlay(); return; } } KillCurrentStep(); currentStepIndex = step; currentStep = stepsList[step]; currentStep.Size = StepPanel.Size; currentStep.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; currentStep.Initialize(currentGameInfo, currentProfile); btn_Next.Enabled = currentStep.CanProceed && step != stepsList.Count - 1; StepPanel.Controls.Add(currentStep); currentStep.Size = StepPanel.Size; // for some reason this line must exist or the PositionsControl get messed up label_StepTitle.Text = currentStep.Title; }
private void GoToStep(int step) { btn_Previous.Enabled = step > 0; if (step >= stepsList.Count) { return; } if (step >= 2) { // Custom steps List <CustomStep> customSteps = handlerData.CustomSteps; int customStepIndex = step - 2; CustomStep customStep = customSteps[0]; if (customStep.Required) { jsControl.CustomStep = customStep; jsControl.DataManager = handlerDataManager; } else { EnablePlay(); return; } } KillCurrentStep(); currentStepIndex = step; currentStep = stepsList[step]; currentStep.Size = panel_Steps.Size; currentStep.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; currentStep.Initialize(handlerData, selectedControl.UserGameInfo, currentProfile); btn_Next.Enabled = currentStep.CanProceed && step != stepsList.Count - 1; panel_Steps.Controls.Add(currentStep); currentStep.Size = panel_Steps.Size; // for some reason this line must exist or the PositionsControl get messed up lbl_StepTitle.Text = currentStep.Title; }