コード例 #1
0
        private static bool Prefix(MenuManager.BriefingPageType type, UIElement __instance)
        {
            if (type != MenuManager.BriefingPageType.Briefing ||
                GameplayManager.Level.Mission.FileName != "VeryClassicMission")
            {
                return(true);
            }
            VeryClassic.Update();

            var c = Color.white; // HSBColor.ConvertToColor(0f, 0f, 0.75f);

            /*
             * Vector2 pos;
             * pos.y = 100f;
             * pos.x = -620f;
             * string text = "hello";
             * __instance.DrawStringSmall(text, pos, 0.9f, StringOffset.LEFT, c, 1f, 1240f);
             */

            //UIManager.SetOverlayAntiAlias(false);
            UIManager.PauseMainDrawing();
            UIManager.StartDrawing(UIManager.url[1], true, 750f);
            UIManager.DrawTileFull(new Vector2(0, 0), 400f, 300f, c, 1f); // 360 270
            UIManager.ResumeMainDrawing();
            return(false);
        }
コード例 #2
0
 private static bool Prefix(MenuManager.BriefingPageType type)
 {
     if (type != MenuManager.BriefingPageType.Briefing ||
         GameplayManager.Level.Mission.FileName != "VeryClassicMission")
     {
         return(true);
     }
     if (MenuManager.m_menu_sub_state == MenuSubState.INIT)
     {
         MenuManager.m_briefing_page_num = 0;
         MenuManager.m_briefing_text     = new [] { "VeryClassic" };
         var scene = (GameObject)Resources.Load("Cutscenes/cutscene_black");
         MenuManager.m_cutscene_go = UnityEngine.Object.Instantiate <GameObject>(scene, Vector3.up * 50f, Quaternion.identity);
         //var post = Camera.main.gameObject.GetComponent<UnityEngine.PostProcessing.PostProcessingBehaviour>();
         //if (post)
         //    post.enabled = false;
         UIManager.ShowCinematicBars(false, false);
         UIManager.SetOverlayAntiAlias(false);
         UIManager.CreateUIElement(UIManager.SCREEN_CENTER, 7000, UIElementType.BRIEFING);
         VeryClassic.Init(MenuManager.m_cutscene_go);
         //UIManager.url[0].SetTexture(VeryClassic.m_main_texture, true);
         UIManager.SetTexture(VeryClassic.m_main_texture);
         GameManager.m_audio.PlayMusic("", 0.4f);
         MenuManager.m_menu_sub_state = MenuSubState.ACTIVE;
     }
     if (VeryClassic.IsDone)
     {
         VeryClassic.Done();
     }
     return(false);
 }
コード例 #3
0
        public static void Update()
        {
            if (IsDone)
            {
                return;
            }

            /*
             * for (int i = 0; i < 320 * 200; i++)
             * {
             *  m_screen_data[i * 4] = 0;
             *  m_screen_data[i * 4 + 1] = 255;
             *  m_screen_data[i * 4 + 2] = 0;
             *  m_screen_data[i * 4 + 3] = 255;
             * }
             * for (int i = 0; i < 200; i++)
             *  m_screen_data[(i * 320 + (i + shift) % 320) * 4] = 255;
             * shift++;
             */

            Controls.MouseAimCache();
            Player pl = GameManager.m_local_player;

            pl.ClearCachedInput();
            pl.UpdateCachedButtons();
            pl.CacheButtons(Controls.m_input_count);
            //if (Controls.m_input_count[(int)CCInput.TURN_LEFT] != 0)
            //    Debug.Log("turn left: " + Controls.m_input_count[(int)CCInput.TURN_LEFT]);
            pl.c_player_ship.FixedUpdateReadCachedControls();
            uint buttons = pl.EncodePlayerButtonPresses();

            /*
             * if (buttons != 0 && buttons != 21845)
             *  Debug.Log("buttons: " + buttons);
             * if (pl.cc_mouse_raw != Vector2.zero)
             *  Debug.Log("mouse: " + pl.cc_mouse_raw);
             * if (pl.cc_turn_vec != Vector3.zero)
             *  Debug.Log("turn: " + pl.cc_turn_vec);
             * if (pl.cc_move_vec != Vector3.zero)
             *  Debug.Log("move: " + pl.cc_move_vec);
             */
            VeryClassic.VeryClassicSetControls(buttons,
                                               pl.cc_mouse_raw.x, pl.cc_mouse_raw.y,
                                               pl.cc_turn_vec.x, pl.cc_turn_vec.y, pl.cc_turn_vec.z,
                                               pl.cc_move_vec.x, pl.cc_move_vec.y, pl.cc_move_vec.z,
                                               Controls.m_input_count[(int)CCInput.VIEW_MAP],
                                               Controls.m_input_count[(int)CCInput.REAR_VIEW]);

            if (VeryClassicFrame(0, 0, play) == -1)
            {
                IsDone = true;
            }
            m_main_texture.LoadRawTextureData(m_screen_data);
            m_main_texture.Apply();
            if (sndbuf == null)
            {
                LoadSounds();
            }
        }
コード例 #4
0
 private void OnApplicationFocus(bool focus)
 {
     if (focus)
     {
         VeryClassic.VeryClassicKeyFlush();
         GameManager.MaybeLockCursor();
     }
 }
コード例 #5
0
 void OnGUI()
 {
     if (Event.current.isKey)
     {
         if (Event.current.type == EventType.KeyDown && Event.current.keyCode != 0)
         {
             //Debug.Log("key down " + Event.current.keyCode);
             VeryClassic.VeryClassicKey((int)Event.current.keyCode, 1);
         }
         if (Event.current.type == EventType.KeyUp && Event.current.keyCode != 0)
         {
             //Debug.Log("key up " + Event.current.keyCode);
             VeryClassic.VeryClassicKey((int)Event.current.keyCode, 0);
         }
     }
 }