Exemplo n.º 1
0
    void Start()
    {
        state = STATE_SPLASH;

        FutileParams fparams = new FutileParams(true, true, false, false); //landscape left, right, portrait, portraitUpsideDown

        fparams.AddResolutionLevel(1024.0f, 1.0f, 1.0f, "");               //max width, displayScale, resourceScale, resourceSuffix

        fparams.backgroundColor = RXUtils.GetColorFromHex("555555");
        fparams.origin          = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/lake_monster2");
        Futile.atlasManager.LogAllElementNames();

        MetaContainer.loadFont("Arial-Black", 120, "arial_black_120", "Atlases/arial_black_120", 0f, 0f);
        MetaContainer.loadFont("BrushScriptStd", 16, "BrushScriptStd_64", "Atlases/BrushScriptStd_64", 4f, -12f);

        ScreenManager.init(this, "");

        splash = new GameScreen("greetings_lochness_cleanup");
        splash.buttons["start"].SignalRelease += handleLevels;
        ScreenManager.loadScreen(splash, ScreenSourceDirection.Instant);
    }
        private void Init(IColorPreset colorPreset)
        {
            Color = colorPreset.DarkBackground;

            menuHolder = CreateChild <MenuHolder>("menu", 0);
            {
                menuHolder.Anchor   = AnchorType.TopStretch;
                menuHolder.Pivot    = PivotType.Top;
                menuHolder.RawWidth = 0f;
                menuHolder.Y        = 0f;
                menuHolder.Height   = 56f;
            }
            versionDisplay = CreateChild <VersionDisplay>("version", 1);
            {
                versionDisplay.Anchor   = AnchorType.TopStretch;
                versionDisplay.Pivot    = PivotType.Top;
                versionDisplay.RawWidth = 0f;
                versionDisplay.Y        = -56f;
                versionDisplay.Height   = 72f;
            }
            contentScroll = CreateChild <UguiScrollView>("content", 2);
            {
                contentScroll.Anchor = AnchorType.Fill;
                contentScroll.Offset = new Offset(0f, 128f, 0f, 0f);

                contentScroll.Background.Alpha = 0f;

                metaContainer = contentScroll.Container.CreateChild <MetaContainer>("meta");
                {
                    metaContainer.Anchor = AnchorType.TopStretch;
                    metaContainer.Pivot  = PivotType.Top;
                    metaContainer.Y      = -32f;
                    metaContainer.Height = 360f;
                    metaContainer.SetOffsetHorizontal(64f);
                }
                rankingContainer = contentScroll.Container.CreateChild <RankingContainer>("ranking");
                {
                    rankingContainer.Anchor = AnchorType.TopStretch;
                    rankingContainer.Pivot  = PivotType.Top;
                    rankingContainer.Y      = -424f;
                    rankingContainer.Height = 360f;
                    rankingContainer.SetOffsetHorizontal(64f);
                }
                actionsContainer = contentScroll.Container.CreateChild <ActionsContainer>("actions");
                {
                    actionsContainer.Anchor = AnchorType.TopStretch;
                    actionsContainer.Pivot  = PivotType.Top;
                    actionsContainer.Y      = -816f;
                    actionsContainer.Height = 48f;
                    actionsContainer.SetOffsetHorizontal(64f);
                }

                // Calculate height of the scrollview content.
                contentScroll.Container.Height = GetContentHeight();
            }
        }
Exemplo n.º 3
0
        private IEnumerator Init()
        {
            string testMapId = "2e8a9917-2970-437b-bc51-ca9d4bcdd670";

            // Load a test map
            Debug.Log("Loading map");
            var listener = new TaskListener <IMapset>();

            MapManager.Load(new Guid(testMapId), listener);
            yield return(testGame.AwaitProgress(listener));

            Assert.AreEqual(1, MapManager.AllMapsets.Count);
            Assert.AreEqual(testMapId, MapManager.AllMapsets[0].Id.ToString());

            // Create meta container display.
            metaContainer        = RootMain.CreateChild <MetaContainer>();
            metaContainer.Width  = 1152f;
            metaContainer.Height = 360f;
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string name_cf   = "1Cv8_Test_export.cf";
            string folder_cf = "D:\\work\\awa15-metaread-e7fe7d987355\\awa15-metaread-e7fe7d987355\\1C";

            ConfigStorage Storage = new ConfigStorageCFFile(folder_cf + "\\" + name_cf);

            // var Container = new MetaContainer(Storage);

            Form1.log.Info($"Добавляем все гуиды внутренних файлов...");
            if (((ConfigStorageCFFile)Storage).Cat.Files != null)
            {
                foreach (var item_v8 in ((ConfigStorageCFFile)Storage).Cat.Files)
                {
                    treeConfig.Nodes[0].Nodes.Add(item_v8.Key);
                    Form1.log.Info($"Добавили в дерево...{item_v8.Key}");
                }
            }

            Form1.log.Info($"Закончили добавление всех гуидов внутренних файлов...");

            var Container = new MetaContainer(Storage);


            #region Old_Code
            //              //MetaBase metaBase = new MetaBase("Справочник", "Reference");
            //              //Text = metaBase.GetName(true);
            //
            //              V8Header_Struct v8Header_Struct = new V8Header_Struct();
            //
            //              v8Header_Struct.Time_Create = new DateTime(2018, 5, 9, 10, 10, 10);
            //              v8Header_Struct.Time_Modify = new DateTime(2018, 5, 10, 10, 10, 10);
            //              v8Header_Struct.Zero = 999;
            //
            //              // создаем объект BinaryFormatter
            //              //BinaryFormatter formatter = new BinaryFormatter();
            //
            //              // получаем поток, куда будем записывать сериализованный объект
            //              //using (FileStream fs = new FileStream("D:\\work\\git_MetaRead\\bin\\Debug\\test.dat", FileMode.OpenOrCreate))
            //              //{
            //              //    formatter.Serialize(fs, v8Header_Struct);
            //
            //              //Console.WriteLine("Объект сериализован");
            //              //}
            //
            //              using (FileStream fs = new FileStream("D:\\work\\git_MetaRead\\bin\\Debug\\test.dat", FileMode.OpenOrCreate))
            //              {
            //                  using (BinaryReader reader = new BinaryReader(fs, Encoding.ASCII))
            //                  {
            //                      long tc = reader.ReadInt64();
            //                      long tm = reader.ReadInt64();
            //
            //                      DateTime dateTime_tc = DateTime.FromBinary(tc);
            //                      DateTime dateTime_tm = DateTime.FromBinary(tm);
            //
            //                      int zero = reader.ReadInt32();
            //
            //                  }
            //                  //using (BinaryWriter writer = new BinaryWriter(fs,Encoding.ASCII))
            //                  //{
            //                  //    // записываем в файл значение каждого поля структуры
            //                  //    long tc = v8Header_Struct.Time_Create.ToBinary();
            //                  //    long tm = v8Header_Struct.Time_Modify.ToBinary();
            //                  //    writer.Write(tc);
            //                  //    writer.Write(tm);
            //                  //    writer.Write(v8Header_Struct.Zero);
            //
            //                  //}
            //              }
            //
            //              textBox1.Text += ("Новая текстовая строка"+Environment.NewLine);
            //              // Example usage
            //              Logger logger = LogManager.GetLogger("Example");
            //              logger.Trace("trace log message");
            //              logger.Debug("debug log message");
            //              logger.Info("info log message");
            //              logger.Warn("warn log message");
            //              logger.Error("error log message");
            //              logger.Fatal("fatal log message");
            #endregion
        }