Inheritance: MonoBehaviour
Beispiel #1
0
        public CoolViewModel(UserInterface userInterface)
        {
            if (userInterface == null) throw new ArgumentNullException("userInterface");

            this.userInterface = userInterface;

            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            versioningModule = new AzzulVersioningModule(config);
            versioningModule.UserInterface.AppWebPage = "http://azzul.alez.ro";

            Initialize(() =>
            {
                AzzulVersion = versioningModule.Checker.CurrentVersion.ToString();
                CheckAtStartUp = versioningModule.CheckAtStartUp;
                NewVersionText = "No new version";
            });

            versioningModule.CheckAtStartUpChanged += HandleVersioningOptionsCheckAtStartUpChanged;
            versioningModule.Checker.CheckStarting += HandleVersionCheckerCheckStarting;
            versioningModule.Checker.CheckCompleted += HandleVersionCheckerCheckCompleted;

            CheckAzzulCommand = new RelayCommand(p => true, CheckAzzul);

            versioningModule.Start();
        }
 public CRUDController()
 {
     charRepo = new CharityRepository();
     pnRepo = new PartnershipNightRepository();
     uRepo = new UserRepository();
     lRepo = new BvLocationRepository();
 }
Beispiel #3
0
        public override void onClick(UserInterface.MouseEnum.MouseEnum mouseButton, Vector2 _MousePosition)
        {
            base.onClick(mouseButton, _MousePosition);

            float var_Value = _MousePosition.X - this.Bounds.X;
            this.value = var_Value;
        }
 void Awake()
 {
     if (instance == null)
         instance = this;
     else if(instance != this)
         Destroy (gameObject);
 }
Beispiel #5
0
        public void Evaluate(GameTime gameTime, Control focused, UserInterface ui)
        {
            var type = typeof(TouchDevice);

            for (int i = 0; i < _touches.Count; i++)
            {
                var t = _touches[i];
                Current = t;

                ui.FindControls(t.Position.FromXNA(), _buffer);
                _current.AddRange(_buffer);

                for (int j = 0; j < _buffer.Count; j++)
                {
                    _buffer[j].Gestures.Evaluate(gameTime, this);

                    if (_buffer[j].Gestures.BlockedDevices.Contains(type))
                        break;
                }

                ui.EvaluateGlobalGestures(gameTime, this);
                _blocked.Clear();
                _buffer.Clear();
            }

            foreach (var item in _cooled)
                item.HeatCount--;
            foreach (var item in _warmed)
                item.HeatCount++;

            _previous.Clear();
            _previous.AddRange(_current);
            _current.Clear();
        }
Beispiel #6
0
        public void Evaluate(GameTime gameTime, Control focused, UserInterface ui)
        {
            ui.FindControls(Position, _controls);

            foreach (var item in _cooled)
                item.HeatCount--;
            foreach (var item in _warmed)
                item.HeatCount++;

            var type = typeof(MouseDevice);

            for (int i = 0; i < _controls.Count; i++)
            {
                _controls[i].Gestures.Evaluate(gameTime, this);

                if (_controls[i].Gestures.BlockedDevices.Contains(type))
                    break;
            }

            ui.EvaluateGlobalGestures(gameTime, this);

            _previous.Clear();
            _previous.AddRange(_controls);
            _blocked.Clear();
            _controls.Clear();
        }
Beispiel #7
0
 // Use this for dependency injection
 public HomeController(UserInterface iUser, PartnershipNightInterface iPn, CharityInterface iChar, BvLocationInterface iLoc, FormInterface iForm)
 {
     uRepo = iUser;
     pnRepo = iPn;
     cRepo = iChar;
     lRepo = iLoc;
     fRepo = iForm;
 }
 // Use this for dependency injection
 public HomeController(UserInterface iUser, PartnershipNightInterface iPn, CharityInterface iChar, BvLocationInterface iLoc, StatsInfoInterface iStats)
 {
     uRepo = iUser;
     pnRepo = iPn;
     cRepo = iChar;
     lRepo = iLoc;
     sRepo = iStats;
 }
Beispiel #9
0
 // The default constructor is called by the framework
 public HomeController()
 {
     uRepo = new UserRepository();
     pnRepo = new PartnershipNightRepository();
     cRepo = new CharityRepository();
     lRepo = new BvLocationRepository();
     fRepo = new FormRepository();
 }
Beispiel #10
0
    public void Initialise(UserInterface userInterface)
    {
        UserInterface = userInterface;
        Connection = gameObject.AddComponent<Connection>();
        MessageHandler = new MessageHandler(Connection);
        Messenger = new Messenger(Connection);

        MessageHandler.OnAny += MessageHandler_OnMessage;
    }
 /// <summary>
 /// Writes the content of a stream to the user interface.
 /// </summary>
 /// <param name="ui">User interface where to write the stream content</param>
 /// <param name="reader">The stream to write</param>
 /// <param name="logLevel">The log level for the log messages</param>
 public static void LogStream(UserInterface ui, StreamReader reader, int logLevel)
 {
     string linea = reader.ReadLine();
     while (linea != null)
     {
         ui.log(linea, logLevel);
         linea = reader.ReadLine();
     }
 }
        public static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            var userInterface = new UserInterface();
            var commandHandler = new CommandHandler();
            var engine = new Engine(commandHandler, userInterface);

            engine.Run();
        }
Beispiel #13
0
        public void Add(UserInterface.Permanent.ViewModel viewModel)
        {
            if (viewModel.Card.IsAttached && viewModel.Card.Is().Attachment)
              {
            var insertAt = GetEnchantmentOrEquipmentPosition(viewModel.Card);
            _permanents.Insert(insertAt.Value, viewModel);
            return;
              }

              _permanents.Add(viewModel);
        }
Beispiel #14
0
 public override void onClick(UserInterface.MouseEnum.MouseEnum mouseButton, Vector2 _MousePosition)
 {
     base.onClick(mouseButton, _MousePosition);
     if (this.isChecked)
     {
         this.isChecked = false;
     }
     else
     {
         this.isChecked = true;
     }
 }
    // Use this for initialization
    void Start()
    {
        myGame = (Game)GameObject.Find ("Game").GetComponent<Game>();
        menuStyle = new GUIStyle ();
        menuStyle.fontSize = Mathf.RoundToInt (Screen.height * 0.05f);
        menuStyle.normal.textColor = Color.white;
        menuStyle.font = (Font)Resources.Load ("Fonts/After_Shok");
        ui = (UserInterface)GameObject.Find ("UserInterface").GetComponent<UserInterface>();
        playerObj = GameObject.Find ("Player");

        playerObj.GetComponent<MouseLook> ().enabled = false;
        Camera.mainCamera.GetComponent<MouseLook> ().enabled = false;
    }
Beispiel #16
0
 public List<SequenceTask.Task> GetTaskSequence(int userId, UserInterface ui)
 {
     List<int> list = userDict[userId];
     SequenceTask.Task task = null;
     List<SequenceTask.Task> tasks = new List<SequenceTask.Task>();
     foreach (int i in list)
     { 
         task = SequenceTask.Instance.TaskDict[i] as SequenceTask.Task;
         if (task.UserInterface == ui)
         {
             tasks.Add(task);
         }
     }
     return tasks;
 }
Beispiel #17
0
        public void Evaluate(GameTime gameTime, Control focused, UserInterface ui)
        {
            var type = typeof(KeyboardDevice);
            _charactersBlocked = false;

            for (var control = focused; control != null; control = control.Parent)
            {
                control.Gestures.Evaluate(gameTime, this);

                if (control.Gestures.BlockedDevices.Contains(type))
                    break;
            }

            ui.EvaluateGlobalGestures(gameTime, this);

            _blocked.Clear();
        }
Beispiel #18
0
        public void Add(UserInterface.Permanent.ViewModel viewModel)
        {
            Slot candidate;

              if (viewModel.Card.IsAttached && viewModel.Card.Is().Attachment)
              {
            candidate = _slots.First(slot => slot.ContainsAttachmentTarget(viewModel.Card));
              }
              else
              {
            candidate = _slots
              .Where(slot => slot.CanAdd(viewModel))
              .OrderBy(slot => slot.Count)
              .First();
              }

              candidate.Add(viewModel);
        }
        /// <summary>
        /// Builds the sections tree of the document.
        /// </summary>
        /// <param name="cutLevel">HTML Header level that will contain an entire HTML page</param>
        /// <param name="root">Root of the HTML document</param>
        /// <param name="ui">The application log. it can be null.</param>
        public void AnalizarDocumento( int cutLevel , IHTMLElement root , UserInterface ui)
        {
            // Reservar el primer nodo para el contenido que venga sin titulo1, (portada,etc).
            NodoArbol sinSeccion = new NodoArbol( this.Raiz , null , ui);
            this.Raiz.Hijos.Add( sinSeccion );

            // Analizar que nodos de headers se encuentran en el documento
            AnalizarDocumentoRecursivo( root , ui );

            // Por defecto, todos los nodos al documento por defecto. El resto
            // ya ira cogiendo el valor de su archivo:
            this.Raiz.StoredAt( "1.htm" );

            // Guardar en cada nodo en que archivo se habra guardado el nodo:
            int Cnt = 2;
            foreach( NodoArbol hijo in this.Raiz.Hijos )
                AsignarNombreArchivos(hijo, ref Cnt, cutLevel);
        }
Beispiel #20
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.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            TextureManager.LoadContents(Content);
            FontManager.LoadContents(Content);

            //initializing here because they are dependent on content managers
            background = new Background(Width, Height, TextureManager.GetTexture(TextureNames.BACKGROUND));

            world = WorldGenerator.Generate(WorldNumber.One);
            world.Add(new Player(PlayerNumber.One, new Vector2(200, 200)));
            world.Add(new Player(PlayerNumber.Two, new Vector2(100, 100)));

            ui = new UserInterface();

            mainMenu = new MainMenu();
        }
Beispiel #21
0
        public override void onClick(UserInterface.MouseEnum.MouseEnum mouseButton, Vector2 _MousePosition)
        {
            base.onClick(mouseButton, _MousePosition);
            if (this.lastSelected != null)
            {
                this.lastSelected.IsSelected = false;
                this.lastSelected = null;
            }

            //TODO: Texture / Background anpassen!
            foreach (Component var_Component in this.Components)
            {
                // VLL auch mit isPressed ;) da mouse event öfters als einmal abegefeuert wird usw...
                if (_MousePosition.X >= var_Component.Bounds.Left && _MousePosition.X <= var_Component.Bounds.Right && _MousePosition.Y >= var_Component.Bounds.Top && _MousePosition.Y <= var_Component.Bounds.Bottom)
                {
                    this.lastSelected = var_Component;
                }
            }
            if (this.lastSelected != null)
                this.lastSelected.IsSelected = true;
        }
Beispiel #22
0
        public bool Run(string imageFile)
        {
            Bitmap bitmap = (Bitmap)System.Drawing.Image.FromFile(imageFile);
            _userInterface = new UserInterface(BlockSize, _gameSize);
            _userInterface.RenderInitialBoard(bitmap);
            _state = new Point[4, 4];
            _emptySpace = new Point(3, 3);

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    _state[i, j] = new Point(i, j);
                }
            }

            _userInterface.Message("Randomizing...");

            Randomize();

            _userInterface.Message("Ready");

            while (true)
            {
                string input = _userInterface.GetUserInput();
                if (string.IsNullOrEmpty(input))
                    continue;
                if (input == "EXIT")
                    break;

                MoveTile(input);
                bool win = CheckForWinCondition();
                if (win)
                {
                    _userInterface.Message("You win!");
                    return true;
                }
            }
            return false;
        }
Beispiel #23
0
        /// <summary>
        /// Runs the game
        /// </summary>
        /// <param name="gameType">Selected gametype.</param>
        /// <param name="userInterface">Selected UI.</param>
        public void Run(Type gameType, UserInterface userInterface)
        {
            this.GameType = gameType;
            this.currentGame = (IGame)Activator.CreateInstance(this.GameType);

            switch (userInterface)
            {
                case UserInterface.Console:
                    this.drawHandler = new ConsoleUiDrawHandler();
                    break;
                default:
                    throw new ArgumentException("The selected user interface is not available.");
            }

            while (this.running)
            {
                switch (this.CurrentGame.GameState)
                {
                    case GameState.New:
                    case GameState.Over:
                        Initialize();
                        break;
                    case GameState.Running:
                        Update();
                        break;
                    case GameState.Win:
                        this.CurrentGame.SuccessfulEscape();
                        break;
                    case GameState.TopResults:
                        this.CurrentGame.TopResults();
                        break;
                    case GameState.Quit:
                        Console.WriteLine("Good bye!");
                        Environment.Exit(0);
                        break;
                }

                this.Draw();
            }
        }
Beispiel #24
0
        /// <summary>
        ///  In a nutshell, the program is made up of four major classes:
        ///
        ///  1. This Program class
        ///      It houses main; main's job is to drive the overall logic of the game
        ///
        ///  2. MarsLander
        ///      This stores the current height, speed, and fuel of the lander (properly encapsulated)
        ///      This also has an instance of the 'MarsLanderHistory' object, and the lander is
        ///      responsible for adding to the history whenever it calculates the lander's new speed
        ///
        ///  3. UserInterface
        ///      This handles ALL interactions with the user. 
        ///      NO OTHER CLASS IS ALLOWED TO INTERACT WITH THE USER!!
        ///
        ///  3. MarsLanderHistory
        ///      This manages an array of RoundInfo objects.  It will provide a method to add
        ///      another round to the history of the lander (and will resize the array, if needed)
        ///      It provides a Clone method so that the lander can return a copy of the 
        ///      history (which will prevent other classes from changing it's history)
        ///      And it provides a way to get the number of rounds, and (for each round) the
        ///      height and speed of that round (the UserInterface.PrintHistory method will use these)
        ///          (This class uses the provided, minor RoundInfo class)
        ///
        ///  Substantial amounts of this program have been commented out, so that the program will compile
        /// </summary>
        static void Main(string[] args)
        {
            UserInterface ui = new UserInterface();
            MarsLander lander = new MarsLander();

            const int MAX_SPEED = 10; // 10 m/s
                // const means that we can't change the value after this line

            ui.PrintGreeting();

            while (lander.GetCurrent().GetHeight() > 0)
            {
                ui.PrintLocation(lander);
                ui.PrintLanderInfo(lander);

                int fuelToBurn = ui.GetFuelToBurn(lander);

                lander.CalculateNewSpeed(fuelToBurn);
            }

            ui.PrintLocation(lander);
            ui.PrintLanderInfo(lander);
            ui.PrintEndOfGameResult(lander, MAX_SPEED);
        }
Beispiel #25
0
    public void init(string n, occupation o)
    {
        name = n;
        occ = o;
        selection = new ArrayList ();

        display = false;
        displayTradeMenu = false;

        myGame = GameObject.Find ("Game").GetComponent<Game> ();
        player = myGame.GetPlayerChar ();
        playerObj = GameObject.Find ("Player");

        menuStyle = new GUIStyle ();
        menuStyle.fontSize = Mathf.RoundToInt (Screen.height * 0.05f);
        menuStyle.normal.textColor = Color.white;
        menuStyle.font = (Font)Resources.Load ("Fonts/After_Shok");

        r = new Rect (0, 0, Screen.width, Screen.height * 0.5f);
        ui = GameObject.Find ("UserInterface").GetComponent<UserInterface> ();
        scrollPosition = Vector2.zero;

        SetNPC ();
    }
Beispiel #26
0
 /**
  * Sets the active user interface implementation. Passing <code>null</code>
  * silences printing completely.
  *
  * @param ui object to recieve all user interface calls
  */
 public static void set(UserInterface ui)
 {
     if (ui == null)
         ui = new SilentInterface();
     UI.ui = ui;
 }
Beispiel #27
0
        private void UpdateDisplay()
        {
            if (current_game != Setting.param.Kind ||
                current_quality != Setting.param.Quality ||
                current_resolution != Setting.param.Resolution)
            {
                // ------------------------------
                // Change mesh resolution
                // ------------------------------
                int div;
                switch (Setting.param.Quality)
                {
                case 1:
                    div = 30;
                    break;

                case 2:
                    div = 60;
                    break;

                case 3:
                default:
                    div = 90;
                    break;
                }
                double SamplingInterval = Math.PI / div;
                UpdateMeshResolution((short)(1 << Setting.param.Resolution), SamplingInterval);

                // ------------------------------
                // Create game rule
                // ------------------------------
                if (Setting.param.Kind == GameKind.GAMEKIND_OTHELLO)
                {
                    rule = new RuleOthello(pixelization);
                }
                else
                {
                    rule = new RuleIgo(pixelization);
                }
                Title = rule.GetName();

                // ------------------------------
                // Remove all pieces
                // ------------------------------
                PieceArray2D = new UIElement[rule.GetMaxIndex()];
                PieceArray3D = new Visual3D[rule.GetMaxIndex()];
                canvas_projection_piece.Children.Clear();
                PieceContainer.Children.Clear();

                TerritoryArray2D = new UIElement[rule.GetMaxIndex()];
                TerritoryArray3D = new Visual3D[rule.GetMaxIndex()];
                canvas_projection_territory.Children.Clear();
                TerritoryContainer.Children.Clear();

                // ------------------------------
                // Select UI panel
                // ------------------------------
#if false
                UserInterfaceArea.Children.Clear();
                if (Setting.param.Kind == GameKind.GAMEKIND_IGO)
                {
                    ConsoleIgo control = new ConsoleIgo();
                    UserInterfaceArea.Children.Add(control);
                    UserInterface = control;
                }
                else
                {
                    ConsoleOthello control = new ConsoleOthello();
                    UserInterfaceArea.Children.Add(control);
                    UserInterface = control;
                }
#else
                if (Setting.param.Kind == GameKind.GAMEKIND_IGO)
                {
                    UserInterface         = PanelIgo;
                    TabItemIgo.IsSelected = true;
                }
                else
                {
                    UserInterface             = PanelOthello;
                    TabItemOthello.IsSelected = true;
                }
#endif
                UserInterface.SetOnConfigurationsChanged(delegate(object sender, System.EventArgs e) { UpdateDisplay(); });
                UserInterface.SetGameRule(rule);

                // ------------------------------
                // Prepare initial piece arrangements
                // ------------------------------
                rule.SetPieceManipulator(ManipulatePiece);
                rule.SetInitialPieces();

                // ------------------------------
                // Remember current settings
                // ------------------------------
                current_resolution = Setting.param.Resolution;
                current_quality    = Setting.param.Quality;
                current_game       = Setting.param.Kind;
            }

            SphereMaterial.Brush = new SolidColorBrush(Setting.param.ForeColor);
            MapBase.Fill         = SphereMaterial.Brush;
        }
Beispiel #28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ui">Object to output the tidy messages. It can be null, and no messages will be written.</param>
 /// <param name="encoding">Tidy encoding name to read/write the output. See the tidy documentacion.
 /// If its null, the default encoding (ASCII?) will be used</param>
 public TidyParser(UserInterface ui, string encoding)
 {
     this.ui = ui;
     this.Encoding = encoding;
 }
 public FixedUIScrollbar(UserInterface userInterface)
 {
     this.userInterface = userInterface;
 }
 /// <summary>
 /// Create the rectangle with default styling.
 /// </summary>
 /// <param name="size">Rectangle size in pixels.</param>
 /// <param name="anchor">Position anchor.</param>
 /// <param name="offset">Offset from position anchor.</param>
 public ColoredRectangle(UserInterface ui, Vector2 size, Anchor anchor = Anchor.Auto, Vector2?offset = null) :
     base(ui, size, anchor, offset)
 {
     UpdateStyle(DefaultStyle);
 }
Beispiel #31
0
 /// <summary>
 /// Create the text input with default size.
 /// </summary>
 /// <param name="multiline">If true, text input will accept multiple lines.</param>
 /// <param name="anchor">Position anchor.</param>
 /// <param name="offset">Offset from anchor position.</param>
 public TextInput(UserInterface ui, bool multiline, Anchor anchor = Anchor.Auto, Vector2?offset = null) :
     this(ui, multiline, USE_DEFAULT_SIZE, anchor, offset)
 {
 }
Beispiel #32
0
 public FixedUIHorizontalScrollbar(UserInterface userInterface)
 {
     this.userInterface = userInterface;
 }
Beispiel #33
0
        public override void Load()
        {
            JoJoStandsSounds = ModLoader.GetMod("JoJoStandsSounds");        //would just return null if nothing is there
            SoundsLoaded     = JoJoStandsSounds != null;
            FanStandsLoaded  = ModLoader.GetMod("JoJoFanStands") != null;
            HamonBarState.hamonBarTexture                  = ModContent.GetTexture("JoJoStands/UI/HamonBar");
            ToBeContinued.TBCArrowTexture                  = ModContent.GetTexture("JoJoStands/UI/TBCArrow");
            BulletCounter.bulletCounterTexture             = ModContent.GetTexture("JoJoStands/UI/BulletCounter");
            AerosmithRadar.aerosmithRadarTexture           = ModContent.GetTexture("JoJoStands/UI/AerosmithRadar");
            GoldenSpinMeter.goldenRectangleTexture         = ModContent.GetTexture("JoJoStands/UI/GoldenSpinMeter");
            GoldenSpinMeter.goldenRectangleSpinLineTexture = ModContent.GetTexture("JoJoStands/UI/GoldenSpinMeterLine");
            SexPistolsUI.sexPistolsUITexture               = ModContent.GetTexture("JoJoStands/UI/SexPistolsUI");
            VoidBar.VoidBarTexture    = ModContent.GetTexture("JoJoStands/UI/VoidBar");
            VoidBar.VoidBarBarTexture = ModContent.GetTexture("JoJoStands/UI/VoidBarBar");
            MyPlayer.standTier1List.Add(ItemType("AerosmithT1"));
            MyPlayer.standTier1List.Add(ItemType("GoldExperienceT1"));
            MyPlayer.standTier1List.Add(ItemType("HierophantGreenT1"));
            MyPlayer.standTier1List.Add(ItemType("KillerQueenT1"));
            MyPlayer.standTier1List.Add(ItemType("KingCrimsonT1"));
            MyPlayer.standTier1List.Add(ItemType("MagiciansRedT1"));
            MyPlayer.standTier1List.Add(ItemType("SexPistolsT1"));
            MyPlayer.standTier1List.Add(ItemType("StarPlatinumT1"));
            MyPlayer.standTier1List.Add(ItemType("StickyFingersT1"));
            MyPlayer.standTier1List.Add(ItemType("TheWorldT1"));
            MyPlayer.standTier1List.Add(ItemType("TuskAct1"));
            MyPlayer.standTier1List.Add(ItemType("LockT1"));
            MyPlayer.standTier1List.Add(ItemType("GratefulDeadT1"));
            MyPlayer.standTier1List.Add(ItemType("TheHandT1"));
            MyPlayer.standTier1List.Add(ItemType("WhitesnakeT1"));
            MyPlayer.standTier1List.Add(ItemType("DollyDaggerT1"));
            MyPlayer.standTier1List.Add(ItemType("CenturyBoyT1"));
            MyPlayer.standTier1List.Add(ItemType("SilverChariotT1"));
            MyPlayer.standTier1List.Add(ItemType("HermitPurpleT1"));
            MyPlayer.standTier1List.Add(ItemType("BadCompanyT1"));
            MyPlayer.standTier1List.Add(ItemType("CreamT1"));

            MyPlayer.stopImmune.Add(ProjectileType("TheWorldStandT2"));     //only the timestop capable stands as people shouldn't switch anyway
            MyPlayer.stopImmune.Add(ProjectileType("TheWorldStandT3"));
            MyPlayer.stopImmune.Add(ProjectileType("TheWorldStandFinal"));
            MyPlayer.stopImmune.Add(ProjectileType("StarPlatinumStandFinal"));
            //MyPlayer.stopImmune.Add(ProjectileType("StickyFingersFistExtended"));
            MyPlayer.stopImmune.Add(ProjectileType("RoadRoller"));
            MyPlayer.stopImmune.Add(ProjectileType("HamonPunches"));
            MyPlayer.stopImmune.Add(ProjectileType("Fists"));
            MyPlayer.stopImmune.Add(ProjectileType("GoldExperienceRequiemStand"));
            MyPlayer.stopImmune.Add(ProjectileType("TuskAct4Minion"));


            // Registers a new hotkey
            SpecialHotKey       = RegisterHotKey("Special Ability", "P");  // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v%3dxnagamestudio.41) for special keys
            SecondSpecialHotKey = RegisterHotKey("Secondary Special Ability", "H");
            StandOut            = RegisterHotKey("Stand Out", "G");
            PoseHotKey          = RegisterHotKey("Pose", "V");
            StandAutoMode       = RegisterHotKey("Stand Auto Mode", "L");

            if (!Main.dedServ)      //Manages resource loading cause the server isn't able to load resources
            {
                //UI Stuff
                HamonBarInterface = new HamonBarState();
                HamonBarInterface.Activate();
                _hamonbarInterface = new UserInterface();
                _hamonbarInterface.SetState(HamonBarInterface);
                TBCarrow = new ToBeContinued();
                TBCarrow.Activate();
                _tbcarrow = new UserInterface();
                _tbcarrow.SetState(TBCarrow);
                bulletCounter = new BulletCounter();
                bulletCounter.Activate();
                _bulletcounter = new UserInterface();
                _bulletcounter.SetState(bulletCounter);
                aerosmithRadar = new AerosmithRadar();
                aerosmithRadar.Activate();
                _aerosmithRadar = new UserInterface();
                _aerosmithRadar.SetState(aerosmithRadar);
                betUI = new BetUI();
                betUI.Activate();
                _betUI = new UserInterface();
                _betUI.SetState(betUI);
                GoldenSpinInterface = new GoldenSpinMeter();
                GoldenSpinInterface.Activate();
                _goldenSpinInterface = new UserInterface();
                sexPistolsUI         = new SexPistolsUI();
                sexPistolsUI.Activate();
                _sexPistolsUI = new UserInterface();
                _sexPistolsUI.SetState(sexPistolsUI);
                _goldenSpinInterface.SetState(GoldenSpinInterface);
                VoidBarUI = new VoidBar();
                VoidBarUI.Activate();
                _voidbarUI = new UserInterface();
                _voidbarUI.SetState(VoidBarUI);
                HamonSkillTreeUI = new HamonSkillTree();
                HamonSkillTreeUI.Activate();
                _hamonSkillTreeUI = new UserInterface();
                _hamonSkillTreeUI.SetState(HamonSkillTreeUI);
                UnitsUI = new BadCompanyUnitsUI();
                UnitsUI.Activate();
                _unitsUI = new UserInterface();
                _unitsUI.SetState(UnitsUI);

                //Shader Stuff
                Ref <Effect> timestopShader = new Ref <Effect>(GetEffect("Effects/TimestopEffect"));      // The path to the compiled shader file.
                Filters.Scene["TimestopEffectShader"] = new Filter(new ScreenShaderData(timestopShader, "TimestopEffectShader"), EffectPriority.VeryHigh);
                Filters.Scene["TimestopEffectShader"].Load();
                Ref <Effect> greyscaleShader = new Ref <Effect>(GetEffect("Effects/Greyscale"));
                Filters.Scene["GreyscaleEffect"] = new Filter(new ScreenShaderData(greyscaleShader, "GreyscaleEffect"), EffectPriority.VeryHigh);
                Filters.Scene["GreyscaleEffect"].Load();
                Ref <Effect> greenShader = new Ref <Effect>(GetEffect("Effects/GreenEffect"));
                Filters.Scene["GreenEffect"] = new Filter(new ScreenShaderData(greenShader, "GreenEffect"), EffectPriority.VeryHigh);
                Filters.Scene["GreenEffect"].Load();
                Ref <Effect> redShader = new Ref <Effect>(GetEffect("Effects/RedEffect"));
                Filters.Scene["RedEffect"] = new Filter(new ScreenShaderData(redShader, "RedEffect"), EffectPriority.VeryHigh);
                Filters.Scene["RedEffect"].Load();
                Ref <Effect> colorChangeShader = new Ref <Effect>(GetEffect("Effects/ColorChangeEffect"));
                Filters.Scene["ColorChangeEffect"] = new Filter(new ScreenShaderData(colorChangeShader, "ColorChangeEffect"), EffectPriority.VeryHigh);
                Filters.Scene["ColorChangeEffect"].Load();
                Ref <Effect> voidGradientShader = new Ref <Effect>(GetEffect("Effects/VoidBarGradient"));
                GameShaders.Misc["JoJoStandsVoidGradient"] = new MiscShaderData(voidGradientShader, "VoidBarGradient");

                //Misc
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/VMMusic"), ItemType("ViralMusicBox"), TileType("ViralMusicBoxTile"));
            }
        }
Beispiel #34
0
 private void Start()
 {
     _ui       = UserInterface.instance;
     _player   = GameObject.Find("Player").GetComponent <PlayerInteraction>();
     _isPaused = false;
 }
Beispiel #35
0
        public override void Load()
        {
            //Shaders
            if (!Main.dedServ)
            {
                GameShaders.Misc["StarlightRiver:Distort"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/Distort")), "Distort");

                Ref <Effect> screenRef4 = new Ref <Effect>(GetEffect("Effects/Shockwave"));
                Terraria.Graphics.Effects.Filters.Scene["ShockwaveFilter"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef4, "ShockwavePass"), Terraria.Graphics.Effects.EffectPriority.VeryHigh);
                Terraria.Graphics.Effects.Filters.Scene["ShockwaveFilter"].Load();

                Ref <Effect> screenRef3 = new Ref <Effect>(GetEffect("Effects/WaterEffect"));
                Terraria.Graphics.Effects.Filters.Scene["WaterFilter"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef3, "WaterPass"), Terraria.Graphics.Effects.EffectPriority.VeryHigh);
                Terraria.Graphics.Effects.Filters.Scene["WaterFilter"].Load();

                Ref <Effect> screenRef2 = new Ref <Effect>(GetEffect("Effects/AuraEffect"));
                Terraria.Graphics.Effects.Filters.Scene["AuraFilter"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef2, "AuraPass"), Terraria.Graphics.Effects.EffectPriority.VeryHigh);
                Terraria.Graphics.Effects.Filters.Scene["AuraFilter"].Load();

                Ref <Effect> screenRef = new Ref <Effect>(GetEffect("Effects/BlurEffect"));
                Terraria.Graphics.Effects.Filters.Scene["BlurFilter"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef, "BlurPass"), Terraria.Graphics.Effects.EffectPriority.High);
                Terraria.Graphics.Effects.Filters.Scene["BlurFilter"].Load();

                Ref <Effect> screenRef5 = new Ref <Effect>(GetEffect("Effects/Purity"));
                Terraria.Graphics.Effects.Filters.Scene["PurityFilter"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef5, "PurityPass"), Terraria.Graphics.Effects.EffectPriority.High);
                Terraria.Graphics.Effects.Filters.Scene["PurityFilter"].Load();

                Ref <Effect> screenRef6 = new Ref <Effect>(GetEffect("Effects/LightShader"));
                Terraria.Graphics.Effects.Filters.Scene["Lighting"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef6, "LightingPass"), Terraria.Graphics.Effects.EffectPriority.High);
                Terraria.Graphics.Effects.Filters.Scene["Lighting"].Load();

                Ref <Effect> screenRef7 = new Ref <Effect>(GetEffect("Effects/LightApplicator"));
                Terraria.Graphics.Effects.Filters.Scene["LightingApply"] = new Terraria.Graphics.Effects.Filter(new ScreenShaderData(screenRef7, "LightingApplyPass"), Terraria.Graphics.Effects.EffectPriority.High);
                Terraria.Graphics.Effects.Filters.Scene["LightingApply"].Load();
            }

            //Autoload Rift Recipes
            RiftRecipes = new List <RiftRecipe>();
            AutoloadRiftRecipes(RiftRecipes);

            //Hotkeys
            Dash      = RegisterHotKey("Forbidden Winds", "LeftShift");
            Wisp      = RegisterHotKey("Faeflame", "F");
            Purify    = RegisterHotKey("[PH]Purify Crown", "N");
            Smash     = RegisterHotKey("Gaia's Fist", "Z");
            Superdash = RegisterHotKey("Zzelera's Cloak", "Q");

            //UI
            if (!Main.dedServ)
            {
                StaminaUserInterface      = new UserInterface();
                CollectionUserInterface   = new UserInterface();
                OverlayUserInterface      = new UserInterface();
                InfusionUserInterface     = new UserInterface();
                CookingUserInterface      = new UserInterface();
                KeyInventoryUserInterface = new UserInterface();
                TextCardUserInterface     = new UserInterface();
                CodexUserInterface        = new UserInterface();
                CodexPopupUserInterface   = new UserInterface();
                LootUserInterface         = new UserInterface();
                ChatboxUserInterface      = new UserInterface();
                ExtraNPCInterface         = new UserInterface();

                stamina      = new Stamina();
                collection   = new Collection();
                overlay      = new Overlay();
                infusion     = new Infusion();
                cooking      = new Cooking();
                keyinventory = new KeyInventory();
                textcard     = new TextCard();
                codex        = new GUI.Codex();
                codexpopup   = new CodexPopup();
                lootUI       = new LootUI();
                Chatbox      = new ChatboxOverUI();

                StaminaUserInterface.SetState(stamina);
                CollectionUserInterface.SetState(collection);
                OverlayUserInterface.SetState(overlay);
                InfusionUserInterface.SetState(infusion);
                CookingUserInterface.SetState(cooking);
                KeyInventoryUserInterface.SetState(keyinventory);
                TextCardUserInterface.SetState(textcard);
                CodexUserInterface.SetState(codex);
                CodexPopupUserInterface.SetState(codexpopup);
                LootUserInterface.SetState(lootUI);
                ChatboxUserInterface.SetState(Chatbox);
            }

            //particle systems
            if (!Main.dedServ)
            {
                LoadVitricBGSystems();
            }

            //Hooking
            HookOn();
            HookIL();
        }
Beispiel #36
0
        public override void LoadContent()
        {
            base.LoadContent();

            previousInterface = UserInterface.Active;

            // Our interface
            optionInterface = new UserInterface();
            // Set our interface as the Active
            UserInterface.Active = optionInterface;

            // Sizes
            Vector2 mainPanelSize    = new Vector2(Viewport.Width, Viewport.Height);
            Vector2 optionsPanelSize = new Vector2(Viewport.Width / 1.2f, Viewport.Height / 1.2f);

            // Buttons
            Button loadButton, saveButton, backButton, confirmButton;

            // Sliders
            Slider fxSlider, musicSlider;

            //Labels
            Label fxPercentage, musicPercentage;

            // Main Panels
            Panel mainPanel = new Panel(mainPanelSize, PanelSkin.None, Anchor.Auto);
            // our options panel
            Panel optionsPanel = new Panel(optionsPanelSize, PanelSkin.Default, Anchor.Center);

            optionsPanel.AddChild(new Header("Options", Anchor.TopCenter));
            optionsPanel.AddChild(new HorizontalLine());
            // a width of 0 means take parent full width size
            Panel masterVolPanel = new Panel(new Vector2(0, 50), PanelSkin.None, Anchor.Auto);

            // Declare our master volume controls
            masterVolPanel.AddChild(new Label("Master Volume", Anchor.AutoInline, size: new Vector2(0.4f, -1)));
            Slider masterVolSlider = new Slider(0, 100, new Vector2(250, -1), SliderSkin.Default, Anchor.AutoInline)
            {
                Value = GameSettings.MasterVolume
            };
            Label masterPercentage = new Label(GameSettings.MasterVolume.ToString() + "%", Anchor.AutoInline, new Vector2(0.2f, -1))
            {
                SpaceBefore = new Vector2(30, 0)
            };

            // Event to grab our slider value and set it to our GameSettings.
            masterVolSlider.OnValueChange = (Entity ent) =>
            {
                GameSettings.MasterVolume = masterVolSlider.Value;
                masterPercentage.Text     = GameSettings.MasterVolume.ToString() + "%";
            };

            masterVolPanel.AddChild(masterVolSlider);
            masterVolPanel.AddChild(masterPercentage);
            optionsPanel.AddChild(masterVolPanel);

            // music vol panel
            Panel musicVolPanel = new Panel(new Vector2(0, 50), PanelSkin.None, Anchor.Auto);

            musicVolPanel.AddChild(new Label("Music Volume", Anchor.AutoInline, size: new Vector2(0.4f, -1)));
            musicVolPanel.AddChild(musicSlider = new Slider(0, 100, new Vector2(250, -1), SliderSkin.Default, Anchor.AutoInline)
            {
                Value = GameSettings.MusicVolume
            });
            musicVolPanel.AddChild(musicPercentage = new Label(GameSettings.MusicVolume.ToString() + "%", Anchor.AutoInline, new Vector2(0.2f, -1))
            {
                SpaceBefore = new Vector2(30, 0)
            });

            musicSlider.OnValueChange = (Entity ent) =>
            {
                GameSettings.MusicVolume = musicSlider.Value;
                musicPercentage.Text     = GameSettings.MusicVolume.ToString() + "%";
            };


            optionsPanel.AddChild(musicVolPanel);

            // master effect panel
            Panel masterEffectPanel = new Panel(new Vector2(0, 50), PanelSkin.None, Anchor.Auto);

            masterEffectPanel.AddChild(new Label("Effects Volume", Anchor.AutoInline, size: new Vector2(0.4f, -1)));
            masterEffectPanel.AddChild(fxSlider = new Slider(0, 100, new Vector2(250, -1), SliderSkin.Default, Anchor.AutoInline)
            {
                Value = GameSettings.EffectsVolume
            });
            masterEffectPanel.AddChild(fxPercentage = new Label(GameSettings.EffectsVolume.ToString() + "%", Anchor.AutoInline, new Vector2(0.2f, -1))
            {
                SpaceBefore = new Vector2(30, 0)
            });

            fxSlider.OnValueChange = (Entity ent) =>
            {
                GameSettings.EffectsVolume = fxSlider.Value;
                fxPercentage.Text          = GameSettings.EffectsVolume.ToString() + "%";
            };


            optionsPanel.AddChild(masterEffectPanel);

            //load & save config panel
            Panel configPanel = new Panel(new Vector2(0, 50), PanelSkin.None, Anchor.Auto);

            configPanel.AddChild(new Header("Configuration", Anchor.TopCenter));
            configPanel.AddChild(new HorizontalLine());
            configPanel.AddChild(loadButton = new Button("Load config", size: new Vector2(0.5f, -1)));
            configPanel.AddChild(saveButton = new Button("Save config", ButtonSkin.Default, Anchor.AutoInline, size: new Vector2(0.5f, -1)));
            optionsPanel.AddChild(configPanel);
            optionsPanel.AddChild(backButton = new Button("Back", ButtonSkin.Default, Anchor.BottomCenter));
            mainPanel.AddChild(optionsPanel);
            UserInterface.Active.AddEntity(mainPanel);

            //load/save button events
            loadButton.OnClick = (Entity ent) =>
            {
                GameSettings.Read();
                musicSlider.Value     = GameSettings.MusicVolume;
                fxSlider.Value        = GameSettings.EffectsVolume;
                masterVolSlider.Value = GameSettings.MasterVolume;
            };

            saveButton.OnClick = (Entity ent) =>
            {
                ConfirmOverwrite();
            };

            backButton.OnClick = (Entity ent) =>
            {
                ScreenManager.LoadScreen(new MainMenuScreen(Game));
            };

            void ConfirmOverwrite() // broken out into separate function because can't nest Entities
            {
                configPanel.RemoveChild(saveButton);
                configPanel.AddChild(confirmButton = new Button("Click to overwrite", ButtonSkin.Default, Anchor.AutoInline, size: new Vector2(0.5f, -1)));
                confirmButton.OnClick = (Entity ent) =>
                {
                    GameSettings.Write();
                    configPanel.RemoveChild(confirmButton);
                    configPanel.AddChild(saveButton);
                };
            }
        }
Beispiel #37
0
        public override void Load()
        {
            IL.Terraria.Player.Update += Player_Update;

            Instance = this;
            Instance.Logger.Info("Another Rpg Mod " + Version + " Correctly loaded");
            JsonSkillTree.Init();
            JsonCharacterClass.Init();
            LoadedMods[SupportedMod.Thorium]  = ModLoader.GetMod("ThoriumMod") != null;
            LoadedMods[SupportedMod.Calamity] = ModLoader.GetMod("CalamityMod") != null;
            LoadedMods[SupportedMod.DBZMOD]   = ModLoader.GetMod("DBZMOD") != null;

            StatsHotKey     = RegisterHotKey("Open Stats Menu", "C");
            SkillTreeHotKey = RegisterHotKey("Open SkillTree", "X");
            ItemTreeHotKey  = RegisterHotKey("Open Item Tree", "V");
            if (!Main.dedServ)
            {
                customNPCInfo           = new UserInterface();
                NPCInfo                 = new ReworkMouseOver();
                ReworkMouseOver.visible = true;
                customNPCInfo.SetState(NPCInfo);

                customNPCName     = new UserInterface();
                NPCName           = new NPCNameUI();
                NPCNameUI.visible = true;
                customNPCName.SetState(NPCName);

                customResources   = new UserInterface();
                healthBar         = new HealthBar();
                HealthBar.visible = true;
                customResources.SetState(healthBar);

                customstats   = new UserInterface();
                statMenu      = new Stats();
                Stats.visible = false;
                customstats.SetState(statMenu);

                customOpenstats         = new UserInterface();
                openStatMenu            = new OpenStatsButton();
                OpenStatsButton.visible = true;
                customOpenstats.SetState(openStatMenu);

                customOpenST         = new UserInterface();
                OpenST               = new OpenSTButton();
                OpenSTButton.visible = true;
                customOpenST.SetState(OpenST);

                customSkillTree         = new UserInterface();
                skillTreeUI             = new SkillTreeUi();
                OpenStatsButton.visible = true;
                customSkillTree.SetState(skillTreeUI);

                customItemTree     = new UserInterface();
                ItemTreeUI         = new ItemTreeUi();
                ItemTreeUi.visible = false;
                customItemTree.SetState(ItemTreeUI);

                /*
                 *
                 * statMenu = new Stats();
                 * Stats.visible = true;
                 * customstats.SetState(statMenu);
                 */
            }
        }
Beispiel #38
0
 public override void Unload()
 {
     instance        = null;
     KhaiosInterface = null;
 }
 public void Initialize(UserInterface userInterface, ContainmentVessel containmentVessel)
 {
     _userInterface     = userInterface;
     _containmentVessel = containmentVessel;
 }
Beispiel #40
0
 public virtual Task <DraughtsMove> NextMove(DraughtsState state, List <DraughtsMove> allowedMoves)
 {
     return(UserInterface.ShowSelectionMove(state, this, allowedMoves));
 }
Beispiel #41
0
 public AuthorManager(UserInterface ui, IAuthorDao authorDao) : base(ui)
 {
     _authorDao = authorDao;
 }
Beispiel #42
0
 public void Init(UserInterface ui, ContainmentVessel cv)
 {
     this.ui = ui;
     this.cv = cv;
 }
Beispiel #43
0
        static void Main(string[] args)
        {
            Button startCancelButton = new Button();
            Button powerButton       = new Button();
            Button timeButton        = new Button();

            Door door = new Door();

            Output output = new Output();

            Display display = new Display(output);

            PowerTube powerTube = new PowerTube(output);

            Light light = new Light(output);

            Microwave.Classes.Boundary.Timer timer = new Timer();

            ICookController cooker = new CookController(timer, display, powerTube);

            IUserInterface ui = new UserInterface(powerButton, timeButton, startCancelButton, door, display, light, cooker);

            // Finish the double association
            cooker.UI = ui;

            // Simulate a simple sequence


            System.Console.WriteLine("Tryk på O");
            bool run = true;

            while (run)
            {
                string input;
                input = Console.ReadLine().ToString().ToLower();

                switch (input[0])
                {
                case 'o':
                    door.Open();
                    Console.WriteLine("\r\nTryk C");
                    break;

                case 'c':
                    door.Close();
                    Console.WriteLine("\r\nTryk P");
                    break;

                case 'p':
                    powerButton.Press();
                    Console.WriteLine("\r\nTryk P igen for mere tid eller T");
                    break;

                case 't':
                    timeButton.Press();
                    Console.WriteLine("\r\nTryk T igen for mere tid eller S");
                    break;

                case 's':
                    startCancelButton.Press();
                    break;
                }
            }


            //door.Open();

            //door.Close();

            //powerButton.Press();

            //timeButton.Press();

            //startCancelButton.Press();

            // The simple sequence should now run

            System.Console.WriteLine("When you press enter, the program will stop");
            // Wait for input

            System.Console.ReadLine();
        }
Beispiel #44
0
 protected override void Dispose(bool disposing)
 {
     ServiceRegistry.Unregister <UltimaGame>();
     UserInterface.Dispose();
     base.Dispose(disposing);
 }
Beispiel #45
0
 /// <summary>
 /// Create default single-line text input.
 /// </summary>
 public TextInput(UserInterface ui) : this(ui, false)
 {
 }
Beispiel #46
0
 public InvisibleFixedUIHorizontalScrollbar(UserInterface userInterface) : base(userInterface)
 {
 }
 /// <summary>
 /// Create default colored rectangle.
 /// </summary>
 public ColoredRectangle(UserInterface ui) : this(ui, Color.White)
 {
 }
 public MiscellaneousUI(UserInterface userInterface)
 {
     this.userInterface = userInterface;
 }
Beispiel #49
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ui">Object to output the tidy messages. It can be null, and no messages will be written.</param>
 /// <param name="xmlOutput">True if the output should be written with XHTML format</param>
 public TidyParser(UserInterface ui, bool xmlOutput)
 {
     this.ui = ui;
     this.XmlOutput = xmlOutput;
 }
Beispiel #50
0
        public override void Load()
        {
            instance = this;

            // Adds boss head textures for the Abomination boss
            for (int k = 1; k <= 4; k++)
            {
                AddBossHeadTexture(captiveElementHead + k);
                AddBossHeadTexture(captiveElement2Head + k);
            }

            // Registers a new hotkey
            RandomBuffHotKey = RegisterHotKey("Random Buff", "P");

            // Registers a new custom currency
            FaceCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ItemType <Items.Face>(), 999L));

            // All code below runs only if we're not loading on a server
            if (!Main.dedServ)
            {
                // Add certain equip textures
                AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs");
                AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head");
                AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms");
                AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs");

                // Change the vanilla dungeon track
                // Main.music[MusicID.Dungeon] = GetMusic("Sounds/Music/DriveMusic");

                // Register a new music box
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DriveMusic"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox"));

                // Change the vanilla loom texture
                Main.instance.LoadTiles(TileID.Loom);                             // First load the tile texture
                Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // Now we change it

                //What if....Replace a vanilla item texture and equip texture.
                //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item");
                //Item copperHelmet = new Item();
                //copperHelmet.SetDefaults(ItemID.CopperHelmet);
                //Main.armorHeadLoaded[copperHelmet.headSlot] = true;
                //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head");

                // Create new skies and screen filters
                Filters.Scene["ExampleMod:PuritySpirit"]       = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh);
                SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky();
                Filters.Scene["ExampleMod:MonolithVoid"]       = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium);
                SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky();
                // exampleFont = GetFont("Fonts/ExampleFont");
                exampleEffect = GetEffect("Effects/ExampleEffect");
                Ref <Effect> exampleEffectRef = new Ref <Effect>();
                exampleEffectRef.Value = exampleEffect;
                GameShaders.Armor.BindShader <ArmorShaderData>(ItemType <Items.ExampleDye>(), new ArmorShaderData(exampleEffectRef, "ExampleDyePass"));

                GameShaders.Misc["ExampleMod:DeathAnimation"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffectDeath")), "DeathAnimation").UseImage("Images/Misc/Perlin");

                // Custom UI
                exampleUI = new ExampleUI();
                exampleUI.Activate();
                exampleUserInterface = new UserInterface();
                exampleUserInterface.SetState(exampleUI);

                // UserInterface can only show 1 UIState at a time. If you want different "pages" for a UI, switch between UIStates on the same UserInterface instance.
                // We want both the Coin counter and the Example Person UI to be independent and coexist simultaneously, so we have them each in their own UserInterface.
                examplePersonUserInterface = new UserInterface();
                // We will call .SetState later in ExamplePerson.OnChatButtonClicked
            }

            // Register custom mod translations, lives left is for Spirit of Purity
            ModTranslation text = CreateTranslation("LivesLeft");

            text.SetDefault("{0} has {1} lives left!");
            AddTranslation(text);
            text = CreateTranslation("LifeLeft");
            text.SetDefault("{0} has 1 life left!");
            AddTranslation(text);
            text = CreateTranslation("NPCTalk");
            text.SetDefault("<{0}> {1}");
            AddTranslation(text);

            // Volcano warning is for the random volcano tremor
            text = CreateTranslation("VolcanoWarning");
            text.SetDefault("Did you hear something....A Volcano! Find Cover!");
            AddTranslation(text);
        }
Beispiel #51
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ui">Object to output the tidy messages. It can be null, and no messages will be written.</param>
 public TidyParser(UserInterface ui)
 {
     this.ui = ui;
     this.XmlOutput = false;
 }
Beispiel #52
0
        public override void Load()
        {
            // Will show up in client.log under the ExampleMod name
            Logger.InfoFormat("{0} example logging", Name);
            // In older tModLoader versions we used: ErrorLogger.Log("blabla");
            // Replace that with above

            // Registers a new hotkey
            RandomBuffHotKey = RegisterHotKey("Random Buff", "P");             // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v%3dxnagamestudio.41) for special keys

            // Registers a new custom currency
            FaceCustomCurrencyId = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ModContent.ItemType <Items.Face>(), 999L));

            Mundane.AddHacks();

            // All code below runs only if we're not loading on a server
            if (!Main.dedServ)
            {
                // Add certain equip textures
                AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs");
                AddEquipTexture(new Items.Armor.BlockyHead(), null, EquipType.Head, "BlockyHead", "ExampleMod/Items/Armor/ExampleCostume_Head");
                AddEquipTexture(new Items.Armor.BlockyBody(), null, EquipType.Body, "BlockyBody", "ExampleMod/Items/Armor/ExampleCostume_Body", "ExampleMod/Items/Armor/ExampleCostume_Arms");
                AddEquipTexture(new Items.Armor.BlockyLegs(), null, EquipType.Legs, "BlockyLeg", "ExampleMod/Items/Armor/ExampleCostume_Legs");

                // Register a new music box
                AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/MarbleGallery"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox"));

                // Change the vanilla loom texture
                Main.instance.LoadTiles(TileID.Loom);                             // First load the tile texture
                Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom"); // Now we change it

                //What if....Replace a vanilla item texture and equip texture.
                //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item");
                //Item copperHelmet = new Item();
                //copperHelmet.SetDefaults(ItemID.CopperHelmet);
                //Main.armorHeadLoaded[copperHelmet.headSlot] = true;
                //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head");

                // Create new skies and screen filters
                Filters.Scene["ExampleMod:PuritySpirit"]       = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh);
                SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky();
                Filters.Scene["ExampleMod:MonolithVoid"]       = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium);
                SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky();
                GameShaders.Armor.BindShader(ModContent.ItemType <Items.ExampleDye>(), new ArmorShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffect")), "ExampleDyePass"));
                GameShaders.Hair.BindShader(ModContent.ItemType <Items.ExampleHairDye>(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Green));
                GameShaders.Misc["ExampleMod:DeathAnimation"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/ExampleEffectDeath")), "DeathAnimation").UseImage("Images/Misc/Perlin");

                if (FontExists("Fonts/ExampleFont"))
                {
                    exampleFont = GetFont("Fonts/ExampleFont");
                }

                // Custom UI
                ExampleUI = new ExampleUI();
                ExampleUI.Activate();
                _exampleUserInterface = new UserInterface();
                _exampleUserInterface.SetState(ExampleUI);

                // UserInterface can only show 1 UIState at a time. If you want different "pages" for a UI, switch between UIStates on the same UserInterface instance.
                // We want both the Coin counter and the Example Person UI to be independent and coexist simultaneously, so we have them each in their own UserInterface.
                ExamplePersonUserInterface = new UserInterface();
                // We will call .SetState later in ExamplePerson.OnChatButtonClicked
            }

            // Register custom mod translations, lives left is for Spirit of Purity
            // See the .lang files in the Localization folder for an easier to manage approach to translations. These few examples are here just to illustrate the concept.
            ModTranslation text = CreateTranslation("LivesLeft");

            text.SetDefault("{0} has {1} lives left!");
            AddTranslation(text);
            text = CreateTranslation("LifeLeft");
            text.SetDefault("{0} has 1 life left!");
            AddTranslation(text);
            text = CreateTranslation("NPCTalk");
            text.SetDefault("<{0}> {1}");
            AddTranslation(text);
            text = CreateTranslation("Common.LocalizedLabelDynamic");
            text.SetDefault($"[i:{ModContent.ItemType<Items.Weapons.SpectreGun>()}]  This dynamic label is added in ExampleMod.Load");
            AddTranslation(text);

            // Volcano warning is for the random volcano tremor
            text = CreateTranslation("VolcanoWarning");
            text.SetDefault("Did you hear something....A Volcano! Find Cover!");
            AddTranslation(text);
        }
 public LoadingProgressViewModel(UserInterface userInterface, IEventAggregator eventAggregator, ILoggerFacade loggerFacade) : base(eventAggregator, loggerFacade)
 {
     Title = "Loading";
 }
Beispiel #54
0
 static void Main(string[] args)
 {
     UserInterface app = new UserInterface();
 }
Beispiel #55
0
 public DustUI(UserInterface userInterface)
 {
     this.userInterface = userInterface;
 }
Beispiel #56
0
    void Awake()
    {
        // check if we have any old Landmarks instances from LoadScene.cs and handle them
        GameObject oldInstance = GameObject.Find("OldInstance");

        if (oldInstance != null)
        {
            foreach (var item in oldInstance.transform)
            {
                //Destroy(item); // this tends to break the steamvr skeleton buttons and hand rendermodels
                oldInstance.SetActive(false);
            }
        }

        Debug.Log("Starting Experiment.cs");

        //since config is a singleton it will be the one created in scene 0 or this scene
        config = Config.instance;

        // ------------------------------------------
        // Grab the Landmarks items that are not controller dependent
        // ------------------------------------------
        tasks          = GameObject.Find("LM_Timeline").GetComponent <TaskList>();
        overheadCamera = GameObject.Find("OverheadCamera").GetComponent <Camera>();
        // Assign the scaled player if it's in the scene, otherwise instantiate to avoid errors
        scaledPlayer = GameObject.Find("SmallScalePlayerController");
        // find Environment
        environment = GameObject.FindGameObjectWithTag("Environment");
        // find scaled environment
        if (GameObject.FindGameObjectsWithTag("ScaledEnvironment") != null)
        {
            scaledEnvironment = GameObject.FindGameObjectWithTag("ScaledEnvironment");
            scaledEnvironment.SetActive(false);
        }


        if (PlayerPrefs.GetString("UserInterface") != "default")
        {
            Debug.Log("Getting user interface from config file.");

            switch (config.ui)
            {
            case "Desktop":
                userInterface = UserInterface.DesktopDefault;
                break;

            case "Vive Virt.":
                userInterface = UserInterface.ViveAndVirtualizer;
                break;

            case "Vive Std.":
                userInterface = UserInterface.ViveRoomspace;
                break;

            default:
                break;
            }
        }

        // ------------------------------------------
        // Assign Player and Camera based on UI enum
        // ------------------------------------------


        switch (userInterface)
        {
        case UserInterface.DesktopDefault:
            // Standard Desktop with Keyboard/mouse controller
            player       = GameObject.Find("DesktopDefaultController");
            playerCamera = GameObject.Find("DesktopDefaultCamera").GetComponent <Camera>();

            // Render the overhead camera on the main display (none)
            overheadCamera.stereoTargetEye = StereoTargetEyeMask.None;

            // create variable to indicate if using VR
            usingVR = false;

            break;

        case UserInterface.ViveRoomspace:

            // HTC Vive and Cyberith Virtualizer
            player       = GameObject.Find("ViveRoomspaceController");
            playerCamera = GameObject.Find("VRCamera").GetComponent <Camera>();

            // Render the overhead camera to each lense of the HMD
            overheadCamera.stereoTargetEye = StereoTargetEyeMask.Both;

            // create variable to indicate if using VR
            usingVR = true;

            break;

        case UserInterface.ViveAndVirtualizer:

            // This is a proprietary asset that must be added to the _Landmarks_ prefab to work
            // If it is not added (either for lack of need or lack of the proprietary SDK), use the default
            if (GameObject.Find("ViveVirtualizerController") == null)
            {
                Debug.Log("UserInterface player controller not found. Falling back to Default");
                goto default;
            }

            // HTC Vive and Cyberith Virtualizer
            player       = GameObject.Find("ViveVirtualizerController");
            playerCamera = GameObject.Find("ViveVirtualizerCamera").GetComponent <Camera>();

            // Render the overhead camera to each lense of the HMD
            overheadCamera.stereoTargetEye = StereoTargetEyeMask.Both;

            // create variable to indicate if using VR
            usingVR = true;

            break;

        default:
            // Standard Desktop with Keyboard/mouse controller
            player       = GameObject.Find("DesktopDefaultController");
            playerCamera = GameObject.Find("DesktopDefaultCamera").GetComponent <Camera>();

            // Render the overhead camera on the main display (none)
            overheadCamera.stereoTargetEye = StereoTargetEyeMask.None;

            // create variable to indicate if using VR
            usingVR = false;

            break;
        }

        Debug.Log(player.name);
        // Tag the selected playerController
        player.tag = "Player";
        // Deactivate all other controllers
        foreach (Transform child in GameObject.Find("PlayerControllers").transform)
        {
            if (child.name != player.name)
            {
                child.gameObject.SetActive(false);
            }
        }

        // Add audiolistener to camera (default one should be removed on on all LM_playerControllers)
        // This ensures there will only be one in the scene, attached to the active camera
        playerCamera.gameObject.AddComponent <AudioListener>();

        // Set up Overhead Camera (for map task or any other top-down viewed tasks)
        overheadCamera = GameObject.Find("OverheadCamera").GetComponent <Camera> ();

        // ------------------------------------------
        // Configure Player properties
        // ------------------------------------------

        playerCamera.enabled   = true;
        overheadCamera.enabled = false;
        Cursor.visible         = false;


        // Set the avatar and hud
        avatar = player;
        hud    = avatar.GetComponent("HUD") as HUD;
        hud.showOnlyHUD();


        // ------------------------------------------
        // Handle the config file
        // ------------------------------------------
        logfile    = config.subjectPath + "/" + PlayerPrefs.GetString("expID") + "_" + config.subject + "_" + config.level + ".log";
        configfile = config.expPath + "/" + config.filename;

        //when in editor
        if (!config.bootstrapped)
        {
            if (!Directory.Exists(Directory.GetCurrentDirectory() + "/data/tmp/"))
            {
                Directory.CreateDirectory(Directory.GetCurrentDirectory() + "/data/tmp/");
            }
            logfile    = Directory.GetCurrentDirectory() + "/data/tmp/" + "test.log";
            configfile = Directory.GetCurrentDirectory() + "/data/tmp/" + config.filename;

            PlayerPrefs.SetString("expID", "TEST");
        }

        if (config.runMode == ConfigRunMode.NEW)
        {
            dblog = new dbLog(logfile);
        }
        else if (config.runMode == ConfigRunMode.RESUME)
        {
            dblog = new dbPlaybackLog(logfile);
        }
        else if (config.runMode == ConfigRunMode.PLAYBACK)
        {
            CharacterController c = avatar.GetComponent <CharacterController>();
            c.detectCollisions = false;
            dblog = new dbPlaybackLog(logfile);
        }

        //start session

        dblog.log("EXPERIMENT:\t" + PlayerPrefs.GetString("expID") + "\tSUBJECT:\t" + config.subject +
                  "\tSTART_SCENE\t" + config.level + "\tSTART_CONDITION:\t" + config.condition + "\tUI:\t" + userInterface.ToString(), 1);

        Debug.Log(XRSettings.loadedDeviceName);
    }
Beispiel #57
0
        static void Main(string[] args)
        {
            Batch batch = new Batch("Greenwich Bank");

            UserInterface.EnterNumberOfCustomer();

            int    option;
            string customerId;

            UserInterface.ShowBatchInfo(batch);
            UserInterface.ShowMenuControl();
            do
            {
                option = UserInterface.EnterOption();
                switch (option)
                {
                case 1:    //enter a list customer
                    int numberOfCustomer = UserInterface.EnterNumberOfCustomer();
                    UserInterface.EnterListCustomer();
                    for (int i = 0; i < numberOfCustomer; i++)
                    {
                        batch.AddCustomer(new Customer(
                                              UserInterface.EnterCustomerId(),
                                              UserInterface.EnterCustomerFullName(),
                                              UserInterface.EnterCustomerBalance()
                                              ));
                    }

                    break;

                case 2:      //add
                    batch.AddCustomer(new Customer(
                                          UserInterface.EnterCustomerId(),
                                          UserInterface.EnterCustomerFullName(),
                                          UserInterface.EnterCustomerBalance())
                                      );
                    UserInterface.ShowBatchInfo(batch);
                    break;

                case 3:      //find
                    customerId = UserInterface.EnterCustomerId();
                    if (batch.FindCustomerById(customerId) != null)
                    {
                        UserInterface.ShowCustomerInfo(batch.FindCustomerById(customerId));
                    }
                    else
                    {
                        UserInterface.NotFound();
                    }
                    break;

                case 4:       //edit balance
                    customerId = UserInterface.EnterCustomerId();
                    if (batch.FindCustomerById(customerId) == null)
                    {
                        UserInterface.NotFound();
                    }
                    else
                    {
                        string customerName    = UserInterface.EnterCustomerFullName();
                        double customerBalance = UserInterface.EnterCustomerBalance();
                        batch.EditCustomerById(customerId, customerName, customerBalance);
                        UserInterface.Done();
                    }
                    break;

                case 5:     //show all customer info
                    UserInterface.ShowAllCustomerInfo();
                    UserInterface.ShowBatch(batch);
                    break;

                case 6:     //exit
                    UserInterface.ExitProgram(option);
                    break;

                default:
                    UserInterface.EnterOptionAgain();
                    break;
                }
            } while (option != 6);

            Console.ReadLine();
        }
Beispiel #58
0
 void InitializeUI()
 {
     SoftColor = UserInterface.SoftColor;
     UserInterface.SetFlatButtonColor(btnSelectProduct, SoftColor);
     UserInterface.SetFlatButtonColor(btnAddStock, SoftColor);
 }
Beispiel #59
0
        public void Evaluate(GameTime gameTime, Control focused, UserInterface ui)
        {
            if (!currentState.IsConnected)
                return;

            var type = typeof(GamepadDevice);
            for (var control = focused; control != null; control = control.Parent)
            {
                control.Gestures.Evaluate(gameTime, this);

                if (control.Gestures.BlockedDevices.Contains(type))
                    break;
            }

            ui.EvaluateGlobalGestures(gameTime, this, blocked);

            blocked.Clear();
        }
Beispiel #60
0
 void Start()
 {
     instance = this;
 }