Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb5a539

Browse files
committed
add RenderPipeline Column & settings for it,#139
1 parent30872fa commitbb5a539

File tree

8 files changed

+85
-20
lines changed

8 files changed

+85
-20
lines changed

‎UnityLauncherPro/Data/Project.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class Project : IValueConverter
1616
publicstringTargetPlatform{set;get;}// TODO rename to Platform
1717
publicstring[]TargetPlatforms{set;get;}
1818
publicboolfolderExists{set;get;}
19+
publicstringSRP{set;get;}// Scriptable Render Pipeline, TODO add version info?
1920

2021
// WPF keeps calling this method from AppendFormatHelper, GetNameCore..? not sure if need to return something else or default would be faster?
2122
publicoverridestringToString()

‎UnityLauncherPro/Data/UnityInstallation.cs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@ public class UnityInstallation : IValueConverter
99
publiclongVersionCode{set;get;}// version as number, cached for sorting
1010
publicstringPath{set;get;}// exe path
1111
publicDateTime?Installed{set;get;}
12-
1312
publicstringPlatformsCombined{set;get;}
1413
publicstring[]Platforms{set;get;}
1514
publicintProjectCount{set;get;}
16-
1715
publicboolIsPreferred{set;get;}
18-
1916
publicstringReleaseType{set;get;}// Alpha, Beta, LTS.. TODO could be enum
2017

2118
// https://stackoverflow.com/a/5551986/5452781

‎UnityLauncherPro/GetProjects.cs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class GetProjects
1515
// convert target platform name into valid buildtarget platform name, NOTE this depends on unity version, now only 2019 and later are supported
1616
publicstaticDictionary<string,string>remapPlatformNames=newDictionary<string,string>{{"StandaloneWindows64","Win64"},{"StandaloneWindows","Win"},{"Android","Android"},{"WebGL","WebGL"}};
1717

18-
publicstaticList<Project>Scan(boolgetGitBranch=false,boolgetPlasticBranch=false,boolgetArguments=false,boolshowMissingFolders=false,boolshowTargetPlatform=false,StringCollectionAllProjectPaths=null,boolsearchGitbranchRecursivly=false)
18+
publicstaticList<Project>Scan(boolgetGitBranch=false,boolgetPlasticBranch=false,boolgetArguments=false,boolshowMissingFolders=false,boolshowTargetPlatform=false,StringCollectionAllProjectPaths=null,boolsearchGitbranchRecursivly=false,boolshowSRP=false)
1919
{
2020
List<Project>projectsFound=newList<Project>();
2121

@@ -53,7 +53,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getPlasticBranc
5353
projectPath=(string)key.GetValue(valueName);
5454
}
5555

56-
varp=GetProjectInfo(projectPath,getGitBranch,getPlasticBranch,getArguments,showMissingFolders,showTargetPlatform,searchGitbranchRecursivly);
56+
varp=GetProjectInfo(projectPath,getGitBranch,getPlasticBranch,getArguments,showMissingFolders,showTargetPlatform,searchGitbranchRecursivly,showSRP);
5757
//Console.WriteLine(projectPath+" "+p.TargetPlatform);
5858

5959
// if want to hide project and folder path for screenshot
@@ -94,7 +94,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getPlasticBranc
9494
// if not found from registry, add to recent projects list
9595
if(found==false)
9696
{
97-
varp=GetProjectInfo(projectPath,getGitBranch,getPlasticBranch,getArguments,showMissingFolders,showTargetPlatform,searchGitbranchRecursivly);
97+
varp=GetProjectInfo(projectPath,getGitBranch,getPlasticBranch,getArguments,showMissingFolders,showTargetPlatform,searchGitbranchRecursivly,showSRP);
9898
if(p!=null)projectsFound.Add(p);
9999
}
100100
}
@@ -121,7 +121,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getPlasticBranc
121121
returnprojectsFound;
122122
}// Scan()
123123

124-
staticProjectGetProjectInfo(stringprojectPath,boolgetGitBranch=false,boolgetPlasticBranch=false,boolgetArguments=false,boolshowMissingFolders=false,boolshowTargetPlatform=false,boolsearchGitbranchRecursivly=false)
124+
staticProjectGetProjectInfo(stringprojectPath,boolgetGitBranch=false,boolgetPlasticBranch=false,boolgetArguments=false,boolshowMissingFolders=false,boolshowTargetPlatform=false,boolsearchGitbranchRecursivly=false,boolshowSRP=false)
125125
{
126126
boolfolderExists=Directory.Exists(projectPath);
127127

@@ -209,6 +209,9 @@ static Project GetProjectInfo(string projectPath, bool getGitBranch = false, boo
209209
// bubblegum(TM) solution, fill available platforms for this unity version, for this project
210210
p.TargetPlatforms=Tools.GetPlatformsForUnityVersion(projectVersion);
211211
p.folderExists=folderExists;
212+
213+
if(showSRP==true)p.SRP=Tools.GetSRP(projectPath);
214+
212215
returnp;
213216
}
214217

‎UnityLauncherPro/MainWindow.xaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@
183183
</DataGridTemplateColumn.CellTemplate>
184184
</DataGridTemplateColumn>
185185

186+
<DataGridTextColumnHeader="Branch"x:Name="txtColumnRenderPipeline"Binding="{Binding SRP}"CellStyle="{StaticResource NoFocusCellStyle}"ClipboardContentBinding="{x:Null}"IsReadOnly="True"Width="60">
187+
<DataGridTextColumn.HeaderTemplate>
188+
<DataTemplate>
189+
<TextBlockText="SRP"IsHitTestVisible="False" />
190+
</DataTemplate>
191+
</DataGridTextColumn.HeaderTemplate>
192+
</DataGridTextColumn>
186193
</DataGrid.Columns>
187194

188195
<!-- right click context menu-->
@@ -739,6 +746,7 @@
739746
<CheckBoxx:Name="chkCheckPlasticBranch"Content="Check Plastic branch"ToolTip="Checks for plastic branch, if .git doesnt exists"HorizontalAlignment="Left"Margin="14,0,0,3"Checked="ChkCheckPlasticBranch_Checked"Unchecked="ChkCheckPlasticBranch_Checked"/>
740747
</StackPanel>
741748
<CheckBoxx:Name="chkAskNameForQuickProject"Content="Ask name for New Project"Checked="ChkAskNameForQuickProject_Checked"Unchecked="ChkAskNameForQuickProject_Checked"ToolTip="If disabled, uses automatic quick project naming (Should be enabled, unless you want instant project creation)"HorizontalAlignment="Left"/>
749+
<CheckBoxx:Name="chkCheckSRP"Content="Show SRP column"ToolTip="If disabled, uses automatic quick project naming (Should be enabled, unless you want instant project creation)"HorizontalAlignment="Left"Checked="chkCheckSRP_Checked"Unchecked="chkCheckSRP_Checked"/>
742750
<CheckBoxx:Name="chkShowMissingFolderProjects"Content="Show projects that don't exist on disk"Checked="ChkShowMissingFolderProjects_CheckedChanged"Unchecked="ChkShowMissingFolderProjects_CheckedChanged"ToolTip="List in recent projects, even if the project folder is missing"HorizontalAlignment="Left"/>
743751
<CheckBoxx:Name="chkShowLauncherArgumentsColumn"Content="Show commandline arguments column"Unchecked="ChkShowLauncherArgumentsColumn_CheckedChanged"Checked="ChkShowLauncherArgumentsColumn_CheckedChanged"ToolTip="Shows column for custom project commandline params"HorizontalAlignment="Left"/>
744752
<StackPanelOrientation="Horizontal"HorizontalAlignment="Left">

‎UnityLauncherPro/MainWindow.xaml.cs‎

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void Start()
148148
//Properties.Settings.Default.projectPaths = null;
149149
//Properties.Settings.Default.Save();
150150

151-
projectsSource=GetProjects.Scan(getGitBranch:(bool)chkShowGitBranchColumn.IsChecked,getPlasticBranch:(bool)chkCheckPlasticBranch.IsChecked,getArguments:(bool)chkShowLauncherArgumentsColumn.IsChecked,showMissingFolders:(bool)chkShowMissingFolderProjects.IsChecked,showTargetPlatform:(bool)chkShowPlatform.IsChecked,AllProjectPaths:Properties.Settings.Default.projectPaths,searchGitbranchRecursivly:(bool)chkGetGitBranchRecursively.IsChecked);
151+
projectsSource=GetProjects.Scan(getGitBranch:(bool)chkShowGitBranchColumn.IsChecked,getPlasticBranch:(bool)chkCheckPlasticBranch.IsChecked,getArguments:(bool)chkShowLauncherArgumentsColumn.IsChecked,showMissingFolders:(bool)chkShowMissingFolderProjects.IsChecked,showTargetPlatform:(bool)chkShowPlatform.IsChecked,AllProjectPaths:Properties.Settings.Default.projectPaths,searchGitbranchRecursivly:(bool)chkGetGitBranchRecursively.IsChecked,showSRP:(bool)chkCheckSRP.IsChecked);
152152

153153
//Console.WriteLine("projectsSource.Count: " + projectsSource.Count);
154154

@@ -453,6 +453,7 @@ void LoadSettings()
453453
chkEnableProjectRename.IsChecked=Settings.Default.enableProjectRename;
454454
chkStreamerMode.IsChecked=Settings.Default.streamerMode;
455455
chkShowPlatform.IsChecked=Settings.Default.showTargetPlatform;
456+
chkCheckSRP.IsChecked=Settings.Default.checkSRP;
456457
chkUseCustomTheme.IsChecked=Settings.Default.useCustomTheme;
457458
txtRootFolderForNewProjects.Text=Settings.Default.newProjectsRoot;
458459
txtWebglRelativePath.Text=Settings.Default.webglBuildPath;
@@ -467,6 +468,7 @@ void LoadSettings()
467468
gridRecent.Columns[4].Visibility=(bool)chkShowLauncherArgumentsColumn.IsChecked?Visibility.Visible:Visibility.Collapsed;
468469
gridRecent.Columns[5].Visibility=(bool)chkShowGitBranchColumn.IsChecked?Visibility.Visible:Visibility.Collapsed;
469470
gridRecent.Columns[6].Visibility=(bool)chkShowPlatform.IsChecked?Visibility.Visible:Visibility.Collapsed;
471+
gridRecent.Columns[7].Visibility=(bool)chkCheckSRP.IsChecked?Visibility.Visible:Visibility.Collapsed;
470472

471473
// update installations folder listbox
472474
lstRootFolders.Items.Clear();
@@ -654,9 +656,9 @@ private void SaveSettingsOnExit()
654656
List<int>gridWidths;
655657

656658
// if we dont have any settings yet
657-
if(Properties.Settings.Default.gridColumnWidths!=null)
659+
if(Settings.Default.gridColumnWidths!=null)
658660
{
659-
gridWidths=newList<int>(Properties.Settings.Default.gridColumnWidths);
661+
gridWidths=newList<int>(Settings.Default.gridColumnWidths);
660662
}
661663
else
662664
{
@@ -667,7 +669,7 @@ private void SaveSettingsOnExit()
667669
varcolumn=gridRecent.Columns[0];
668670
for(inti=0;i<gridRecent.Columns.Count;++i)
669671
{
670-
if(Properties.Settings.Default.gridColumnWidths!=null&&Properties.Settings.Default.gridColumnWidths.Length>i)
672+
if(Settings.Default.gridColumnWidths!=null&&Settings.Default.gridColumnWidths.Length>i)
671673
{
672674
gridWidths[i]=(int)gridRecent.Columns[i].Width.Value;
673675
}
@@ -676,17 +678,17 @@ private void SaveSettingsOnExit()
676678
gridWidths.Add((int)gridRecent.Columns[i].Width.Value);
677679
}
678680
}
679-
Properties.Settings.Default.gridColumnWidths=gridWidths.ToArray();
680-
Properties.Settings.Default.Save();
681+
Settings.Default.gridColumnWidths=gridWidths.ToArray();
682+
Settings.Default.Save();
681683

682684

683685
// save buildrepot column widths
684686
gridWidths.Clear();
685687

686688
// if we dont have any settings yet
687-
if(Properties.Settings.Default.gridColumnWidthsBuildReport!=null)
689+
if(Settings.Default.gridColumnWidthsBuildReport!=null)
688690
{
689-
gridWidths=newList<int>(Properties.Settings.Default.gridColumnWidthsBuildReport);
691+
gridWidths=newList<int>(Settings.Default.gridColumnWidthsBuildReport);
690692
}
691693
else
692694
{
@@ -697,7 +699,7 @@ private void SaveSettingsOnExit()
697699
column=gridBuildReport.Columns[0];
698700
for(inti=0;i<gridBuildReport.Columns.Count;++i)
699701
{
700-
if(Properties.Settings.Default.gridColumnWidthsBuildReport!=null&&Properties.Settings.Default.gridColumnWidthsBuildReport.Length>i)
702+
if(Settings.Default.gridColumnWidthsBuildReport!=null&&Settings.Default.gridColumnWidthsBuildReport.Length>i)
701703
{
702704
gridWidths[i]=(int)gridBuildReport.Columns[i].Width.Value;
703705
}
@@ -706,9 +708,9 @@ private void SaveSettingsOnExit()
706708
gridWidths.Add((int)gridBuildReport.Columns[i].Width.Value);
707709
}
708710
}
709-
Properties.Settings.Default.gridColumnWidthsBuildReport=gridWidths.ToArray();
710-
Properties.Settings.Default.projectName=projectNameSetting;
711-
Properties.Settings.Default.Save();
711+
Settings.Default.gridColumnWidthsBuildReport=gridWidths.ToArray();
712+
Settings.Default.projectName=projectNameSetting;
713+
Settings.Default.Save();
712714

713715
// make backup
714716
varconfig=ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
@@ -813,7 +815,7 @@ public void RefreshRecentProjects()
813815
// take currently selected project row
814816
lastSelectedProjectIndex=gridRecent.SelectedIndex;
815817
// rescan recent projects
816-
projectsSource=GetProjects.Scan(getGitBranch:(bool)chkShowGitBranchColumn.IsChecked,getPlasticBranch:(bool)chkCheckPlasticBranch.IsChecked,getArguments:(bool)chkShowLauncherArgumentsColumn.IsChecked,showMissingFolders:(bool)chkShowMissingFolderProjects.IsChecked,showTargetPlatform:(bool)chkShowPlatform.IsChecked,AllProjectPaths:Settings.Default.projectPaths,searchGitbranchRecursivly:(bool)chkGetGitBranchRecursively.IsChecked);
818+
projectsSource=GetProjects.Scan(getGitBranch:(bool)chkShowGitBranchColumn.IsChecked,getPlasticBranch:(bool)chkCheckPlasticBranch.IsChecked,getArguments:(bool)chkShowLauncherArgumentsColumn.IsChecked,showMissingFolders:(bool)chkShowMissingFolderProjects.IsChecked,showTargetPlatform:(bool)chkShowPlatform.IsChecked,AllProjectPaths:Settings.Default.projectPaths,searchGitbranchRecursivly:(bool)chkGetGitBranchRecursively.IsChecked,showSRP:(bool)chkCheckSRP.IsChecked);
817819
gridRecent.ItemsSource=projectsSource;
818820

819821
// fix sorting on refresh
@@ -3798,6 +3800,17 @@ private void CheckCustomIcon()
37983800
//Debug.WriteLine("Custom icon not found. Using default.");
37993801
}
38003802
}
3803+
3804+
privatevoidchkCheckSRP_Checked(objectsender,RoutedEventArgse)
3805+
{
3806+
if(this.IsActive==false)return;// dont run code on window init
3807+
3808+
gridRecent.Columns[7].Visibility=(bool)chkCheckSRP.IsChecked?Visibility.Visible:Visibility.Collapsed;
3809+
3810+
Settings.Default.checkSRP=(bool)chkCheckSRP.IsChecked;
3811+
Settings.Default.Save();
3812+
RefreshRecentProjects();
3813+
}
38013814
//private void menuProjectProperties_Click(object sender, RoutedEventArgs e)
38023815
//{
38033816
// var proj = GetSelectedProject();

‎UnityLauncherPro/Properties/Settings.Designer.cs‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎UnityLauncherPro/Properties/Settings.settings‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,8 @@
145145
<SettingName="useAlphaReleaseNotes"Type="System.Boolean"Scope="User">
146146
<ValueProfile="(Default)">True</Value>
147147
</Setting>
148+
<SettingName="checkSRP"Type="System.Boolean"Scope="User">
149+
<ValueProfile="(Default)">False</Value>
150+
</Setting>
148151
</Settings>
149152
</SettingsFile>

‎UnityLauncherPro/Tools.cs‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,34 @@ private static async Task<bool> DownloadFileAsync(string fileUrl, string destina
22872287
}
22882288
returnresult;
22892289
}
2290+
2291+
internalstaticstringGetSRP(stringprojectPath)
2292+
{
2293+
// read projectsettings/graphicsettings file, look for m_SRPDefaultSettings: value
2294+
varsettingsFile=Path.Combine(projectPath,"ProjectSettings","GraphicsSettings.asset");
2295+
if(File.Exists(settingsFile)==false)returnnull;
2296+
2297+
varallText=File.ReadAllText(settingsFile);
2298+
varsrpIndex=allText.IndexOf("m_SRPDefaultSettings:");
2299+
if(srpIndex==-1)returnnull;// BIRP
2300+
2301+
// urp = UnityEngine.Rendering.Universal.UniversalRenderPipeline
2302+
// hdrp = UnityEngine.Rendering.HighDefinition.HDRenderPipeline
2303+
2304+
if(allText.IndexOf("UnityEngine.Rendering.Universal.UniversalRenderPipeline",srpIndex)>-1)
2305+
{
2306+
return"URP";
2307+
}
2308+
elseif(allText.IndexOf("UnityEngine.Rendering.HighDefinition.HDRenderPipeline",srpIndex)>-1)
2309+
{
2310+
return"HDRP";
2311+
}
2312+
else
2313+
{
2314+
returnnull;// BIRP
2315+
}
2316+
2317+
}
22902318
}// class
22912319

22922320
}// namespace

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp