Inheritance: Asset
示例#1
0
        private async Task <Unit> ExportToCmp(Unit _)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.InitialFileName = Utility.GetSafeFilename(saveSlotContext.HunterName);
            sfd.Filters.Add(new FileDialogFilter {
                Name = "NPC Character Preset", Extensions = new List <string> {
                    "cmp"
                }
            });

            var fileName = await sfd.ShowAsync();

            if (fileName != null)
            {
                try
                {
                    CMP cmp = new CMP(saveSlotContext.Native.CharacterAppearance);
                    cmp.Save(fileName);

                    string str = $"Exported NPC Character Preset to {fileName}";
                    MainWindowViewModel.Instance.ShowPopup(str);
                    CtxLog.Information(str);
                }
                catch (Exception ex)
                {
                    MainWindowViewModel.Instance.ShowPopup(ex.Message);
                    CtxLog.Error(ex, ex.Message);
                }
            }

            return(Unit.Default);
        }
示例#2
0
        /// <summary>
        /// Deletes a file descriptor/stub from the Index files.
        /// </summary>
        /// <param name="fullPath">Full internal file path to the file that should be deleted.</param>
        /// <param name="dataFile">Which data file to use</param>
        /// <returns></returns>
        public async Task <bool> DeleteFileDescriptor(string fullPath, XivDataFile dataFile, bool updateCache = true)
        {
            await UpdateDataOffset(0, fullPath, false, true);

            // This is a metadata entry being deleted, we'll need to restore the metadata entries back to default.
            if (fullPath.EndsWith(".meta"))
            {
                var root = await XivCache.GetFirstRoot(fullPath);

                await ItemMetadata.RestoreDefaultMetadata(root);
            }

            if (fullPath.EndsWith(".rgsp"))
            {
                await CMP.RestoreDefaultScaling(fullPath);
            }

            if (updateCache)
            {
                // Queue us for updating, *after* updating the associated metadata files.
                XivCache.QueueDependencyUpdate(fullPath);
            }

            return(true);
        }
示例#3
0
        RichCompare(IntPtr ptr1, IntPtr ptr2, int opid)
        {
            object objResult = true;
            CMP    op        = (CMP)opid;

            switch (op)
            {
            case CMP.Py_LT:
                objResult = PythonOperator.lt(this.scratchContext, this.Retrieve(ptr1), this.Retrieve(ptr2));
                break;

            case CMP.Py_LE:
                objResult = PythonOperator.le(this.scratchContext, this.Retrieve(ptr1), this.Retrieve(ptr2));
                break;

            case CMP.Py_EQ:
                objResult = PythonOperator.eq(this.scratchContext, this.Retrieve(ptr1), this.Retrieve(ptr2));
                break;

            case CMP.Py_NE:
                objResult = PythonOperator.ne(this.scratchContext, this.Retrieve(ptr1), this.Retrieve(ptr2));
                break;

            case CMP.Py_GT:
                objResult = PythonOperator.gt(this.scratchContext, this.Retrieve(ptr1), this.Retrieve(ptr2));
                break;

            case CMP.Py_GE:
                objResult = PythonOperator.ge(this.scratchContext, this.Retrieve(ptr1), this.Retrieve(ptr2));
                break;
            }
            return(objResult);
        }
示例#4
0
 public void OnCustomConsentButtonClick()
 {
     CMP.CustomConsentGDPR(vendors: this.vendors,
                           categories: this.categories,
                           legIntCategories: this.legIntCategories,
                           onSuccessDelegate: SuccessDelegate);
 }
    private void Awake()
    {
        DontDestroyOnLoad(this.gameObject);
        List <SpCampaign> spCampaigns = new List <SpCampaign>();

        if (allCampaignTypesToLoad.Contains(CAMPAIGN_TYPE.GDPR))
        {
            List <TargetingParam> gdprParams = new List <TargetingParam> {
                new TargetingParam("location", "EU")
            };
            SpCampaign gdpr = new SpCampaign(CAMPAIGN_TYPE.GDPR, gdprParams);
            spCampaigns.Add(gdpr);
        }
        if (allCampaignTypesToLoad.Contains(CAMPAIGN_TYPE.CCPA))
        {
            List <TargetingParam> ccpaParams = new List <TargetingParam> {
                new TargetingParam("location", "US")
            };
            SpCampaign ccpa = new SpCampaign(CAMPAIGN_TYPE.CCPA, ccpaParams);
            spCampaigns.Add(ccpa);
        }
        if (allCampaignTypesToLoad.Contains(CAMPAIGN_TYPE.IOS14))
        {
            List <TargetingParam> ios14Params = new List <TargetingParam>();
            SpCampaign            ios14       = new SpCampaign(CAMPAIGN_TYPE.IOS14, ios14Params);
            spCampaigns.Add(ios14);
        }
        CMP.Initialize(spCampaigns: spCampaigns,
                       accountId: this.accountId,
                       propertyName: this.propertyName,
                       language: this.language,
                       campaignsEnvironment: campaignEnvironment,
                       messageTimeoutInSeconds: this.messageTimeoutInSeconds);
    }
示例#6
0
        public ModelImporter(UTFEditorMain parent, string path)
        {
            this.parent = parent;

            var importForm = new ModelImporterOptions(Path.GetFileNameWithoutExtension(path));

            if (importForm.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            Wireframe  = importForm.Wireframe;
            VertexType = importForm.VertexType;
            Relocate   = importForm.Relocate;
            UniqueName = importForm.UniqueName;

            InitCMP(path);
            //InitMAT(path);

            if (Path.GetExtension(path).ToLower() == ".fbx")
            {
                ImportFBX(path);
            }

            CMP.Modified();
            //MAT.Modified();

            //MAT.Show();
            CMP.Show();
        }
    private void Start()
    {
#if !UNITY_ANDROID || !UNITY_IOS || UNITY_EDITOR || UNITY_EDITOR_OSX
        CMP.LoadMessage(cmpHomePrefab: CmpPrefab,
                        canvas: canvas,
                        privacyManagerId: "16879",
                        propertyId: "4933");
#else
        CMP.LoadMessage(authId: authID);
#endif
    }
示例#8
0
        public void SaveSlot_to_cmp()
        {
            string cmpPath = "saveslot0.cmp";

            SaveData saveData = new SaveData(@"C:/Steam/userdata/112073240/582010/remote/SAVEDATA1000");
            CMP      cmp      = new CMP(saveData.SaveSlots[0].Native.Appearance);

            cmp.Save(cmpPath);

            CMP load = new CMP(cmpPath);

            Assert.IsNotNull(load.Appearance);
        }
示例#9
0
        public void Rebuild__preset_female_1()
        {
            string origPath    = Utility.GetFullPath(@"chunk0/stage/st407/common/preset/preset_female_1.cmp");
            string rebuildPath = "rebuild__preset_female_1.cmp";

            CMP cmp = new CMP(origPath);

            cmp.Save(rebuildPath);

            if (!Utility.CheckFilesAreSame(origPath, rebuildPath))
            {
                Assert.Fail("Hash doesn't match!");
            }
        }
示例#10
0
        public void SaveSlot_to_cmp()
        {
            string cmpPath = "saveslot0.cmp";

            SaveData saveData = new SaveData(Utility.GetTestAsset(@"saves/IceborneSave1"));
            CMP      cmp      = new CMP(saveData.SaveSlots[0].Native.CharacterAppearance);

            cmp.Save(cmpPath);

            CMP load = new CMP(cmpPath);

            Assert.IsNotNull(load.Appearance);

            File.Delete(cmpPath);
        }
        private async void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                _data.MinSize = float.Parse(MinHeightBox.Text);
                _data.MaxSize = float.Parse(MaxHeightBox.Text);

                _data.MinTail = float.Parse(MinTailBox.Text);
                _data.MaxTail = float.Parse(MaxTailBox.Text);

                if (Gender == XivGender.Female)
                {
                    _data.BustMinX = float.Parse(MinBustX.Text);
                    _data.BustMinY = float.Parse(MinBustY.Text);
                    _data.BustMinZ = float.Parse(MinBustZ.Text);

                    _data.BustMaxX = float.Parse(MaxBustX.Text);
                    _data.BustMaxY = float.Parse(MaxBustY.Text);
                    _data.BustMaxZ = float.Parse(MaxBustZ.Text);
                }
            }
            catch (Exception Ex)
            {
                FlexibleMessageBox.Show("Cannot save changes: One or more values are not valid.", "Invalid Data Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                return;
            }

            try
            {
                ResetButton.IsEnabled  = false;
                CancelButton.IsEnabled = false;
                SaveButton.IsEnabled   = false;
                SaveButton.Content     = "Working...";

                await CMP.SaveScalingParameter(_data, XivStrings.TexTools);

                this.Close();
            } catch (Exception ex)
            {
                FlexibleMessageBox.Show("Cannot save changes:\n\nError: " + ex.Message, "Save Scaling Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);

                ResetButton.IsEnabled  = true;
                CancelButton.IsEnabled = true;
                SaveButton.IsEnabled   = true;
                SaveButton.Content     = "Save";
                return;
            }
        }
            internal static bool TryParse(string ASMLine, ASMLine Current, out ASMLine Out)
            {
                Out     = null;
                ASMLine = ASMLine.ToLower().Trim();
                string[] split = null;

                if (ASMLine.Length < 1)
                {
                    return(false); //empty line
                }
                if (ASMLine[0] == ';')
                {
                    return(false); //comment line, end of section
                }
                //section headers
                if ((split = ASMLine.Split(':')).Length > 1 && Regex.IsMatch(split[0], "^[a-z_0-9]+$"))
                {
                    return((Out = new SectionHeader(split[0])) != null);
                }

                split = SPR.Split(ASMLine);

                switch (split[0])
                {
                case "nop":
                    return((Out = new NOP(Current)) != null);

                case "movzx":
                    return((Out = new MOVZX(Current, split)) != null);

                case "cmp":
                    return((Out = new CMP(Current, split)) != null);

                case "jnb":
                case "jbe":
                case "jmp":
                    return((Out = new JUMP(Current, split)) != null);

                case "retn":
                    return((Out = new RET(Current)) != null);

                default:
                    throw new NotImplementedException($"Unable to parse instruction {split[0]}");
                }
            }
示例#13
0
        /// <summary>
        /// Tells whether or not a point intersects a line
        /// </summary>
        /// <param name="point"></param>
        /// <param name="line"></param>
        /// <returns>returns whether or not a point collided with a line</returns>
        public static bool PointOnLine(Point point, Line line)
        {
            if (point.X > line.End.X && point.Y > line.End.Y || point.X < line.Start.X && point.Y < line.Start.Y)
            {
                return(false);
            }
            //Slope intercept formula y=mx+b
            //Finds the Slope
            float dy = line.End.Y - line.Start.Y;
            float dx = line.End.X - line.Start.X;
            float m  = dy / dx;

            //Y-Intercept
            float b = line.Start.Y - m * line.Start.X;

            //Check line equation

            return(CMP.IsEq(point.Y, m * point.X + b));
        }
        public async Task Init()
        {
            _data = await CMP.GetScalingParameter(Race, Gender);

            Title            = "Racial Settings - " + Race.GetDisplayName() + " - " + Gender.ToString();
            TitleBox.Content = "Racial Settings: " + Race.GetDisplayName() + " - " + Gender.ToString();

            MinHeightBox.Text = _data.MinSize.ToString();
            MaxHeightBox.Text = _data.MaxSize.ToString();

            MinTailBox.Text = _data.MinTail.ToString();
            MaxTailBox.Text = _data.MaxTail.ToString();

            MinBustX.Text = _data.BustMinX.ToString();
            MinBustY.Text = _data.BustMinY.ToString();
            MinBustZ.Text = _data.BustMinZ.ToString();

            MaxBustX.Text = _data.BustMaxX.ToString();
            MaxBustY.Text = _data.BustMaxY.ToString();
            MaxBustZ.Text = _data.BustMaxZ.ToString();

            if (Gender != XivGender.Female)
            {
                MinBustXLabel.Visibility = Visibility.Collapsed;
                MinBustYLabel.Visibility = Visibility.Collapsed;
                MinBustZLabel.Visibility = Visibility.Collapsed;

                MaxBustXLabel.Visibility = Visibility.Collapsed;
                MaxBustYLabel.Visibility = Visibility.Collapsed;
                MaxBustZLabel.Visibility = Visibility.Collapsed;

                MinBustX.Visibility = Visibility.Collapsed;
                MinBustY.Visibility = Visibility.Collapsed;
                MinBustZ.Visibility = Visibility.Collapsed;

                MaxBustX.Visibility = Visibility.Collapsed;
                MaxBustY.Visibility = Visibility.Collapsed;
                MaxBustZ.Visibility = Visibility.Collapsed;
            }

            ShowDialog();
        }
示例#15
0
        private async Task <SerializableAppearance?> ImportFromCmp(Unit _)
        {
            OpenFileDialog ofd   = new OpenFileDialog();
            var            items = await ofd.ShowAsync();

            if (items?.Length > 0)
            {
                try
                {
                    CMP cmp = new CMP(items[0]);
                    return(new SerializableAppearance(cmp));
                }
                catch (Exception ex)
                {
                    MainWindowViewModel.Instance.ShowPopup(ex.Message);
                    CtxLog.Error(ex, ex.Message);
                }
            }

            return(null);
        }
示例#16
0
    public void Load(string LEVname)
    {
        _lev = Asset.LoadCached<LEV>(LEVname + ".LEV");
        _pal = Asset.LoadCached<PAL>(_lev.Palette.ToUpper());
        _cmp = Asset.LoadCached<CMP>(LEVname + ".CMP");

        _game.SolidCMP.SetTexture("_PAL", _pal.Texture);
        _game.SolidCMP.SetTexture("_CMP", _cmp.Texture);

        BM.CreateArgs bmCreateArgs = new BM.CreateArgs();
        bmCreateArgs.Pal = _pal;

        if (_game.EmulateCMPShading) {
            bmCreateArgs.TextureFormat = TextureFormat.Alpha8;
            bmCreateArgs.AnisoLevel = 0;
            bmCreateArgs.FilterMode = FilterMode.Point;
            bmCreateArgs.bMipmap = false;
        } else {
            bmCreateArgs.TextureFormat = TextureFormat.RGBA32;
            bmCreateArgs.AnisoLevel = 9;
            bmCreateArgs.FilterMode = FilterMode.Trilinear;
            bmCreateArgs.bMipmap = true;
        }

        foreach (var texName in _lev.Textures) {
            try {
                BM bm = Asset.LoadCached<BM>(texName.ToUpper(), bmCreateArgs);
                _textures.Add(bm);
                if (_defaultTexture == null) {
                    _defaultTexture = bm;
                }
            } catch (System.IO.FileNotFoundException) {
                _textures.Add(null);
            }
        }

        GenerateSectors();
    }
        private async void ResetButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ResetButton.IsEnabled  = false;
                CancelButton.IsEnabled = false;
                SaveButton.IsEnabled   = false;
                ResetButton.Content    = "Working...";

                await CMP.DisableRgspMod(Race, Gender);

                this.Close();
            }
            catch (Exception ex)
            {
                FlexibleMessageBox.Show("Cannot save changes:\n\nError: " + ex.Message, "Save Scaling Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);

                ResetButton.IsEnabled  = true;
                CancelButton.IsEnabled = true;
                SaveButton.IsEnabled   = true;
                ResetButton.Content    = "Restore Defaults";
                return;
            }
        }
示例#18
0
        public static Instruccion DescodificarInstruccion(byte codigo, ushort pos)
        {
            Instruccion instruccion       = null;
            ArgMemoria  argumentoMemoria  = Argumento.ConvertirEnArgumento((Main.ObtenerMemoria.ObtenerDireccion((ushort)(pos + 1)).Contenido * 256 + Main.ObtenerMemoria.ObtenerDireccion((ushort)(pos + 2)).Contenido).ToString("X4"), true) as ArgMemoria;
            ArgRegistro argumentoRegistro = Argumento.ConvertirEnArgumento(Main.ObtenerNombreRegistro(codigo % 4), false) as ArgRegistro;
            ArgLiteral  argumentoLiteral  = Argumento.ConvertirEnArgumento(Main.ObtenerMemoria.ObtenerDireccion((ushort)(pos + 1)).Contenido.ToString(), false) as ArgLiteral;

            switch (codigo / 8)
            {
            case 0:
                instruccion = new LD(argumentoRegistro);
                break;

            case 1:
                instruccion = new ST(argumentoRegistro);
                break;

            case 4:
            case 5:
                instruccion = new LDM(argumentoMemoria, argumentoRegistro);
                break;

            case 6:
            case 7:
                instruccion = new STM(argumentoRegistro, argumentoMemoria);
                break;

            case 2:
            case 3:
                instruccion = new LDI(argumentoLiteral, argumentoRegistro);
                break;

            case 8:
                instruccion = new ADD(argumentoRegistro);
                break;

            case 9:
                instruccion = new SUB(argumentoRegistro);
                break;

            case 10:
                instruccion = new CMP(argumentoRegistro);
                break;


            case 11:
                instruccion = new INC();
                break;

            case 12:
                instruccion = new ADI(argumentoLiteral);
                break;

            case 13:
                instruccion = new SUI(argumentoLiteral);
                break;

            case 14:
            case 15:
                instruccion = new CMI(argumentoLiteral);
                break;


            case 16:
                instruccion = new ANA(argumentoRegistro);
                break;

            case 17:
                instruccion = new ORA(argumentoRegistro);
                break;

            case 18:
                instruccion = new XRA(argumentoRegistro);
                break;


            case 19:
                instruccion = new CMA();
                break;

            case 20:
                instruccion = new ANI(argumentoLiteral);
                break;

            case 21:
                instruccion = new ORI(argumentoLiteral);
                break;

            case 22:
            case 23:
                instruccion = new XRI(argumentoLiteral);
                break;

            case 24:
            case 25:
                instruccion = new JMP(argumentoMemoria);
                break;

            case 26:
                instruccion = new BEQ(argumentoMemoria);
                break;

            case 27:
                instruccion = new BC(argumentoMemoria);
                break;

            case 28:
            case 29:
                instruccion = new LF();
                break;

            case 30:
                instruccion = new IN(argumentoMemoria, argumentoRegistro);
                break;

            case 31:
                instruccion = new OUT(argumentoRegistro, argumentoMemoria);
                break;
            }
            return(instruccion);
        }
示例#19
0
 public AnonymousInstruction2(CMP parent)
 {
     this.parent = parent;
 }
 public void LoadGdprPM()
 {
     CMP.LoadPrivacyManager(CmpPrefab, canvas, CAMPAIGN_TYPE.GDPR, "16879", "4933");
 }
 public void LoadCcpaPM()
 {
     CMP.LoadPrivacyManager(CmpPrefab, canvas, CAMPAIGN_TYPE.CCPA, "16435", "17935");
 }
示例#22
0
        /// <summary>
        /// Performs the most low-level mod enable/disable functions, without saving the modlist,
        /// ergo this should only be called by functions which will handle saving the modlist after
        /// they're done performing all modlist operations.
        ///
        /// If the Index and modlist are provided, the actions are only applied to those cached entries, rather
        /// than to the live files.
        /// </summary>
        /// <param name="enable"></param>
        /// <param name="mod"></param>
        /// <returns></returns>
        public async Task <bool> ToggleModUnsafe(bool enable, Mod mod, bool includeInternal, bool updateCache, IndexFile cachedIndex = null, ModList cachedModlist = null)
        {
            if (mod == null)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(mod.name))
            {
                return(false);
            }
            if (string.IsNullOrEmpty(mod.fullPath))
            {
                return(false);
            }

            if (mod.data.originalOffset <= 0 && !enable)
            {
                throw new Exception("Cannot disable mod with invalid original offset.");
            }

            if (enable && mod.data.modOffset <= 0)
            {
                throw new Exception("Cannot enable mod with invalid mod offset.");
            }

            if (mod.IsInternal() && !includeInternal)
            {
                // Don't allow toggling internal mods unless we were specifically told to.
                return(false);
            }

            var index = new Index(_gameDirectory);
            var dat   = new Dat(_gameDirectory);

            // Added file.
            if (enable)
            {
                if (cachedIndex != null)
                {
                    cachedIndex.SetDataOffset(mod.fullPath, mod.data.modOffset);
                }
                else
                {
                    await index.UpdateDataOffset(mod.data.modOffset, mod.fullPath, false);
                }
                mod.enabled = true;

                if (cachedIndex == null)
                {
                    // Check if we're re-enabling a metadata mod.
                    var ext = Path.GetExtension(mod.fullPath);
                    if (ext == ".meta")
                    {
                        var df = IOUtil.GetDataFileFromPath(mod.fullPath);
                        // Retreive the uncompressed meta entry we just enabled.
                        var data = await dat.GetType2Data(mod.data.modOffset, df);

                        var meta = await ItemMetadata.Deserialize(data);

                        meta.Validate(mod.fullPath);

                        // And write that metadata to the actual constituent files.
                        await ItemMetadata.ApplyMetadata(meta, cachedIndex, cachedModlist);
                    }
                    else if (ext == ".rgsp")
                    {
                        await CMP.ApplyRgspFile(mod.fullPath, cachedIndex, cachedModlist);
                    }
                }
            }
            else if (!enable)
            {
                if (mod.IsCustomFile())
                {
                    // Delete file descriptor handles removing metadata as needed on its own.
                    if (cachedIndex != null)
                    {
                        cachedIndex.SetDataOffset(mod.fullPath, 0);
                    }
                    else
                    {
                        await index.DeleteFileDescriptor(mod.fullPath, IOUtil.GetDataFileFromPath(mod.fullPath), false);
                    }
                }
                else
                {
                    if (cachedIndex != null)
                    {
                        cachedIndex.SetDataOffset(mod.fullPath, mod.data.originalOffset);
                    }
                    else
                    {
                        await index.UpdateDataOffset(mod.data.originalOffset, mod.fullPath, false);
                    }
                }
                mod.enabled = false;
            }

            if (updateCache)
            {
                XivCache.QueueDependencyUpdate(mod.fullPath);
            }

            return(true);
        }
示例#23
0
        static void Main(string[] args)
        {
            MySqlConnection C = new MySqlConnection("Server=localhost;Database=companies_practise2;Uid=root;Pwd=;");

            C.Open();

            MySqlCommand CMD = new MySqlCommand("SELECT C.name AS name, T.name AS type, C.price AS price, C.cnt AS count, U.name AS unit, C.conversion_rate AS CR, C.CTR AS CTR " +
                                                "FROM company C, type T, unit U " +
                                                "WHERE C.type_id = T.id AND T.unit_id = U.id", C);

            MySqlDataAdapter A = new MySqlDataAdapter(CMD);

            DataTable DT = new DataTable();

            A.Fill(DT);

            string[] TopData = Company.TopData();
            int[]    TopLs   = Company.GetDataLs(TopData);

            List <Company> CMPS = DT.Rows.Cast <DataRow>()
                                  .Select(R => new Company(R))
                                  .OrderByDescending(CMP => CMP.Users)
                                  .ToList();

            int[] MaxLs = TopLs;

            foreach (Company CMP in CMPS)
            {
                int[] Ls = CMP.GetLs();
                for (int i = 0; i < Ls.Length; i++)
                {
                    MaxLs[i] = Math.Max(Ls[i], MaxLs[i]);
                }
            }

            string Top = Company.TableRow(TopData, MaxLs);

            Console.WriteLine(Top);
            Console.WriteLine(new string('=', Top.Length));

            double AVGUserPrice  = (double)CMPS.Sum(CMP => CMP.UserPrice) / CMPS.Count;
            double AVGUsersCount = (double)CMPS.Sum(CMP => CMP.Users) / CMPS.Count;

            foreach (Company CMP in CMPS)
            {
                if (CMP.Users >= AVGUsersCount + 10)
                {
                    Console.ForegroundColor = ConsoleColor.Green;
                }
                else if (CMP.Users <= AVGUsersCount - 10)
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                }

                Console.WriteLine(Company.TableRow(CMP.GetData(), MaxLs).Replace("-1", "--").Replace("і", "и"));
            }

            Console.ForegroundColor = ConsoleColor.White;

            Console.WriteLine();
            Console.WriteLine("AVG USER PRICE: " + AVGUserPrice + "$");
            Console.WriteLine("AVG USERS COUNT: " + AVGUsersCount);

            C.Close();
            Console.ReadLine();
        }
 private void OnDestroy()
 {
     CMP.Dispose();
 }
 public void OnPrivacyManagerButtonClick()
 {
     CMP.LoadPrivacyManager(campaignType: this.campaignType,
                            privacyManagerId: this.pmId,
                            tab: this.privacyManagerTab);
 }
示例#26
0
 public void Load__preset_female_1()
 {
     CMP cmp = new CMP(Utility.GetFullPath(@"chunk0/stage/st407/common/preset/preset_female_1.cmp"));
 }
示例#27
0
 public void Load__preset_male_1()
 {
     CMP _ = new CMP(Utility.GetTestAsset(@"game/stage/st407/common/preset/preset_male_1.cmp"));
 }
示例#28
0
    // Use this for initialization
    void Start()
    {
        CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en-us");

        _gobManager = new GOBManager(GamePath, new[] { Path.Combine(GamePath, "Resource\\Res1hi.gob"), Path.Combine(GamePath, "Resource\\Res2.gob"), Path.Combine(GamePath, "Episode\\JK1.GOB") });

        _cmp  = new CMP();
        Atlas = new Texture2D(256, 256, TextureFormat.ARGB32, true);
        StandardMaterial.mainTexture = Atlas;

        if (!string.IsNullOrEmpty(JKLToLoad))
        {
            var jkl       = new JKL();
            var jklParser = new JKLParser(jkl, _gobManager.GetStream(@"jkl\" + JKLToLoad)); //new FileStream(@"Extracted\jkl\" + JKLToLoad, FileMode.Open));
            jklParser.Parse();

            _cmp.ParseCMP(_gobManager.GetStream(@"misc\cmp\" + jkl.WorldColorMaps[0]));
            LoadTextures(jkl.Materials.Take(jkl.ActualNumberOfMaterials).Select(m => m.Name).ToArray());
            BuildMapSectors(jkl);

            foreach (var thing in jkl.Things)
            {
                if (thing.Template.Parameters.ContainsKey("model3d"))
                {
                    var modelFilename = thing.Template.Parameters["model3d"];

                    _3DO       threedo;
                    GameObject thingGameObject;
                    if (_3DOCache.ContainsKey(modelFilename))
                    {
                        var threedoLoadResult = _3DOCache[modelFilename];
                        threedo         = threedoLoadResult.Threedo;
                        thingGameObject = Instantiate(threedoLoadResult.GameObject);
                    }
                    else
                    {
                        var threedoLoadResult = Load3DO(modelFilename);
                        threedo         = threedoLoadResult.Threedo;
                        thingGameObject = threedoLoadResult.GameObject;
                    }

                    thingGameObject.transform.position = new Vector3(thing.X * 10, thing.Z * 10, thing.Y * 10);
                    thingGameObject.transform.rotation = Quaternion.Euler(thing.Pitch, thing.Yaw, thing.Roll);

                    if (thing.Template.Parameters.ContainsKey("puppet"))
                    {
                        var puppetFilename = thing.Template.Parameters["puppet"];
                        var puppet         = PUPPETParser.Parse(_gobManager.GetStream(@"misc\pup\" + puppetFilename));
                        var kp             = new KEYParser();

                        if (puppet.Modes.ContainsKey(0) && puppet.Modes[0].ContainsKey("stand"))
                        {
                            var keyFilename = puppet.Modes[0]["stand"].KeyFile;
                            var animClip    = kp.Parse(threedo, thingGameObject.transform, keyFilename,
                                                       _gobManager.GetStream(@"3do\key\" + keyFilename));

                            var anim = thingGameObject.GetComponent <Animation>();
                            if (anim == null)
                            {
                                anim = thingGameObject.AddComponent <Animation>();
                                anim.AddClip(animClip, animClip.name);
                            }
                            anim.Play(animClip.name);
                        }
                    }
                }
            }
        }
    }