implicit types

This commit is contained in:
Raymond 2021-10-03 11:09:52 -04:00
parent 2c4f858ced
commit d10a6dab82
2 changed files with 10 additions and 10 deletions

View file

@ -149,10 +149,10 @@ namespace Dalamud.Interface.Internal
foreach (var tag in pluginCategoryTags) foreach (var tag in pluginCategoryTags)
{ {
// only tags from whitelist can be accepted // only tags from whitelist can be accepted
int matchIdx = Array.FindIndex(this.CategoryList, x => x.Tag.Equals(tag, StringComparison.InvariantCultureIgnoreCase)); var matchIdx = Array.FindIndex(this.CategoryList, x => x.Tag.Equals(tag, StringComparison.InvariantCultureIgnoreCase));
if (matchIdx >= 0) if (matchIdx >= 0)
{ {
int categoryId = this.CategoryList[matchIdx].CategoryId; var categoryId = this.CategoryList[matchIdx].CategoryId;
if (categoryId >= FirstTagBasedCategoryId) if (categoryId >= FirstTagBasedCategoryId)
{ {
categoryList.Add(categoryId); categoryList.Add(categoryId);
@ -202,7 +202,7 @@ namespace Dalamud.Interface.Internal
{ {
var groupInfo = this.groupList[this.currentGroupIdx]; var groupInfo = this.groupList[this.currentGroupIdx];
bool includeAll = (this.currentCategoryIdx == 0) || (groupInfo.GroupKind != GroupKind.Available); var includeAll = (this.currentCategoryIdx == 0) || (groupInfo.GroupKind != GroupKind.Available);
if (includeAll) if (includeAll)
{ {
result.AddRange(plugins); result.AddRange(plugins);
@ -215,7 +215,7 @@ namespace Dalamud.Interface.Internal
{ {
if (this.mapPluginCategories.TryGetValue(plugin, out var pluginCategoryIds)) if (this.mapPluginCategories.TryGetValue(plugin, out var pluginCategoryIds))
{ {
int matchIdx = Array.IndexOf(pluginCategoryIds, selectedCategoryInfo.CategoryId); var matchIdx = Array.IndexOf(pluginCategoryIds, selectedCategoryInfo.CategoryId);
if (matchIdx >= 0) if (matchIdx >= 0)
{ {
result.Add(plugin); result.Add(plugin);

View file

@ -610,10 +610,10 @@ namespace Dalamud.Interface.Internal.Windows
private void DrawPluginCategories() private void DrawPluginCategories()
{ {
float useContentHeight = -40; // button height + spacing var useContentHeight = -40f; // button height + spacing
float useMenuWidth = 180; // works fine as static value, table can be resized by user var useMenuWidth = 180f; // works fine as static value, table can be resized by user
float useContentWidth = ImGui.GetContentRegionAvail().X; var useContentWidth = ImGui.GetContentRegionAvail().X;
if (ImGui.BeginChild("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale))) if (ImGui.BeginChild("InstallerCategories", new Vector2(useContentWidth, useContentHeight * ImGuiHelpers.GlobalScale)))
{ {
@ -654,7 +654,7 @@ namespace Dalamud.Interface.Internal.Windows
} }
} }
for (int groupIdx = 0; groupIdx < this.categoryManager.GroupList.Length; groupIdx++) for (var groupIdx = 0; groupIdx < this.categoryManager.GroupList.Length; groupIdx++)
{ {
var groupInfo = this.categoryManager.GroupList[groupIdx]; var groupInfo = this.categoryManager.GroupList[groupIdx];
var canShowGroup = (groupInfo.GroupKind != PluginCategoryManager.GroupKind.DevTools) || this.hasDevPlugins; var canShowGroup = (groupInfo.GroupKind != PluginCategoryManager.GroupKind.DevTools) || this.hasDevPlugins;
@ -673,11 +673,11 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Indent(); ImGui.Indent();
var categoryItemSize = new Vector2(ImGui.GetContentRegionAvail().X - (5 * ImGuiHelpers.GlobalScale), ImGui.GetTextLineHeight()); var categoryItemSize = new Vector2(ImGui.GetContentRegionAvail().X - (5 * ImGuiHelpers.GlobalScale), ImGui.GetTextLineHeight());
for (int categoryIdx = 0; categoryIdx < groupInfo.Categories.Count; categoryIdx++) for (var categoryIdx = 0; categoryIdx < groupInfo.Categories.Count; categoryIdx++)
{ {
var categoryInfo = Array.Find(this.categoryManager.CategoryList, x => x.CategoryId == groupInfo.Categories[categoryIdx]); var categoryInfo = Array.Find(this.categoryManager.CategoryList, x => x.CategoryId == groupInfo.Categories[categoryIdx]);
bool hasSearchHighlight = this.categoryManager.IsCategoryHighlighted(categoryInfo.CategoryId); var hasSearchHighlight = this.categoryManager.IsCategoryHighlighted(categoryInfo.CategoryId);
if (hasSearchHighlight) if (hasSearchHighlight)
{ {
ImGui.PushStyleColor(ImGuiCol.Text, colorSearchHighlight); ImGui.PushStyleColor(ImGuiCol.Text, colorSearchHighlight);