Example #1
0
 public static void Save(JointManager jointManager)
 {
     if (!_actionHappened && KeyboardExtended.Current.WasSingleClick(Keys.S))
     {
         _actionHappened = true;
         FileManager.Save(FileManager.GetFileName(Globals.CurrentShownNumber, Globals.CurrentFolder),
                          jointManager.ToFile());
     }
 }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _mouseCursor             = new MouseCursor();
            _lineManager             = new LineManager(_mouseCursor);
            _jointManager            = new JointManager(_mouseCursor, _lineManager);
            _markingRectangleManager = new MarkingRectangleManager(_mouseCursor, _jointManager);

            _sfFont = Content.Load <SpriteFont>("SF");

            _background = ColorManager.GetColorFromHex(ConfigurationManager.AppSettings["BackgroundColor"]);
            _foreground = ColorManager.GetColorFromHex(ConfigurationManager.AppSettings["ForegroundColor"]);
        }
Example #3
0
        public static void RefreshFiles(JointManager joinManager)
        {
            if (_actionHappened)
            {
                _actionHappened = false;
                Globals.Files   = FileManager.LoadAllFiles(Globals.CurrentFolder);
                if (!Globals.Files.ContainsKey(Globals.CurrentShownNumber))
                {
                    Globals.CurrentShownNumber = 1;
                }

                if (Globals.Files.ContainsKey(Globals.CurrentShownNumber))
                {
                    var file = Globals.Files[Globals.CurrentShownNumber];
                    joinManager.FromFile(file);
                }
            }
        }
Example #4
0
 private void Awake()
 {
     scene = SceneManager.GetActiveScene();
     //only run if Internal tools scene
     if (scene.name.Equals("Internal_Tools", StringComparison.Ordinal) == true)
     {
         //check if instance already exists
         if (i == null)
         {
             i = this;
         }
         //if instance already exists and it's not this
         else if (i != this)
         {
             //Then destroy this in order to reinforce the singleton pattern (can only ever be one instance of toolManager)
             Destroy(gameObject);
         }
         //components
         adventureScript  = GetComponent <AdventureManager>();
         actorScript      = GetComponent <ActorPoolManager>();
         toolDataScript   = GetComponent <ToolDataManager>();
         toolFileScript   = GetComponent <ToolFileManager>();
         toolInputScript  = GetComponent <ToolInput>();
         toolDetailScript = GetComponent <ToolDetails>();
         jointScript      = GetComponent <JointManager>();
         actorFileScript  = GetComponent <ActorFileManager>();
         //gui
         adventureUIScript = AdventureUI.Instance();
         actorPoolUIScript = ActorPoolUI.Instance();
         toolUIScript      = ToolUI.Instance();
         //error Check
         Debug.Assert(adventureScript != null, "Invalid adventureScript (Null)");
         Debug.Assert(actorScript != null, "Invalid actorScript (Null)");
         Debug.Assert(toolDataScript != null, "Invalid toolDataScript (Null)");
         Debug.Assert(adventureUIScript != null, "Invalid adventureUIScript (Null)");
         Debug.Assert(actorPoolUIScript != null, "Invalid actorPoolUIScript (Null)");
         Debug.Assert(toolUIScript != null, "Invalid toolUIScript (Null)");
         Debug.Assert(toolInputScript != null, "Invalid toolInputScript (Null)");
         Debug.Assert(toolDetailScript != null, "Invalid toolDetailScript (Null)");
         Debug.Assert(jointScript != null, "Invalid loadScript (Null)");
         Debug.Assert(actorFileScript != null, "Invalid actorFileScript (Null)");
     }
 }