CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Sep 2013
    Posts
    1

    Unhappy Ignoring Json file settings and following something else i command

    So lets say i have a project called Epic

    and Epic calls upon a Json file for its information, so that i can edit the json file when needed.

    Now lets say i have a .cs file called EpicSettings, and my main forum refers to Epicsettings.json, which its default is generated from EpicSettings.cs

    Now lets say i have the code

    Code:
    defaultLauncherSettings.EpicVersion = "Epicversion.jar";
    and in most cases it refers to that, and im happy. but lets say i have a button, and i want it to ignore that, and do something else when i press the button. Lets say i want it to do "EpicVersion2.jar"

    Heres what i have right now;

    Code:
            private void toolStripButton4_Click(object sender, EventArgs e)
            {
                SetStatus("Logging In...");
                progressBar.Value = 10;
                progressBar.Value = 100;
                launchWithForge = null;
    
                if (!Epic.Launcher.Start(usernameInput.Text, passwordInput.Text, settings, false))
                {
                    SetStatus("Invalid Login !");
                    progressBar.Value = 0;
                    return;
                    
                    }
    
                if (settings.closeWhenStarting == true)
                {
                    this.Close();
                }
            }
    And in
    Code:
                SetStatus("Logging In...");
                progressBar.Value = 10;
                progressBar.Value = 100;
                launchWithForge = null;
    i want it to ignore that code, what would i put in there to do so?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Ignoring Json file settings and following something else i command

    It's little hard to follow what you are looking for, but if you want to ignore code, don't call that code. Use a conditional operator like an if statement to determine whether to call code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured