Пример #1
0
    private void Start()
    {
        // Get Manager
        luigiManager = GameObject.FindGameObjectWithTag("LuigiManager").GetComponent <LuigiManager>();
        marioManager = GameObject.FindGameObjectWithTag("MarioManager").GetComponent <MarioManager>();
        truckManager = GameObject.FindGameObjectWithTag("TruckManager").GetComponent <TruckManager>();

        // Get Audio Source
        audioSource = GetComponent <AudioSource>();

        // Get digit displays
        digitDisplay1   = GameObject.FindGameObjectWithTag("DigitDisplay1").GetComponent <SevenDigitDisplay>();
        digitDisplay10  = GameObject.FindGameObjectWithTag("DigitDisplay10").GetComponent <SevenDigitDisplay>();
        digitDisplay100 = GameObject.FindGameObjectWithTag("DigitDisplay100").GetComponent <SevenDigitDisplay>();

        // Initialise convoyor belt as a list of "Box"
        conveyorBelt = new List <Box>();

        // Start game loop
        tickCount = 0;
        StartCoroutine(InitLoop());
    }
Пример #2
0
        private void StroopMainForm_Load(object sender, EventArgs e)
        {
            // Temp: Remove "Other" tab
#if RELEASE
            tabControlMain.TabPages.Remove(tabPageExpressions);
#endif

            // Create new manager context
            var currentContext = new ManagerContext();
            ManagerContext.Current = currentContext;

            Config.Stream                  = new ProcessStream();
            Config.Stream.OnUpdate        += OnUpdate;
            Config.Stream.FpsUpdated      += _sm64Stream_FpsUpdated;
            Config.Stream.OnDisconnect    += _sm64Stream_OnDisconnect;
            Config.Stream.WarnReadonlyOff += _sm64Stream_WarnReadonlyOff;
            Config.Stream.OnClose         += _sm64Stream_OnClose;

            currentContext.DisassemblyManager = _disManager = new DisassemblyManager(tabPageDisassembly);
            currentContext.ScriptManager      = _scriptManager = new ScriptManager(_scriptParser, checkBoxUseRomHack);
            currentContext.HackManager        = _hackManager = new HackManager(_romHacks, Config.ObjectAssociations.SpawnHacks, tabPageHacks);

            // Create map manager
            MapGui mapGui = new MapGui();
            mapGui.GLControl                   = glControlMap;
            mapGui.MapIdLabel                  = labelMapId;
            mapGui.MapNameLabel                = labelMapName;
            mapGui.MapSubNameLabel             = labelMapSubName;
            mapGui.PuValueLabel                = labelMapPuValue;
            mapGui.QpuValueLabel               = labelMapQpuValue;
            mapGui.MapIconSizeTrackbar         = trackBarMapIconSize;
            mapGui.MapZoomTrackbar             = trackBarMapZoom;
            mapGui.MapShowInactiveObjects      = checkBoxMapShowInactive;
            mapGui.MapShowMario                = checkBoxMapShowMario;
            mapGui.MapShowHolp                 = checkBoxMapShowHolp;
            mapGui.MapShowIntendedNextPosition = checkBoxMapShowIntendedNextPosition;
            mapGui.MapShowCamera               = checkBoxMapShowCamera;
            mapGui.MapShowFloorTriangle        = checkBoxMapShowFloor;
            mapGui.MapShowCeilingTriangle      = checkBoxMapShowCeiling;
            currentContext.MapManager          = _mapManager = new MapManager(_mapAssoc, mapGui);
            currentContext.ModelManager        = _modelManager = new ModelManager(tabPageModel);

            currentContext.ActionsManager      = _actionsManager = new ActionsManager(_actionsData, noTearFlowLayoutPanelActions, tabPageActions);
            currentContext.WaterManager        = _waterManager = new WaterManager(_waterData, noTearFlowLayoutPanelWater);
            currentContext.InputManager        = _inputManager = new InputManager(_inputData, tabPageInput, NoTearFlowLayoutPanelInput, _inputImageGui);
            currentContext.MarioManager        = _marioManager = new MarioManager(_marioData, tabPageMario, NoTearFlowLayoutPanelMario, _mapManager);
            currentContext.HudManager          = _hudManager = new HudManager(_hudData, tabPageHud, NoTearFlowLayoutPanelHud);
            currentContext.MiscManager         = _miscManager = new MiscManager(_miscData, NoTearFlowLayoutPanelMisc, tabPageMisc);
            currentContext.CameraManager       = _cameraManager = new CameraManager(_cameraData, tabPageCamera, NoTearFlowLayoutPanelCamera);
            currentContext.TriangleManager     = _triangleManager = new TriangleManager(tabPageTriangles, _triangleData, NoTearFlowLayoutPanelTriangles);
            currentContext.DebugManager        = _debugManager = new DebugManager(_debugData, tabPageDebug, noTearFlowLayoutPanelDebug);
            currentContext.PuManager           = _puManager = new PuManager(groupBoxPuController);
            currentContext.FileManager         = _fileManager = new FileManager(_fileData, tabPageFile, noTearFlowLayoutPanelFile, _fileImageGui);
            currentContext.QuarterFrameManager = _quarterFrameManager = new DataManager(_quarterFrameData, noTearFlowLayoutPanelQuarterFrame);
            currentContext.CameraHackManager   = _cameraHackManager = new CamHackManager(_camHackData, tabPageCamHack, noTearFlowLayoutPanelCamHack);
            currentContext.ObjectManager       = _objectManager = new ObjectManager(_objectData, tabPageObjects, NoTearFlowLayoutPanelObject);
            currentContext.OptionsManager      = _optionsManager = new OptionsManager(tabPageOptions);
            currentContext.TestingManager      = _testingManager = new TestingManager(tabPageTesting);

            // Create Object Slots
            _slotManagerGui.TabControl          = tabControlMain;
            _slotManagerGui.LockLabelsCheckbox  = checkBoxObjLockLabels;
            _slotManagerGui.FlowLayoutContainer = NoTearFlowLayoutPanelObjects;
            _slotManagerGui.SortMethodComboBox  = comboBoxSortMethod;
            _slotManagerGui.LabelMethodComboBox = comboBoxLabelMethod;
            currentContext.ObjectSlotManager    = _objectSlotManager = new ObjectSlotsManager(_objectManager,
                                                                                              _slotManagerGui, _mapManager, _miscManager, _modelManager, tabControlMain);

            SetupViews();

            _resizing = false;
            labelVersionNumber.Text = _version;

            // Collect garbage, we are fully loaded now!
            GC.Collect();
            GC.WaitForPendingFinalizers();

            // Load process
            buttonRefresh_Click(this, new EventArgs());
            panelConnect.Location = new Point();
            panelConnect.Size     = this.Size;
        }
Пример #3
0
        private void StroopMainForm_Load(object sender, EventArgs e)
        {
            // Temp: Remove "Other" tab
#if RELEASE
            tabControlMain.TabPages.Remove(tabPageExpressions);
#endif

            _sm64Stream           = new ProcessStream();
            _sm64Stream.OnUpdate += OnUpdate;

            _disManager    = new DisassemblyManager(this, richTextBoxDissasembly, maskedTextBoxDisStart, _sm64Stream, buttonDisGo);
            _scriptManager = new ScriptManager(_sm64Stream, _scriptParser, checkBoxUseRomHack);
            _hackManager   = new HackManager(_sm64Stream, _romHacks, checkedListBoxHacks);

            // Create map manager
            MapGui mapGui = new MapGui();
            mapGui.GLControl              = glControlMap;
            mapGui.MapIdLabel             = labelMapId;
            mapGui.MapNameLabel           = labelMapName;
            mapGui.MapSubNameLabel        = labelMapSubName;
            mapGui.PuValueLabel           = labelMapPuValue;
            mapGui.QpuValueLabel          = labelMapQpuValue;
            mapGui.MapIconSizeTrackbar    = trackBarMapIconSize;
            mapGui.MapZoomTrackbar        = trackBarMapZoom;
            mapGui.MapShowInactiveObjects = checkBoxMapShowInactive;
            mapGui.MapShowMario           = checkBoxMapShowMario;
            mapGui.MapShowObjects         = checkBoxMapShowObj;
            mapGui.MapShowHolp            = checkBoxMapShowHolp;
            mapGui.MapShowCamera          = checkBoxMapShowCamera;
            mapGui.MapShowFloorTriangle   = checkBoxMapShowFloor;
            _mapManager = new MapManager(_sm64Stream, _mapAssoc, _objectAssoc, mapGui);

            _marioManager    = new MarioManager(_sm64Stream, _marioData, panelMarioBorder, flowLayoutPanelMario, _mapManager);
            _hudManager      = new HudManager(_sm64Stream, _hudData, tabPageHud);
            _miscManager     = new MiscManager(_sm64Stream, _miscData, flowLayoutPanelMisc, groupBoxPuController);
            _cameraManager   = new CameraManager(_sm64Stream, _cameraData, panelCameraBorder, flowLayoutPanelCamera);
            _triangleManager = new TriangleManager(_sm64Stream, tabPageTriangles, _triangleData);
            _debugManager    = new DebugManager();

            // Create object manager
            var objectGui = new ObjectDataGui()
            {
                ObjectBorderPanel     = panelObjectBorder,
                ObjectFlowLayout      = flowLayoutPanelObject,
                ObjectImagePictureBox = pictureBoxObject,
                ObjAddressLabelValue  = labelObjAddValue,
                ObjAddressLabel       = labelObjAdd,
                ObjBehaviorLabel      = labelObjBhvValue,
                ObjectNameTextBox     = textBoxObjName,
                ObjSlotIndexLabel     = labelObjSlotIndValue,
                ObjSlotPositionLabel  = labelObjSlotPosValue,
                CloneButton           = buttonObjClone,
                MoveMarioToButton     = buttonObjGoTo,
                MoveToMarioButton     = buttonObjRetrieve,
                UnloadButton          = buttonObjUnload
            };
            _objectManager = new ObjectManager(_sm64Stream, _objectAssoc, _objectData, objectGui);

            // Create options manager
            var optionGui = new OptionsGui();
            optionGui.CheckBoxStartFromOne = checkBoxStartSlotIndexOne;
            _optionsManager = new OptionsManager(optionGui);

            // Create Object Slots
            _slotManagerGui.TabControl                  = tabControlMain;
            _slotManagerGui.LockLabelsCheckbox          = checkBoxObjLockLabels;
            _slotManagerGui.MapObjectToggleModeComboBox = comboBoxMapToggleMode;
            _slotManagerGui.FlowLayoutContainer         = flowLayoutPanelObjects;
            _slotManagerGui.SortMethodComboBox          = comboBoxSortMethod;
            _slotManagerGui.LabelMethodComboBox         = comboBoxLabelMethod;
            _objectSlotManager = new ObjectSlotsManager(_sm64Stream, _objectAssoc, _objectManager, _slotManagerGui, _mapManager, _miscManager);

            SetupViews();

            _resizing               = false;
            _defaultSplitValue      = splitContainerMain.SplitterDistance;
            labelVersionNumber.Text = _version;

            // Load process
            var processes = GetAvailableProcesses();
            if (processes.Count == 1)
            {
                if (MessageBox.Show(String.Format("Found process \"{0}\". Connect?", processes[0].ProcessName),
                                    "Process Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    var processSelect = new ProcessSelection(processes[0]);
                    comboBoxProcessSelection.Items.Add(processSelect);
                    comboBoxProcessSelection.SelectedIndex = 0;
                }
            }
        }