Skip to content

Commit d9c8b96

Browse files
committed
Merge branch 'master' into darkviper
2 parents 2f3957d + 8952f9b commit d9c8b96

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

ChaosMod/Util/OptionsFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class OptionsFile
7373
std::ofstream file(m_FoundFileName);
7474
if (!file.is_open())
7575
{
76-
LOG("Couldn't write config file " << m_FoundFileName << " " << GetLastError());
76+
LOG("Couldn't write config file " << m_FoundFileName);
7777
return;
7878
}
7979
for (auto &[key, value] : m_Options)

ConfigApp/Tabs/ChaosGrid.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void SetRowHeight(GridLength gridLength)
5454
m_RowDefinitions[m_CurrentRow].Height = gridLength;
5555
}
5656

57-
private void PushRow(string? text, UIElement? control)
57+
private void PushRow(string? text, FrameworkElement? control, string? tooltip = null)
5858
{
5959
if (text != null)
6060
{
@@ -70,6 +70,10 @@ private void PushRow(string? text, UIElement? control)
7070

7171
textBlock.SetValue(Grid.ColumnProperty, m_CurrentColumn);
7272
textBlock.SetValue(Grid.RowProperty, m_CurrentRow);
73+
if (tooltip != null)
74+
{
75+
textBlock.ToolTip = new ToolTip { Content = tooltip };
76+
}
7377
Grid.Children.Add(textBlock);
7478

7579
m_CurrentColumn++;
@@ -89,6 +93,10 @@ private void PushRow(string? text, UIElement? control)
8993

9094
control.SetValue(Grid.ColumnProperty, m_CurrentColumn);
9195
control.SetValue(Grid.RowProperty, m_CurrentRow);
96+
if (tooltip != null)
97+
{
98+
control.ToolTip = new ToolTip { Content = tooltip };
99+
}
92100
Grid.Children.Add(control);
93101

94102
m_CurrentColumn++;
@@ -122,12 +130,12 @@ public void PushRowEmptyPair()
122130
m_CurrentColumn += 3;
123131
}
124132

125-
public void PushRowElement(UIElement element)
133+
public void PushRowElement(FrameworkElement element)
126134
{
127135
PushRow(null, element);
128136
}
129137

130-
public void PushRowExpandElement(UIElement element)
138+
public void PushRowExpandElement(FrameworkElement element)
131139
{
132140
element.ClipToBounds = false;
133141

@@ -136,20 +144,20 @@ public void PushRowExpandElement(UIElement element)
136144
PushRow(null, canvas);
137145
}
138146

139-
public void PushRowPair(string text, UIElement element)
147+
public void PushRowPair(string text, FrameworkElement element)
140148
{
141149
PushRow(text, element);
142150
}
143151

144-
public void PushRowSpacedPair(string text, UIElement element)
152+
public void PushRowSpacedPair(string text, FrameworkElement element, string? tooltip = null)
145153
{
146-
PushRow(text, null);
154+
PushRow(text, null, tooltip);
147155
PushRowEmpty();
148156

149157
element.SetValue(FrameworkElement.HorizontalAlignmentProperty, HorizontalAlignment.Left);
150158
element.SetValue(FrameworkElement.VerticalAlignmentProperty, VerticalAlignment.Center);
151159

152-
PushRow(null, element);
160+
PushRow(null, element, tooltip);
153161
}
154162

155163
public void PushRowTextBlock(string text)

ConfigApp/Tabs/Settings/ModesTab.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static ChaosGrid createCommonGrid()
109109
body.Children.Add(m_DistanceGrid.Grid);
110110

111111
var footerGrid = createCommonGrid();
112-
footerGrid.PushRowSpacedPair("Enable Crossing Challenge™", m_EnableCrossingChallenge = Utils.GenerateCommonCheckBox());
112+
footerGrid.PushRowSpacedPair("Enable Crossing Challenge™", m_EnableCrossingChallenge = Utils.GenerateCommonCheckBox(), "Set respawn and finish points on the map. Reach the finish point without dying to win.");
113113
grid.PushRowElement(footerGrid.Grid);
114114

115115
scrollViewer.Content = grid.Grid;

ConfigApp/Workshop/WorkshopEditDialog.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ string handleEffectId(string itemName)
137137
if (file.Type == WorkshopSubmissionFileType.Sound)
138138
{
139139
var effectId = itemName;
140-
if (!Effects.EffectsMap.ContainsKey(effectId))
140+
if (!Effects.EffectsMap.ContainsKey(effectId) && itemName.Length > 4)
141141
effectId = itemName[..^4];
142142
if (Effects.EffectsMap.ContainsKey(effectId))
143143
itemName += $" ({Effects.EffectsMap[effectId].Name})";

ConfigApp/Workshop/WorkshopSubmissionItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void UpdateSearchTerms()
157157
{
158158
foreach (var line in File.ReadAllLines(m_FileHandler.SubmissionDirectory + file.Name))
159159
{
160-
var match = Regex.Match(line, @"(?:Name|ScriptId)\s*=\s*""((?:\\""|[^""])+)""");
160+
var match = Regex.Match(line, @"(?:Name|ScriptId|EffectId)\s*=\s*""((?:\\""|[^""])+)""");
161161
if (match.Success)
162162
{
163163
SearchTerms.Add(new(match.Groups[1].Value, file.Name));

0 commit comments

Comments
 (0)