fix: Removes scoped for gump AppendTo (#1405)
### Summary .NET 6 had a bug that required the `scoped` keyword for the gump AppendTo. It looks like this was fixed since then.
This commit is contained in:
parent
35237ff7d1
commit
a7edba3712
27 changed files with 29 additions and 29 deletions
4
.github/workflows/build-test.yml
vendored
4
.github/workflows/build-test.yml
vendored
|
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- name: Setup .NET 7
|
- name: Setup .NET 7
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 7.0.202
|
dotnet-version: 7.0.302
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./publish.cmd Release
|
run: ./publish.cmd Release
|
||||||
- name: Migration Changes
|
- name: Migration Changes
|
||||||
|
|
@ -75,7 +75,7 @@ jobs:
|
||||||
- name: Setup .NET 7
|
- name: Setup .NET 7
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 7.0.202
|
dotnet-version: 7.0.302
|
||||||
- name: Build
|
- name: Build
|
||||||
run: ./publish.sh Release
|
run: ./publish.sh Release
|
||||||
- name: Test
|
- name: Test
|
||||||
|
|
|
||||||
2
.github/workflows/create-release.yml
vendored
2
.github/workflows/create-release.yml
vendored
|
|
@ -17,7 +17,7 @@ jobs:
|
||||||
- name: Setup .NET 7
|
- name: Setup .NET 7
|
||||||
uses: actions/setup-dotnet@v3
|
uses: actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: 7.0.202
|
dotnet-version: 7.0.302
|
||||||
- name: Install NGBV
|
- name: Install NGBV
|
||||||
uses: dotnet/nbgv@master
|
uses: dotnet/nbgv@master
|
||||||
id: nbgv
|
id: nbgv
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class GumpAlphaRegion : GumpEntry
|
||||||
|
|
||||||
public int Height { get; set; }
|
public int Height { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ checkertrans {X} {Y} {Width} {Height} }}");
|
writer.WriteAscii($"{{ checkertrans {X} {Y} {Width} {Height} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class GumpBackground : GumpEntry
|
||||||
|
|
||||||
public int GumpID { get; set; }
|
public int GumpID { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ resizepic {X} {Y} {GumpID} {Width} {Height} }}");
|
writer.WriteAscii($"{{ resizepic {X} {Y} {GumpID} {Width} {Height} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public class GumpButton : GumpEntry
|
||||||
|
|
||||||
public int Param { get; set; }
|
public int Param { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ button {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} }}");
|
writer.WriteAscii($"{{ button {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class GumpCheck : GumpEntry
|
||||||
|
|
||||||
public int SwitchID { get; set; }
|
public int SwitchID { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var initialState = InitialState ? "1" : "0";
|
var initialState = InitialState ? "1" : "0";
|
||||||
writer.WriteAscii($"{{ checkbox {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}");
|
writer.WriteAscii($"{{ checkbox {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}");
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public class GumpECHandleInput : GumpEntry
|
||||||
{
|
{
|
||||||
private static byte[] _layout = Gump.StringToBuffer("{ echandleinput }");
|
private static byte[] _layout = Gump.StringToBuffer("{ echandleinput }");
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.Write(_layout);
|
writer.Write(_layout);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,5 @@ public abstract class GumpEntry
|
||||||
|
|
||||||
// TODO: Replace OrderedHashSet with InsertOnlyHashSet, a copy of HashSet that is ReadOnly compatible, but includes
|
// TODO: Replace OrderedHashSet with InsertOnlyHashSet, a copy of HashSet that is ReadOnly compatible, but includes
|
||||||
// a public AddIfNotPresent function that returns the index of the element
|
// a public AddIfNotPresent function that returns the index of the element
|
||||||
public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches);
|
public abstract void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class GumpGroup : GumpEntry
|
||||||
|
|
||||||
public int Group { get; set; }
|
public int Group { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
if (Group == 1)
|
if (Group == 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class GumpHtml : GumpEntry
|
||||||
|
|
||||||
public bool Scrollbar { get; set; }
|
public bool Scrollbar { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var textIndex = strings.GetOrAdd(Text ?? "");
|
var textIndex = strings.GetOrAdd(Text ?? "");
|
||||||
var background = Background ? "1" : "0";
|
var background = Background ? "1" : "0";
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ public class GumpHtmlLocalized : GumpEntry
|
||||||
public GumpHtmlLocalizedType Type { get; set; }
|
public GumpHtmlLocalizedType Type { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var background = Background ? "1" : "0";
|
var background = Background ? "1" : "0";
|
||||||
var scrollbar = Scrollbar ? "1" : "0";
|
var scrollbar = Scrollbar ? "1" : "0";
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class GumpImage : GumpEntry
|
||||||
|
|
||||||
public string Class { get; set; }
|
public string Class { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var hasHue = Hue != 0;
|
var hasHue = Hue != 0;
|
||||||
var hasClass = !string.IsNullOrEmpty(Class);
|
var hasClass = !string.IsNullOrEmpty(Class);
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ public class GumpImageTileButton : GumpEntry
|
||||||
|
|
||||||
public int Height { get; set; }
|
public int Height { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii(
|
writer.WriteAscii(
|
||||||
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}"
|
$"{{ buttontileart {X} {Y} {NormalID} {PressedID} {(int)Type} {Param} {ButtonID} {ItemID} {Hue} {Width} {Height} }}"
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class GumpImageTiled : GumpEntry
|
||||||
|
|
||||||
public int GumpID { get; set; }
|
public int GumpID { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ gumppictiled {X} {Y} {Width} {Height} {GumpID} }}");
|
writer.WriteAscii($"{{ gumppictiled {X} {Y} {Width} {Height} {GumpID} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class GumpItem : GumpEntry
|
||||||
|
|
||||||
public int Hue { get; set; }
|
public int Hue { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii(Hue == 0 ? $"{{ tilepic {X} {Y} {ItemID} }}" : $"{{ tilepichue {X} {Y} {ItemID} {Hue} }}");
|
writer.WriteAscii(Hue == 0 ? $"{{ tilepic {X} {Y} {ItemID} }}" : $"{{ tilepichue {X} {Y} {ItemID} {Hue} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public class GumpItemProperty : GumpEntry
|
||||||
|
|
||||||
public Serial Serial { get; set; }
|
public Serial Serial { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ itemproperty {Serial.Value} }}");
|
writer.WriteAscii($"{{ itemproperty {Serial.Value} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class GumpLabel : GumpEntry
|
||||||
|
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var textIndex = strings.GetOrAdd(Text ?? "");
|
var textIndex = strings.GetOrAdd(Text ?? "");
|
||||||
writer.WriteAscii($"{{ text {X} {Y} {Hue} {textIndex} }}");
|
writer.WriteAscii($"{{ text {X} {Y} {Hue} {textIndex} }}");
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class GumpLabelCropped : GumpEntry
|
||||||
|
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var textIndex = strings.GetOrAdd(Text ?? "");
|
var textIndex = strings.GetOrAdd(Text ?? "");
|
||||||
writer.WriteAscii($"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {textIndex} }}");
|
writer.WriteAscii($"{{ croppedtext {X} {Y} {Width} {Height} {Hue} {textIndex} }}");
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public class GumpMasterGump : GumpEntry
|
||||||
|
|
||||||
public int GumpID { get; set; }
|
public int GumpID { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ mastergump {GumpID} }}");
|
writer.WriteAscii($"{{ mastergump {GumpID} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class GumpPage : GumpEntry
|
||||||
|
|
||||||
public int Page { get; set; }
|
public int Page { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
if (Page == 0)
|
if (Page == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class GumpRadio : GumpEntry
|
||||||
|
|
||||||
public int SwitchID { get; set; }
|
public int SwitchID { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var initialState = InitialState ? "1" : "0";
|
var initialState = InitialState ? "1" : "0";
|
||||||
writer.WriteAscii($"{{ radio {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}");
|
writer.WriteAscii($"{{ radio {X} {Y} {InactiveID} {ActiveID} {initialState} {SwitchID} }}");
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class GumpSpriteImage : GumpEntry
|
||||||
|
|
||||||
public int SY { get; set; }
|
public int SY { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii($"{{ picinpic {X} {Y} {GumpID} {Width} {Height} {SX} {SY} }}");
|
writer.WriteAscii($"{{ picinpic {X} {Y} {GumpID} {Width} {Height} {SX} {SY} }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class GumpTextEntry : GumpEntry
|
||||||
|
|
||||||
public string InitialText { get; set; }
|
public string InitialText { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
||||||
writer.WriteAscii($"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} }}");
|
writer.WriteAscii($"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} }}");
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ public class GumpTextEntryLimited : GumpEntry
|
||||||
|
|
||||||
public int Size { get; set; }
|
public int Size { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
var textIndex = strings.GetOrAdd(InitialText ?? "");
|
||||||
writer.WriteAscii($"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} {Size} }}");
|
writer.WriteAscii($"{{ textentrylimited {X} {Y} {Width} {Height} {Hue} {EntryID} {textIndex} {Size} }}");
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public class GumpTooltip : GumpEntry
|
||||||
|
|
||||||
public string Args { get; set; }
|
public string Args { get; set; }
|
||||||
|
|
||||||
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, scoped ref int entries, scoped ref int switches)
|
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
|
||||||
{
|
{
|
||||||
writer.WriteAscii(string.IsNullOrEmpty(Args) ? $"{{ tooltip {Number} }}" : $"{{ tooltip {Number} @{Args}@ }}");
|
writer.WriteAscii(string.IsNullOrEmpty(Args) ? $"{{ tooltip {Number} }}" : $"{{ tooltip {Number} @{Args}@ }}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,11 @@ ModernUO [](https://archlinux.org/download/)
|
[](https://archlinux.org/download/)
|
||||||
|
|
||||||
#### Running the server
|
#### Running the server
|
||||||
[](https://dotnet.microsoft.com/download/dotnet/7.0)
|
[](https://dotnet.microsoft.com/download/dotnet/7.0)
|
||||||
|
|
||||||
#### Development
|
#### Development
|
||||||
[](https://git-scm.com/downloads)
|
[](https://git-scm.com/downloads)
|
||||||
[](https://dotnet.microsoft.com/download/dotnet/7.0)
|
[](https://dotnet.microsoft.com/download/dotnet/7.0)
|
||||||
|
|
||||||
#### Supported IDEs
|
#### Supported IDEs
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
displayName: 'Install .NET 7'
|
displayName: 'Install .NET 7'
|
||||||
inputs:
|
inputs:
|
||||||
packageType: sdk
|
packageType: sdk
|
||||||
version: 7.0.202
|
version: 7.0.302
|
||||||
- task: NuGetAuthenticate@1
|
- task: NuGetAuthenticate@1
|
||||||
- script: ./publish.cmd Release
|
- script: ./publish.cmd Release
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue