XCI-Explorer icon indicating copy to clipboard operation
XCI-Explorer copied to clipboard

Show update version - code included

Open mrdude2478 opened this issue 4 years ago • 0 comments

Please add this code to show what version update is present when reading the update nsp.

Example code below.

if (xmlVersion.Trim() == "")
                        {
                            TB_GameRev.Text = NACP.NACP_Datas[0].GameVer.Replace("\0", "");
                        }
                        else
                        {
                            //TB_GameRev.Text = NACP.NACP_Datas[0].GameVer.Replace("\0", "") + " (" + xmlVersion + ")";

                            TB_GameRev.Text = xmlVersion + " (" + NACP.NACP_Datas[0].GameVer.Replace("\0", "") + ")";
                            string stringToCheck = xmlVersion;

                            int maxupdates = 50; //max number of game updates
                            string[] stringArray = new string[maxupdates];
                            int val = 65536;

                            for (int i = 0; i < maxupdates; i++)
                            {
                                stringArray[i] = (val).ToString();
                                val = (val + 65536);
                            }


                            foreach (string x in stringArray)
                            {
                                if (stringToCheck.Contains(x))
                                {
                                    int number = System.Convert.ToInt32(x);
                                    int divideby = 65536;
                                    TB_GameRev.Text = "Update " + ((double)number / divideby) + " (" + xmlVersion + ")";
                                }
                            }

                        }
                        TB_ProdCode.Text = NACP.NACP_Datas[0].GameProd.Replace("\0", "");
                        if (TB_ProdCode.Text == "")
                        {
                            TB_ProdCode.Text = "No Prod. ID";
                        }

Cheers.

See screenshot (in red box), for what I mean...

GitHub Logo

mrdude2478 avatar Mar 10 '20 01:03 mrdude2478