示例#1
0
        private void InitializeGameMeu(string[] raw_data)
        {
            string[] tmpSX;
            int      tmp = 1, tmp2;

            if (ImportantMethods.IsNumericGZ(raw_data[tmp]))
            {
                FlagsGZ = ulong.Parse(raw_data[tmp]);
                SetFlags();
            }
            else
            {
                Flags = raw_data[tmp].Trim();
                SetFlagsGZ();
            }
            tmp++;
            Text = raw_data[tmp];
            tmp++;
            MeshName = raw_data[tmp];
            tmp++;
            tmp2 = int.Parse(raw_data[tmp]);
            if (tmp2 != 0)
            {
                OperationBlock = new string[tmp2 + 1];
                tmpSX          = new string[raw_data.Length - tmp - 1];
                tmp++;
                for (int i = tmp - 1; i < raw_data.Length - 1; i++)
                {
                    tmpSX[i - (tmp - 1)] = raw_data[i];
                }
                OperationBlock[0] = ID + 1;
                tmpSX             = CodeReader.DecompileScriptCode(OperationBlock, tmpSX);
                OperationBlock    = CodeReader.GetStringArrayStartFromIndex(tmpSX, 1);
            }
        }
示例#2
0
        private void SetFaceTextures(string[] s)
        {
            int x, y = 0;

            FaceTextures = new FaceTexture[int.Parse(s[0])];
            s            = CodeReader.GetStringArrayStartFromIndex(s, 1);
            for (int i = 0; i < FaceTextures.Length; i++)
            {
                string[] textures = new string[int.Parse(s[y + 2])];
                x = 0;
                for (int j = 0; j < textures.Length; j++)
                {
                    textures[j] = s[y + x + 4];
                    x++;
                }
                ulong[] texHV = new ulong[int.Parse(s[y + 3])];
                for (int j = 0; j < texHV.Length; j++)
                {
                    texHV[j] = ulong.Parse(s[y + x + 4]);
                    x++;
                }
                FaceTextures[i] = new FaceTexture(s[y], uint.Parse(s[y + 1]), textures, texHV);
                y += x + 4;
            }
        }
示例#3
0
 public PartyTemplate(string[] raw_data) : base(raw_data[0], ObjectType.PartyTemplate)
 {
     Name    = raw_data[1];
     FlagsGZ = ulong.Parse(raw_data[2]);
     SetFlagsString();
     MenuID      = int.Parse(raw_data[3]);
     FactionID   = int.Parse(raw_data[4]);
     Faction     = CodeReader.Factions[FactionID];
     Personality = int.Parse(raw_data[5]);
     for (int i = 0; i < Members.Length; i++)
     {
         Members[i] = PMember.DEFAULT_MEMBER;
     }
     for (int i = 0; i < Members.Length; i++)
     {
         if (!raw_data[(i * 4) + 6].Equals("-1"))
         {
             Members[i] = new PMember(CodeReader.GetStringArrayStartFromIndex(raw_data, (i * 4) + 6));
         }
         else
         {
             i = Members.Length;
         }
     }
 }
        public TableauMaterial(string[] raw_data, bool source = false) : base(raw_data[0], ObjectType.TableauMaterial)
        {
            FlagsGZ            = ulong.Parse(raw_data[1]);
            Flags              = FlagsGZ.ToString(); //change if flags available
            SampleMaterialName = raw_data[2];        //change to name if good idea later
            Width              = int.Parse(raw_data[3]);
            Height             = int.Parse(raw_data[4]);
            MinX = int.Parse(raw_data[5]);
            MinY = int.Parse(raw_data[6]);
            MaxX = int.Parse(raw_data[7]);
            MaxY = int.Parse(raw_data[8]);

            if (!source)
            {
                OperationBlock    = new string[int.Parse(raw_data[9]) + 1];
                OperationBlock[0] = ID;
                OperationBlock    = CodeReader.GetStringArrayStartFromIndex(CodeReader.DecompileScriptCode(OperationBlock, CodeReader.GetStringArrayStartFromIndex(raw_data, 9)), 1);
            }
            else
            {
                OperationBlock = new string[raw_data.Length - 9];
                for (int i = 0; i < OperationBlock.Length; i++)
                {
                    OperationBlock[i] = raw_data[i + 9];
                }
            }
        }
示例#5
0
        private void AddTriggers(string[] values, int ix, int x2)
        {
            int           endI         = ix + x2;
            List <string> triggerCodes = new List <string>();

            for (int i = ix; i < endI; i++)
            {
                triggerCodes.Add(values[i]);
            }

            foreach (string triggerCode in triggerCodes)
            {
                string[]      scriptLines   = triggerCode.Split();
                SimpleTrigger simpleTrigger = new SimpleTrigger(scriptLines[0]);
                string[]      tmpS          = new string[int.Parse(scriptLines[1]) + 1];
                tmpS[0]     = "SIMPLE_TRIGGER";
                scriptLines = CodeReader.GetStringArrayStartFromIndex(scriptLines, 1);
                simpleTrigger.ConsequencesBlock = CodeReader.GetStringArrayStartFromIndex(CodeReader.DecompileScriptCode(tmpS, scriptLines), 1);
                SimpleTriggers.Add(simpleTrigger);
            }
        }
示例#6
0
        protected override void Language_cbb_SelectedIndexChanged(object sender, EventArgs e)
        {
            base.Language_cbb_SelectedIndexChanged(sender, e);

            if (CurrentTypeIndex >= 0)
            {
                GameMenu menu = (GameMenu)types[CurrentTypeIndex];

                if (language_cbb.SelectedIndex == LANGUAGE_EN_GZ && singleNameTranslation_txt.Text.Length == 0)
                {
                    singleNameTranslation_txt.Text = menu.Text.Replace('_', ' ');
                }

                if (language_cbb.SelectedIndex >= 0 && designer != null)
                {
                    designer.UpdateGameMenuText(singleNameTranslation_txt.Text);
                    PrepareOptionsLanguage();

                    string[] a = null;
                    if (mno_translations.Length > 0)
                    {
                        if (mno_translations[0] == null)
                        {
                            a = new string[menu.MenuOptions.Length];
                            for (int i = 0; i < a.Length; i++)
                            {
                                a[i] = menu.MenuOptions[i].Text.Replace('_', ' ');
                            }
                        }
                    }

                    if (a == null)
                    {
                        a = CodeReader.GetStringArrayStartFromIndex(mno_translations, 0, mno_translations.Length - menu.MenuOptions.Length);
                    }

                    designer.UpdateGameMenuOptionsTexts(a);
                }
            }
        }
示例#7
0
        private static string[] ProcessBlock(string[] raw_data, int tmp, int start_index)
        {
            int xx = 0;
            int x  = -1;

            string[] tmpSX;
            string[] resArray = new string[tmp + 1];
            for (int i = start_index; i < raw_data.Length; i++)
            {
                if (!raw_data[i].Equals(string.Empty))
                {
                    x++;
                }
                else
                {
                    i = raw_data.Length;
                }
            }
            if (raw_data.Length > (start_index + x + 2))
            {
                if (raw_data[start_index + x + 2].Equals("NO_TEXT"))
                {
                    noErrorCode = !noErrorCode;
                }
            }
            resArray[0] = "TEXT";
            if (!noErrorCode)
            {
                xx++;
            }
            tmpSX = new string[x + 1 + xx];
            for (int i = start_index; i < (tmpSX.Length + start_index - 1); i++)
            {
                tmpSX[i - start_index + 1] = raw_data[i];
            }
            tmpSX[0] = resArray[0];
            return(CodeReader.GetStringArrayStartFromIndex(CodeReader.DecompileScriptCode(resArray, tmpSX), 1));
        }