public void RegisterPawnActions(
            Dispatcher dispatch,
            CombatantActions actions
            )
        {
            DebugLogConsole.AddCommand(
                command: "Hurt",
                description: "Apply damage to a Combatant",
                method: (string id, int amount, Vector3 push) => {
                dispatch(actions.Hurt(pawnID: Guid.Parse(id), amount: amount, push: push));
            }
                );

            DebugLogConsole.AddCommand(
                command: "Heal",
                description: "Heal a Combatant",
                method: (string id, int amount) => {
                dispatch(actions.Heal(pawnID: Guid.Parse(id), amount: amount));
            }
                );

            DebugLogConsole.AddCommand(
                command: "Launch",
                description: "Launch a Combatant",
                method: (string id, Vector3 push) => {
                dispatch(actions.Launch(Guid.Parse(id), push));
            }
                );
        }
Пример #2
0
        void SetupConsoleCommands()
        {
            string GetDescription(string property)
            {
                var attribute = typeof(GlobalSettings).GetProperty(property).GetCustomAttribute <DescriptionAttribute>();

                return(attribute.Description);
            }

            DebugLogConsole.AddCommand("tor_blaster_automatic_reload", GetDescription("BlasterAutomaticReload"), (bool enabled) => blasterAutomaticReload = BlasterAutomaticReload = enabled);
            DebugLogConsole.AddCommand("tor_blaster_require_refill", GetDescription("BlasterRequireRefill"), (bool enabled) => blasterRequireRefill       = BlasterRequireRefill = enabled);
            DebugLogConsole.AddCommand("tor_blaster_scope_resolution", GetDescription("BlasterScopeResolution"), (int x, int y) => blasterScopeResolution = BlasterScopeResolution = new int[] { x, y });
            DebugLogConsole.AddCommand("tor_controls_hold_duration", GetDescription("ControlsHoldDuration"), (float duration) => controlsHoldDuration     = ControlsHoldDuration = duration);
            DebugLogConsole.AddCommand("tor_saber_activate_on_recall", GetDescription("SaberActivateOnRecall"), (bool enabled) => saberActivateOnRecall   = SaberActivateOnRecall = enabled);
            DebugLogConsole.AddCommand("tor_saber_deactivate_on_drop", GetDescription("SaberDeactivateOnDrop"), (bool enabled) => saberDeactivateOnDrop   = SaberDeactivateOnDrop = enabled);
            DebugLogConsole.AddCommand("tor_saber_deactivate_on_drop_delay", GetDescription("SaberDeactivateOnDropDelay"), (float delay) => saberDeactivateOnDropDelay = SaberDeactivateOnDropDelay = delay);
            DebugLogConsole.AddCommand("tor_saber_deflect_assist", GetDescription("SaberDeflectAssist"), (bool enabled) => saberDeflectAssist = SaberDeflectAssist = enabled);
            DebugLogConsole.AddCommand("tor_saber_deflect_assist_distance", GetDescription("SaberDeflectAssistDistance"), (float distance) => saberDeflectAssistDistance            = SaberDeflectAssistDistance = distance);
            DebugLogConsole.AddCommand("tor_saber_deflect_assist_always_return", GetDescription("SaberDeflectAssistAlwaysReturn"), (bool enabled) => saberDeflectAssistAlwaysReturn = SaberDeflectAssistAlwaysReturn = enabled);
            DebugLogConsole.AddCommand("tor_saber_expensive_collisions", GetDescription("SaberExpensiveCollisions"), (bool enabled) => saberExpensiveCollisions = SaberExpensiveCollisions = enabled);
            DebugLogConsole.AddCommand("tor_saber_expensive_collisions_min_velocity", GetDescription("SaberExpensiveCollisionsMinVelocity"), (float velocity) => saberExpensiveCollisionsMinVelocity = SaberExpensiveCollisionsMinVelocity = velocity);
            DebugLogConsole.AddCommand("tor_saber_npc_attack_speed", GetDescription("SaberNPCAttackSpeed"), (float speed) => saberNPCAttackSpeed         = SaberNPCAttackSpeed = speed);
            DebugLogConsole.AddCommand("tor_saber_npc_recoil_on_parry", GetDescription("SaberNPCRecoilOnParry"), (bool enabled) => saberNPCRecoilOnParry = SaberNPCRecoilOnParry = enabled);
            DebugLogConsole.AddCommand("tor_saber_throw", GetDescription("SaberThrowable"), (bool enabled) => saberThrowable = SaberThrowable = enabled);
            DebugLogConsole.AddCommand("tor_saber_throw_min_velocity", GetDescription("SaberThrowMinVelocity"), (float velocity) => saberThrowMinVelocity = SaberThrowMinVelocity = velocity);
            DebugLogConsole.AddCommand("tor_saber_trail", GetDescription("SaberTrailEnabled"), (bool enabled) => saberTrailEnabled = SaberTrailEnabled = enabled);
            DebugLogConsole.AddCommand("tor_saber_trail_duration", GetDescription("SaberTrailDuration"), (float duration) => saberTrailDuration           = SaberTrailDuration = duration);
            DebugLogConsole.AddCommand("tor_saber_trail_min_velocity", GetDescription("SaberTrailMinVelocity"), (float velocity) => saberTrailMinVelocity = SaberTrailMinVelocity = velocity);
            DebugLogConsole.AddCommand("tor_use_legacy_helmets", GetDescription("UseLegacyHelmets"), (bool enabled) => useLegacyHelmets = UseLegacyHelmets = enabled);
        }
    // Command field input is changed, check if command is submitted
    public char OnValidateCommand(string text, int charIndex, char addedChar)
    {
        // If command is submitted
        if (addedChar == '\n')
        {
            // Clear the command field
            if (clearCommandAfterExecution)
            {
                commandInputField.text = "";
            }

            if (text.Length > 0)
            {
                // Execute the command
                DebugLogConsole.ExecuteCommand(text);

                // Snap to bottom and select the latest entry
                OnSnapToBottomChanged(true);

                if (indicesOfListEntriesToShow.Count > 0)
                {
                    OnLogClicked(indicesOfListEntriesToShow.Count - 1);
                }
            }

            return('\0');
        }

        return(addedChar);
    }
        public void RegisterBoardActions(
            Dispatcher dispatch,
            GetState getState,
            BoardActions actions
            )
        {
            DebugLogConsole.AddCommand(
                command: "AddPawn",
                description: "Adds a new Pawn to the Board",
                method: (string prefabKey, string displayName, float cameraWeight) => {
                dispatch(actions.AddPawn(prefabKey, displayName, cameraWeight, GetMousePosition()));
            }
                );

            DebugLogConsole.AddCommand(
                command: "AddCombatant",
                description: "Adds a Combatant Pawn to the Board",
                method: (string prefabKey, int health, string displayName, float cameraWeight) => {
                dispatch(actions.AddCombatant(prefabKey, health, displayName, cameraWeight, GetMousePosition()));
            }
                );

            DebugLogConsole.AddCommand(
                command: "RemovePawn",
                description: "Removes a pawn from the board",
                method: (string id) => { dispatch(actions.RemovePawn(Guid.Parse(id))); }
                );
        }
Пример #5
0
    void Start()
    {
        DebugLogConsole.AddCommandInstance("cube", "Creates a cube at [0 2.5 0]", "CreateCubeAt", this);

        DebugLogConsole.AddCommandInstance("server", "Call NetworkManager.singleton.StartServer", "StartServer", this);

        DebugLogConsole.AddCommandInstance("client", "Call NetworkManager.singletone.StartClient", "StartClient", this);
    }
Пример #6
0
 void Start()
 {
     //_apiChangeUnityEventManager.AddListener(InitializeBuildingsAndRoads);
     DebugLogConsole.AddCommand <string>("neighbourhood.remove", "Destroys a neighbourhood", RemoveNeighbourhood);
     DebugLogConsole.AddCommand <string>("building.remove", "Destroys a building", RemoveBuilding);
     DebugLogConsole.AddCommand <string>("neighbourhood.search", "Search a neighbourhood", SearchNeighbourhood);
     DebugLogConsole.AddCommand <bool>("fps", "Search a neighbourhood", ShowFpsCounter);
     DebugLogConsole.AddCommand("barrelroll", "Let the plane do barrel rolls", ToggleBarrelRoll);
 }
Пример #7
0
        public override IEnumerator OnLoadCoroutine(Level level)
        {
            DebugLogConsole.AddCommandInstance("onoff_creatures",
                                               "On Off Creatures", "OnOffCreatures",
                                               this);


            return(base.OnLoadCoroutine(level));
        }
Пример #8
0
    private void Start()
    {
        if (Application.platform != RuntimePlatform.WindowsPlayer && Application.platform != RuntimePlatform.WindowsEditor)
        {
            return;
        }

        DebugLogConsole.AddCommandStatic("login", "Sign in to this app on this device.", "Auth", typeof(GoogleWindowsSignIn));
    }
        // Start is called before the first frame update
        void Start()
        {
            DebugLogConsole.AddCommand <string, int>("player.additem", "", (string item, int amount) =>
            {
                InterfaceManager.manager.InventorySystem.AddItem(item, amount);
            });

            DebugLogConsole.AddCommand <string, int>("player.removeitem", "", (string item, int amount) =>
            {
                InterfaceManager.manager.InventorySystem.RemoveItem(item, amount);
            });
        }
Пример #10
0
        private void Start()
        {
            if (Application.platform != RuntimePlatform.Android)
            {
                return;
            }

            DebugLogConsole.AddCommandInstance("login", "Sign in to this app on this device.", "OnSignIn", this);
            DebugLogConsole.AddCommandInstance("logout", "Sign out of app. Will require sign in to connect in the future.", "OnSignOut", this);
            DebugLogConsole.AddCommandInstance("disc", "Disconnect your account from this game. Will require re-authorization to connect in the future.", "OnDisconnect", this);
            DebugLogConsole.AddCommandInstance("silent", "Sign in without a login dialog if possible.", "OnSignInSilently", this);
        }
 public override IEnumerator OnLoadCoroutine(Level level)
 {
     DebugLogConsole.AddCommandInstance("sw",
                                        "Start Wave", "StartWave",
                                        this);
     DebugLogConsole.AddCommandInstance("asd",
                                        "Toggle Arena Squad Data", "ArenaSquadData",
                                        this);
     DebugLogConsole.AddCommandInstance("fps",
                                        "Get FPS", "GetFPS",
                                        this);
     return(base.OnLoadCoroutine(level));
 }
Пример #12
0
        /// <summary>
        /// Called when master scene is loaded
        /// Creates the manager instance and adds commands to the debug console
        /// </summary>
        public override void OnLevelLoaded(LevelDefinition levelDefinition)
        {
            // Creates the manager GameObject and gives it the Manager MonoBehaviour
            // Makes it so that GameObject is not destroyed on loading a new scene
            Manager m = new GameObject().AddComponent <Manager>();

            GameObject.DontDestroyOnLoad(m.gameObject);

            // Adds the commands to the debug console
            DebugLogConsole.AddCommandInstance("connect", "Connect as client, Parameters: ip, port", "connectClient", m);
            DebugLogConsole.AddCommandInstance("start", "Start a server, Parameters, port, maxPlayers", "startServer", m);
            DebugLogConsole.AddCommandInstance("disconnect", "Disconnect from a server", "disconnectClient", m);
        }
Пример #13
0
        public void Start()
        {
            Log.Debug(string.Format("ConsoleManager.Start()"));

            // TODO: Use C# attributes to define commands instead of hard-wiring here
            // or at least raise an event to let components know they can register


            // add instance methods
            DebugLogConsole.AddCommandInstance(command: "SetMuteAudio", methodName: "SetMuteAudio", instance: AudioManager.Instance);

            // add static methods
            DebugLogConsole.AddCommandStatic(command: "Version", methodName: "ConsoleApplicationVersion", ownerType: typeof(ApplicationHelper));
        }
Пример #14
0
        public override void OnLevelLoaded(LevelDefinition levelDefinition)
        {
            DebugLogConsole.AddCommandStatic("spawnparty", "Spawn a party", "SpawnParty", typeof(CharacterParty));
            GameManager.onPossessionEvent += GameManager_onPossessionEvent;

            try
            {
                harmony = HarmonyInstance.Create("CharacterParty");
                harmony.PatchAll(Assembly.GetExecutingAssembly());
                Debug.Log("CharacterParty successfully loaded!");
            }
            catch (System.Exception e)
            {
                Debug.LogException(e);
            }
        }
Пример #15
0
        public ConsoleCommands()
        {
            DebugLogConsole.AddCommandInstance("compare", "launch file browser", "Compare", this);

            DebugLogConsole.AddCommandInstance("clear", "clear saved preferences", "Clear", this);

            DebugLogConsole.AddCommandInstance("load", "load a file with a shortcut name you choose", "Load", this);

            DebugLogConsole.AddCommandInstance("print", "print results", "Print", this);

            DebugLogConsole.AddCommandInstance("comparecol", "compare columns in a sheet", "CompareColumns", this);

            DebugLogConsole.AddCommandInstance("check", "check for collisions within columns - specify true or false to compare rows of collisions", "CheckColumns", this);

            DebugLogConsole.AddCommandInstance("create", "create a test sheet", "CreateTestSheet", this);

            DebugLogConsole.AddCommandInstance("itemlist", "create the main item list with unique UPCs and ALUs", "ItemList", this);
        }
 private void Start()
 {
     DebugLogConsole.AddCommand("d-info-main", "View fps and other debug info", ToggleMainDebugInfo);
     DebugLogConsole.AddCommand("d-info-advanced", "View device hardware info", ToggleAdvancedDebugInfo);
 }
Пример #17
0
 void Start()
 {
     DebugLogConsole.AddCommandStatic("spawncard", "Creates a card at specified position", "CreateCardAt", typeof(ConsoleCommands));
     DebugLogConsole.AddCommandStatic("gencards", "Generates some cards", "GenerateSomeCards", typeof(ConsoleCommands));
 }