Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix adding multiple rail points on click #77

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions Fushigi/ui/widgets/LevelViewport.cs
Original file line number Diff line number Diff line change
@@ -773,21 +773,16 @@ void DrawAreaContent()
}
}
}

ISceneObject? newHoveredSceneObj = null;

areaScene.ForEach<IViewportDrawable>(obj =>
{
bool isNewHoveredObj = false;
obj.Draw2D(mEditContext, this, mDrawList, ref isNewHoveredObj);
if (isNewHoveredObj)
newHoveredObject = obj;
});

if (newHoveredSceneObj is not null)
newHoveredObject = newHoveredSceneObj;
}

areaScene.ForEach<IViewportDrawable>(obj =>
{
bool isNewHoveredObj = false;
obj.Draw2D(mEditContext, this, mDrawList, ref isNewHoveredObj);
if (isNewHoveredObj)
newHoveredObject = obj;
});

if (mArea.mRailHolder.mRails.Count > 0)
{
uint color = Color.HotPink.ToAbgr();

Unchanged files with check annotations Beta

{
if (!FileExists(path))
{
return null;

Check warning on line 125 in SARC/SARC.cs

GitHub Actions / build

Possible null reference return.

Check warning on line 125 in SARC/SARC.cs

GitHub Actions / build

Possible null reference return.

Check warning on line 125 in SARC/SARC.cs

GitHub Actions / build

Possible null reference return.

Check warning on line 125 in SARC/SARC.cs

GitHub Actions / build

Possible null reference return.
}
SARCFile file = Files[path];
public IBymlNode? PathArray;
private BymlHeader Header;
public Byml(MemoryStream stream)

Check warning on line 55 in Fushigi.Byml/Byml.cs

GitHub Actions / build

Non-nullable field 'Root' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 55 in Fushigi.Byml/Byml.cs

GitHub Actions / build

Non-nullable field 'Root' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 55 in Fushigi.Byml/Byml.cs

GitHub Actions / build

Non-nullable field 'Root' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 55 in Fushigi.Byml/Byml.cs

GitHub Actions / build

Non-nullable field 'Root' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
stream.Read(Utils.AsSpan(ref Header));
{
public class BymlObject
{
public BymlHashTable HashTable;

Check warning on line 12 in Fushigi.Byml/Serializer/BymlObject.cs

GitHub Actions / build

Non-nullable field 'HashTable' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 12 in Fushigi.Byml/Serializer/BymlObject.cs

GitHub Actions / build

Non-nullable field 'HashTable' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 12 in Fushigi.Byml/Serializer/BymlObject.cs

GitHub Actions / build

Non-nullable field 'HashTable' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 12 in Fushigi.Byml/Serializer/BymlObject.cs

GitHub Actions / build

Non-nullable field 'HashTable' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
public void Load(BymlHashTable bymlHashTable) {
this.HashTable = bymlHashTable;
public string Key { get; set; }
public object DefaultValue { get; set; }
public BymlProperty() { }

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 14 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public BymlProperty(string key)

Check warning on line 16 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 16 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 16 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 16 in Fushigi.Byml/Serializer/BymlProperty.cs

GitHub Actions / build

Non-nullable property 'DefaultValue' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
{
Key = key;
}
continue;
Type type = properties[i].PropertyType;
Type nullableType = Nullable.GetUnderlyingType(type);

Check warning on line 43 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 43 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 43 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 43 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.
if (nullableType != null)
type = nullableType;
string name = byamlAttribute != null && byamlAttribute.Key != null ? byamlAttribute.Key : properties[i].Name;
//Skip properties that are not present
if (!hashTable.ContainsKey(name))

Check warning on line 51 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 51 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Dereference of a possibly null reference.
continue;
SetValues(properties[i], type, obj, hashTable[name]);
{
var values = value as BymlArrayNode;
var vec3 = new System.Numerics.Vector3(
((dynamic)values[0]).Data,

Check warning on line 66 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 66 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Dereference of a possibly null reference.
((dynamic)values[0]).Data,
((dynamic)values[0]).Data);
SetValue(property, section, vec3);
}
else
{
var list = (value as BymlArrayNode).Array;

Check warning on line 73 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 73 in Fushigi.Byml/Serializer/BymlSerialize.cs

GitHub Actions / build

Dereference of a possibly null reference.
var array = InstantiateType<IList>(type);
Type elementType = type.GetTypeInfo().GetElementType();
private MsbtHeader Header;
public MsbtFile(string filePath) {

Check warning on line 35 in Fushigi.Msbt/MsbtFile.cs

GitHub Actions / build

Non-nullable field 'AttributeData' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 35 in Fushigi.Msbt/MsbtFile.cs

GitHub Actions / build

Non-nullable field 'AttributeData' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
Read(File.OpenRead(filePath));
}
public MsbtFile(Stream stream) {

Check warning on line 39 in Fushigi.Msbt/MsbtFile.cs

GitHub Actions / build

Non-nullable field 'AttributeData' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 39 in Fushigi.Msbt/MsbtFile.cs

GitHub Actions / build

Non-nullable field 'AttributeData' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
Read(stream);
}
}
else
{
node = rootAsArray[i];

Check warning on line 213 in Fushigi.Byml/BymlWriter.cs

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 213 in Fushigi.Byml/BymlWriter.cs

GitHub Actions / build

Dereference of a possibly null reference.
}
if (node is BymlArrayNode || node is BymlHashTable)