示例#1
0
 void Start()
 {
     if (BuildTool.GetInstance().GetCurrentToolMode() != mode && expandableTab != null)
     {
         expandableTab.SetActive(false);
     }
 }
示例#2
0
        public static bool CreatePrebuilds_Prefix(BuildTool __instance)
        {
            if (!SimulatedWorld.Initialized)
            {
                return(true);
            }


            List <BuildPreview> previews = __instance.buildPreviews;

            if (__instance is BuildTool_BlueprintPaste)
            {
                BuildTool_BlueprintPaste bpInstance = __instance as BuildTool_BlueprintPaste;
                previews = bpInstance.bpPool.Take(bpInstance.bpCursor).ToList();
            }

            // Host will just broadcast event to other players
            if (LocalPlayer.IsMasterClient)
            {
                int planetId = FactoryManager.EventFactory?.planetId ?? GameMain.localPlanet?.id ?? -1;
                LocalPlayer.SendPacketToStar(new CreatePrebuildsRequest(planetId, previews, FactoryManager.PacketAuthor == FactoryManager.AUTHOR_NONE ? LocalPlayer.PlayerId : FactoryManager.PacketAuthor, __instance.GetType().ToString()), GameMain.galaxy.PlanetById(planetId).star.id);
            }

            //If client builds, he need to first send request to the host and wait for reply
            if (!LocalPlayer.IsMasterClient && !FactoryManager.IsIncomingRequest)
            {
                LocalPlayer.SendPacket(new CreatePrebuildsRequest(GameMain.localPlanet?.id ?? -1, previews, FactoryManager.PacketAuthor == FactoryManager.AUTHOR_NONE ? LocalPlayer.PlayerId : FactoryManager.PacketAuthor, __instance.GetType().ToString()));
                return(false);
            }
            return(true);
        }
 protected override void OnPrefabInit()
 {
     Instance          = this;
     tooltip           = GetComponent <ToolTip>();
     buildingCount     = Random.Range(1, 14);
     canChangeDragAxis = false;
 }
示例#4
0
 private void OnGUI()
 {
     if (GUILayout.Button("BuildFont"))
     {
         BuildTool.BuildFont();
     }
     if (GUILayout.Button("BuildSound"))
     {
         BuildTool.BuildSound();
     }
     if (GUILayout.Button("BuildIcon"))
     {
         BuildTool.BuildIcon();
     }
     if (GUILayout.Button("GenerateAtlas"))
     {
         BuildTool.GenerateAtlas();
     }
     if (GUILayout.Button("BuildAtlas"))
     {
         BuildTool.BuildAtlas();
     }
     if (GUILayout.Button("BuildModel"))
     {
         BuildTool.BuildModel();
     }
 }
 private void Start()
 {
     battleChat = GetComponent <BattleChat>();
     editorToolScripts[0].desc = ConsumableManager.Instance.Get("build_tool");
     editorToolScripts[1].desc = ConsumableManager.Instance.Get("line_tool");
     editorToolScripts[2].desc = ConsumableManager.Instance.Get("replace_tool");
     editorTool = new EditorTool[editorToolScripts.Length];
     for (int i = 0; i < editorToolScripts.Length; i++)
     {
         Item i2  = null;
         long num = MyInfoManager.Instance.HaveFunction(editorToolScripts[i].desc.name);
         if (num >= 0)
         {
             i2 = MyInfoManager.Instance.GetItemBySequence(num);
         }
         if (editorToolScripts[i].desc.name == "build_tool")
         {
             editorTool[i] = new BuildTool(editorToolScripts[i], battleChat);
         }
         else if (editorToolScripts[i].desc.name == "line_tool")
         {
             editorTool[i] = new LineTool(editorToolScripts[i], i2, dummy, battleChat);
         }
         else if (editorToolScripts[i].desc.name == "replace_tool")
         {
             editorTool[i] = new ReplaceTool(editorToolScripts[i], i2, battleChat);
         }
     }
     editorTool[0].Activate(activate: true);
 }
示例#6
0
        public virtual BuildEngine Build(IProcessFactory processFactory, IPackageTree packageTree, string mode)
        {
            if (builtPackages.ContainsKey(packageTree.Name))
            {
                return(this);
            }

            SetBuildMode(mode);

            string pathToBuildFile = string.Format("{0}", GetBuildFilePath(packageTree).QuotePath());

            if (GenerateStrongKey)
            {
                GenerateKeyFile(processFactory, packageTree);
            }

            CopyDependenciesTo(packageTree);

            var cmdLineArguments = BuildTool.CommandLineArguments(pathToBuildFile, this, packageTree, Version);

            var pathToBuildTool = string.Format("{0}", BuildTool.PathToBuildTool(packageTree, Version).QuotePath());

            ProcessBuild(packageTree, processFactory, pathToBuildTool, cmdLineArguments);

            CopyArtifactsToBuildDirectory(packageTree);

            builtPackages.Add(packageTree.Name, packageTree.Name);

            return(this);
        }
示例#7
0
        private void CreateDefaultTools()
        {
            BuildTool cs2compilerR = CreateMicrosoftCompiler(
                Resources.MicrosoftCS2CompilerR, false, false);
            BuildTool cs2compilerD = CreateMicrosoftCompiler(
                Resources.MicrosoftCS2CompilerD, true, false);
            BuildTool cs3compilerR = CreateMicrosoftCompiler(
                Resources.MicrosoftCS3CompilerR, false, true);
            BuildTool cs3compilerD = CreateMicrosoftCompiler(
                Resources.MicrosoftCS3CompilerD, true, true);

            _buildToolManager.BuildTools.AddTool(cs2compilerR);
            _buildToolManager.BuildTools.AddTool(cs2compilerD);
            _buildToolManager.BuildTools.AddTool(cs3compilerR);
            _buildToolManager.BuildTools.AddTool(cs3compilerD);
            _buildToolManager.BuildTools.SelectTool(cs3compilerR);

            BuildTool windowsExe = new BuildTool(
                Guid.NewGuid().ToString(),
                _documentType, Resources.WindowsExe);

            windowsExe.Action         = QuickSharp.BuildTools.Constants.ACTION_RUN;
            windowsExe.Path           = "${OUT_PATH}";
            windowsExe.Args           = "${RUNTIME_OPT}";
            windowsExe.UserArgs       = String.Empty;
            windowsExe.LineParserName = String.Empty;

            _buildToolManager.BuildTools.AddTool(windowsExe);
            _buildToolManager.BuildTools.SelectTool(windowsExe);
        }
示例#8
0
        private static string BuildArguments(BuildTool buildTool, BuildInfo buildInfo)
        {
            string arguments = string.Empty;

            if (buildTool == BuildTool.DotnetCli)
            {
                arguments += "msbuild"; // `dotnet msbuild` command
            }
            arguments += $@" ""{buildInfo.Solution}""";

            if (buildInfo.Restore)
            {
                arguments += " /restore";
            }

            arguments += $@" /t:{string.Join(",", buildInfo.Targets)} " +
                         $@"""/p:{"Configuration=" + buildInfo.Configuration}"" /v:normal " +
                         $@"""/l:{typeof(GodotBuildLogger).FullName},{GodotBuildLogger.AssemblyPath};{buildInfo.LogsDirPath}""";

            foreach (string customProperty in buildInfo.CustomProperties)
            {
                arguments += " /p:" + customProperty;
            }

            return(arguments);
        }
示例#9
0
 public FormDesigner()
 {
     this.UniqueID       = "application" + projectCOunter;
     propertyWindow      = new PropertyWindow();
     projectExplorer     = new ProjectExplorer(this);
     dataPatternExplorer = new DataPatternExlorer(this);
     displayNameExplorer = new DisplayNameExplorer(this);
     webServiceExplorer  = new EIBFormDesigner.Designer.WebServiceExplorer.WebServiceExplorer(this);
     eventManager        = getEventManagerInstance();
     DragDropHandler.Initialize(eventManager, this);
     this.Disposed += new EventHandler(FormDesigner_Disposed);
     InitializeComponent();
     ToolBoxWindow.form = this;
     toolBoxWindow      = new ToolBoxWindow();
     startupImage       = new StartupHIC();
     formulaEditor      = new FormulaEditorWindow(this);
     workEditor         = new WorkflowEditorWindow(this);
     buildtool          = new EIBFormDesigner.Build.BuildTool(this);
     buildwindow        = new BuildWindow(this);
     setFromPatternsForACL();
     //UserAdmin.UserAdminConstants.CompanyId = company;
     //UserAdmin.UserAdminConstants.CompanyName = company;
     history = new UndoRedoHistory <ControlPool>(controlpool);
     this.SetStyle(ControlStyles.DoubleBuffer, true);
     this.SetStyle(ControlStyles.UserPaint, true);
     this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
 }
示例#10
0
    private void SelectOtherTexture(SupportedTexture newTextureToBuildWith)
    {
        BuildTool buildTool = tools[0] as BuildTool;
        PaintTool paintTool = tools[2] as PaintTool;
        Texture   newTexture;

        switch (newTextureToBuildWith)
        {
        case SupportedTexture.DIRT:
            newTexture = textures[0];
            break;

        case SupportedTexture.SAND:
            newTexture = textures[1];
            break;

        case SupportedTexture.STONE:
            newTexture = textures[2];
            break;

        case SupportedTexture.COBBLESTONE:
            newTexture = textures[3];
            break;

        case SupportedTexture.PLANKS_OAK:
        default:
            newTexture = textures[4];
            break;
        }
        buildTool.currentTexture = newTexture;
        paintTool.texture        = newTexture;
        Debug.Log("Selecting new texture: " + newTexture);
    }
示例#11
0
 private void Start()
 {
     toolManage  = FindObjectOfType <ToolManage>();
     buildTool   = toolManage.GetToolOfType <BuildTool>();
     price.text  = Mathf.RoundToInt(building.buildingData.price).ToString();
     icon.sprite = building.buildingData.icon;
 }
示例#12
0
 public static void CheckAndFixConnections(BuildTool buildTool, PlanetData planet)
 {
     foreach (BuildPreview preview in buildTool.buildPreviews)
     {
         //Check only, if buildPreview has some connection to another prebuild
         if (preview.coverObjId < 0)
         {
             Vector3 tmpVector = preview.lpos;
             if (planet.factory.prebuildPool[-preview.coverObjId].id != 0)
             {
                 //Prebuild exists, check if it is same prebuild that client wants by comparing prebuild positions
                 if (tmpVector == planet.factory.prebuildPool[-preview.coverObjId].pos)
                 {
                     //Position of prebuilds are same, everything is OK.
                     continue;
                 }
             }
             // Prebuild does not exists, check what is the new ID of the finished building that was constructed from prebuild
             // or
             // Positions of prebuilds are different, which means this is different prebuild and we need to find ID of contructed building
             foreach (EntityData entity in planet.factory.entityPool)
             {
                 // `entity.pos == tmpVector` does not work in every cases (rounding errors?).
                 if ((entity.pos - tmpVector).sqrMagnitude < 0.1f)
                 {
                     preview.coverObjId = entity.id;
                     break;
                 }
             }
         }
     }
 }
示例#13
0
        private BuildCommand GetBuildCommand(
            BuildTool buildTool, FileInfo srcInfo, bool exeRequired)
        {
            if (srcInfo == null)
            {
                return(null);
            }

            string srcText = FileTools.ReadFile(srcInfo.FullName);

            if (srcText == null)
            {
                return(null);
            }

            BuildCommand buildCommand = new BuildCommand();

            buildCommand.BuildTool  = buildTool;
            buildCommand.SourceInfo = srcInfo;
            buildCommand.SourceText = srcText;

            buildCommand.TargetType = TargetIsLibrary(srcText) ? ".dll" : ".exe";

            string targetName = Path.ChangeExtension(
                buildCommand.SourceInfo.FullName,
                buildCommand.TargetType);

            buildCommand.TargetInfo = new FileInfo(targetName);

            string path = buildTool.Path;

            path = _buildToolManager.ExpandGenericMacros(
                path, buildTool,
                buildCommand.SourceText,
                buildCommand.SourceInfo,
                buildCommand.TargetInfo);

            if (exeRequired && buildCommand.TargetType != ".exe")
            {
                buildCommand.Cancel       = true;
                buildCommand.CancelResult = false;
                return(buildCommand);
            }

            string args = buildTool.Args;

            args = _buildToolManager.ExpandGenericMacros(
                args, buildTool,
                buildCommand.SourceText,
                buildCommand.SourceInfo,
                buildCommand.TargetInfo);

            buildCommand.Path        = path;
            buildCommand.Args        = args;
            buildCommand.Cancel      = false;
            buildCommand.SuccessCode = 0;

            return(buildCommand);
        }
示例#14
0
 public static BuildTool Instance()
 {
     if (instance == null)
     {
         instance = new BuildTool();
     }
     return(instance);
 }
示例#15
0
        private BuildCommand CompileBuildCommand(
            BuildTool buildTool, FileInfo srcInfo)
        {
            if (srcInfo == null)
            {
                return(null);
            }

            string srcText = FileTools.ReadFile(srcInfo.FullName);

            if (srcText == null)
            {
                return(null);
            }

            BuildCommand buildCommand = new BuildCommand();

            buildCommand.BuildTool  = buildTool;
            buildCommand.SourceInfo = srcInfo;
            buildCommand.SourceText = srcText;

            buildCommand.TargetType = ".cs";

            string targetName = Path.ChangeExtension(
                buildCommand.SourceInfo.FullName,
                buildCommand.TargetType);

            buildCommand.TargetInfo = new FileInfo(targetName);

            string path = buildTool.Path;

            path = _buildToolManager.ExpandGenericMacros(
                path, buildTool,
                buildCommand.SourceText,
                buildCommand.SourceInfo,
                buildCommand.TargetInfo);

            string args = buildTool.Args;

            args = _buildToolManager.ExpandGenericMacros(
                args, buildTool,
                buildCommand.SourceText,
                buildCommand.SourceInfo,
                buildCommand.TargetInfo);

            buildCommand.Path        = path;
            buildCommand.Args        = args;
            buildCommand.Cancel      = false;
            buildCommand.SuccessCode = 0;

            buildCommand.StartText =
                String.Format("{0}: ", Resources.CompileStarted);
            buildCommand.FinishText =
                String.Format("{0}: ", Resources.CompileComplete);

            return(buildCommand);
        }
示例#16
0
 private void buildToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (EIBXMLUtilities.folderName != null && !EIBXMLUtilities.folderName.Trim().Equals(""))
     {
         BuildTool.BuildForm(EIBXMLUtilities.projectFilePath);
         buildwindow.Show(dockPanel);
         buildwindow.DockState = DockState.DockBottom;
     }
 }
 public static void InitTool(PlayerAction_Build __instance)
 {
     BuildTool[] buildTools = __instance.tools;
     BuildTool[] ourTools   = new BuildTool[buildTools.Length + 1];
     buildTools.CopyTo(ourTools, 0);
     BlueprintTweaksPlugin.tool    = new DragRemoveBuildTool();
     ourTools[ourTools.Length - 1] = BlueprintTweaksPlugin.tool;
     __instance.tools = ourTools;
 }
示例#18
0
        private BuildCommand RunBuildCommand(
            BuildTool buildTool, FileInfo srcInfo)
        {
            BuildCommand buildCommand = GetBuildCommand(
                buildTool, srcInfo, true);

            buildCommand.StartText  = String.Empty;
            buildCommand.FinishText = String.Empty;

            return(buildCommand);
        }
示例#19
0
    public void AssignColor(byte _colorIndex)
    {
        AssignedColorIndex = _colorIndex;
        BuildTool.GetInstance().Coloring.SetColorIndex(ColorChannel, AssignedColorIndex);
        myImage.color = ColorManager.GetColor(AssignedColorIndex);
        MyToggle.isOn = false;

        if (OnColorChange != null)
        {
            OnColorChange();
        }
    }
示例#20
0
    public void OnToggleValueChanged(bool _b)
    {
        if (_b)
        {
            BuildTool.GetInstance().SetCurrentToolMode(mode);
        }

        if (expandableTab != null)
        {
            expandableTab.SetActive(_b);
        }
    }
示例#21
0
        public void CompileSolution(BuildTool buildTool)
        {
            foreach (var project in Projects.Values)
            {
                project.GenerateConfigurationFile();
            }

            WriteToDisk();
            _nuGet.Restore();

            _compileResult = _compiler.Run(buildTool);
        }
        public void CompileSolutionTimes(uint times, BuildTool buildTool = DefaultBuildTool, bool?treatWarningsAsErrors = null)
        {
            HasTriedToCompile = true;
            _solutionWriteToDiskDriver.WriteSolutionToDisk(treatWarningsAsErrors);

            var usedBuildTool = _overridenBuildTool ?? buildTool;

            for (uint time = 0; time < times; time++)
            {
                _compilationResultDriver.CompileResult = _compiler.Run(usedBuildTool, treatWarningsAsErrors);
            }
        }
示例#23
0
        /// <summary>
        /// Updates the build tool visualizer only if the mouse actually moved.
        /// </summary>
        /// <param name="tool">The build tool to update.</param>
        /// <param name="pos">The mouse position.</param>
        private static void ShouldUpdateVis(BuildTool tool, Vector3 pos)
        {
            int cell = Grid.PosToCell(pos);

            if (cell != lastCell)
            {
                if (tool.def != null)
                {
                    tool.UpdateVis(pos);
                }
                lastCell = cell;
            }
        }
示例#24
0
        private BuildCommand RunBuildCommand(
            BuildTool buildTool, FileInfo srcInfo)
        {
            BuildCommand buildCommand = GetBuildCommand(
                buildTool, srcInfo, true);

            buildCommand.StartText =
                String.Format("{0}: ", Resources.RunStarted);
            buildCommand.FinishText =
                String.Format("{0}: ", Resources.RunComplete);

            return(buildCommand);
        }
        public BuildTool FindBuildToolByName(string buildToolName)
        {
            foreach (Inventory inv in m_invs)
            {
                BuildTool buildToo = FindObjectByName(buildToolName, inv.BuildTools) as BuildTool;

                if (buildToo != null)
                {
                    return(buildToo);
                }
            }

            return(null);
        }
示例#26
0
        private void CreateDefaultTools()
        {
            BuildTool sqlmetal = new BuildTool(
                Guid.NewGuid().ToString(),
                _documentType, Resources.SqlMetal);

            sqlmetal.Action   = QuickSharp.BuildTools.Constants.ACTION_COMPILE;
            sqlmetal.Path     = @"C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SqlMetal.exe";
            sqlmetal.Args     = "/code:\"${SRC_NAME}.cs\" ${COMMON_OPT} ${EMBEDDED_OPT} \"${SRC_FILE}\"";
            sqlmetal.UserArgs = "/namespace:QuickSharp";

            _buildToolManager.BuildTools.AddTool(sqlmetal);
            _buildToolManager.BuildTools.SelectTool(sqlmetal);
        }
        public BuildTool FindBuildTool(string buildToolGuid)
        {
            foreach (Inventory inv in m_invs)
            {
                BuildTool bt = FindObjectByGuid(buildToolGuid, inv.BuildTools) as BuildTool;

                if (bt != null)
                {
                    return(bt);
                }
            }

            return(null);
        }
示例#28
0
        private void CreateDefaultTools()
        {
            BuildTool xsd = new BuildTool(
                Guid.NewGuid().ToString(),
                _documentType, Resources.Xsd);

            xsd.Action   = QuickSharp.BuildTools.Constants.ACTION_COMPILE;
            xsd.Path     = @"C:\Program Files\Microsoft.NET\SDK\v2.0\bin\xsd.exe";
            xsd.Args     = "${COMMON_OPT} ${EMBEDDED_OPT} /n:${SRC_NAME} \"${SRC_FILE}\"";
            xsd.UserArgs = "/nologo /d /edb /l:cs";

            _buildToolManager.BuildTools.AddTool(xsd);
            _buildToolManager.BuildTools.SelectTool(xsd);
        }
示例#29
0
        private void CreateDefaultTools()
        {
            BuildTool wsdl = new BuildTool(
                Guid.NewGuid().ToString(),
                _documentType, Resources.Wsdl);

            wsdl.Action   = QuickSharp.BuildTools.Constants.ACTION_COMPILE;
            wsdl.Path     = @"C:\Program Files\Microsoft.NET\SDK\v2.0\bin\wsdl.exe";
            wsdl.Args     = "${COMMON_OPT} ${EMBEDDED_OPT} \"${SRC_FILE}\"";
            wsdl.UserArgs = "/nologo /namespace:QuickSharp";

            _buildToolManager.BuildTools.AddTool(wsdl);
            _buildToolManager.BuildTools.SelectTool(wsdl);
        }
示例#30
0
    public void OnPointedAway()
    {
        Reset(cubeMat);

        if (inRangeMats != null)
        {
            foreach (Material m in inRangeMats)
            {
                Reset(m);
            }
        }

        currentlyPointingAt = null;
    }
示例#31
0
 protected BaseAnt(BuildTool t) {
     currentBuildTool = t;
 }