private void SetFlags()
        {
            ulong  x;
            string flags = string.Empty;

            foreach (HeaderVariable var in headerVariables)
            {
                x = ulong.Parse(HexConverter.Hex2Dec_16CHARS(var.VariableValue).ToString());
                if ((x & FlagsGZ) == x)
                {
                    flags += var.VariableName + '|';
                }
            }

            if (flags.Length != 0)
            {
                flags = flags.TrimEnd('|');
            }
            else
            {
                flags = FlagsGZ.ToString();
            }

            this.Flags = flags;
        }
        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];
                }
            }
        }
Exemple #3
0
        private void SetFlags()
        {
            string flags = string.Empty;

            if ((FlagsGZ & 0x00000001) == 0x00000001)
            {
                flags = "ff_always_hide_label";
            }

            if ((FlagsGZ & 0x0000ff00) != 0)
            {
                byte x = (byte)((FlagsGZ & 0x0000ff00) >> 8);
                x      = (byte)(100 - x);
                flags += "|max_player_rating(" + x + ")";
            }

            if (flags.Length == 0)
            {
                flags = FlagsGZ.ToString();
            }
            else
            {
                flags = flags.TrimStart('|');
            }

            Flags = flags;
        }
Exemple #4
0
        private void SetFlags()
        {
            string flags = string.Empty;

            if (FlagsGZ == 0x1)
            {
                flags = "mcn_no_shadow";
            }

            if (flags.Length == 0)
            {
                flags = FlagsGZ.ToString();
            }

            Flags = flags;
        }
Exemple #5
0
        private void SetFlags()
        {
            string flags = string.Empty;

            if ((FlagsGZ & 0x1) == 1)
            {
                flags += "sf_2d|";
            }
            if ((FlagsGZ & 0x2) == 2)
            {
                flags += "sf_looping|";
            }
            if ((FlagsGZ & 0x4) == 4)
            {
                flags += "sf_start_at_random_pos|";
            }
            if ((FlagsGZ & 0x8) == 8)
            {
                flags += "sf_stream_from_hd|";
            }
            if ((FlagsGZ & 0x100000) == 0x100000)
            {
                flags += "sf_always_send_via_network|";
            }
            if ((FlagsGZ & 0xf00) != 0)
            {
                flags += "sf_vol_" + ((FlagsGZ & 0xf00) >> 8) + "|";
            }
            if ((FlagsGZ & 0xf0) != 0)
            {
                flags += "sf_priority_" + ((FlagsGZ & 0xf0) >> 4) + "|";
            }

            if (flags.Length != 0)
            {
                flags = flags.TrimEnd('|');
            }
            else
            {
                flags = FlagsGZ.ToString();
            }

            Flags = flags;
        }
Exemple #6
0
        private void SetFlags()
        {
            string flags = string.Empty;

            if ((FlagsGZ & 0x0001) == 0x0001)
            {
                flags += "sf_indoors|";
            }
            if ((FlagsGZ & 0x0002) == 0x0002)
            {
                flags += "sf_force_skybox|";
            }
            if ((FlagsGZ & 0x0100) == 0x0100)
            {
                flags += "sf_generate|";
            }
            if ((FlagsGZ & 0x0200) == 0x0200)
            {
                flags += "sf_randomize|";
            }
            if ((FlagsGZ & 0x0400) == 0x0400)
            {
                flags += "sf_auto_entry_points|";
            }
            if ((FlagsGZ & 0x0800) == 0x0800)
            {
                flags += "sf_no_horses|";
            }
            if ((FlagsGZ & 0x1000) == 0x1000)
            {
                flags += "sf_muddy_water|";
            }

            if (flags.Length != 0)
            {
                flags = flags.TrimEnd('|');
            }
            else
            {
                flags = FlagsGZ.ToString();
            }

            this.Flags = flags;
        }
Exemple #7
0
        private void SetFlags()
        {
            ulong  x;
            string flags = string.Empty;

            foreach (HeaderVariable var in headerVariables)
            {
                x = ulong.Parse(HexConverter.Hex2Dec_16CHARS(var.VariableValue).ToString());
                if ((x & FlagsGZ) == x)
                {
                    flags += var.VariableName + '|';
                }
            }

            //hitPoints = (int)(flagsGZ >> 20) & byte.MaxValue; //already read
            useTime = (int)(FlagsGZ >> 28) & byte.MaxValue;

            if (HitPoints != 0)
            {
                flags += "spr_hit_points(" + HitPoints + ")|";
            }

            if (useTime != 0)
            {
                flags += "spr_use_time(" + useTime + ")|";
            }

            if (flags.Length != 0)
            {
                flags = flags.TrimEnd('|');
            }
            else
            {
                flags = FlagsGZ.ToString();
            }

            Flags = flags;
        }
Exemple #8
0
        private void SetFlags()
        {
            string flags = string.Empty;

            if ((FlagsGZ & 0x1) == 1)
            {
                flags += "qf_show_progression";
            }
            if ((FlagsGZ & 0x2) == 2)
            {
                flags += "|qf_random_quest";
            }

            if (flags.Length != 0)
            {
                flags = flags.TrimStart('|');
            }
            else
            {
                flags = FlagsGZ.ToString();
            }

            this.Flags = flags;
        }
Exemple #9
0
        //place normalized version in Skriptum ? for every Skriptum Object and public
        private void SetFlags()
        {
            string flags = string.Empty;

            foreach (HeaderVariable headerVar in headerVariables)
            {
                ulong x = ulong.Parse(headerVar.VariableValue);
                if ((x & FlagsGZ) == x)
                {
                    flags += headerVar.VariableName + '|';
                }
            }

            if (flags.Length != 0)
            {
                flags = flags.TrimEnd('|');
            }
            else
            {
                flags = FlagsGZ.ToString();
            }

            Flags = flags;
        }
Exemple #10
0
        private void SetFlags()
        {
            string flags = string.Empty;
            ulong  tmpU  = FlagsGZ;

            char[] cc = HexConverter.Dec2Hex_16CHARS(FlagsGZ).ToCharArray();

            if (cc.Length > 7)
            {
                if (cc[cc.Length - 1] == '1')
                {
                    flags += "|mnf_join_battle";
                    tmpU  -= 0x1;
                }

                if (cc[cc.Length - 2] == '1')
                {
                    flags += "|mnf_auto_enter";
                    tmpU  -= 0x10;
                }

                if (cc[cc.Length - 3] == '1')
                {
                    flags += "|mnf_enable_hot_keys";
                    tmpU  -= 0x100;
                }
                else if (cc[cc.Length - 3] == '2')
                {
                    flags += "|mnf_disable_all_keys";
                    tmpU  -= 0x200;
                }
                else if (cc[cc.Length - 3] == '3')
                {
                    flags += "|mnf_enable_hot_keys|mnf_disable_all_keys";
                    tmpU  -= 0x300;
                }

                if (cc[cc.Length - 4] == '1')
                {
                    flags += "|mnf_scale_picture";
                    tmpU  -= 0x1000;
                }
            }

            if (tmpU > 0)
            {
                string tmp = HexConverter.Dec2Hex(tmpU >> 32);
                TextColor = Color.FromArgb(byte.Parse(HexConverter.Hex2Dec(tmp.Substring(0, 2)).ToString()),
                                           byte.Parse(HexConverter.Hex2Dec(tmp.Substring(2, 2)).ToString()),
                                           byte.Parse(HexConverter.Hex2Dec(tmp.Substring(4, 2)).ToString()),
                                           byte.Parse(HexConverter.Hex2Dec(tmp.Substring(6, 2)).ToString()));
                flags += "|menu_text_color(0x" + tmp + ')';
            }

            if (flags.Equals(string.Empty))
            {
                flags = FlagsGZ.ToString();
            }
            else
            {
                flags = flags.TrimStart('|');
            }

            Flags = flags;
        }