Fix actions not initially appearing (#19990)
This commit is contained in:
@@ -67,7 +67,7 @@ namespace Content.Client.Actions
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
component.Actions.Clear();
|
component.Actions.Clear();
|
||||||
component.Actions.UnionWith(GetEntitySet(state.Actions));
|
component.Actions.UnionWith(EnsureEntitySet<ActionsComponent>(state.Actions, uid));
|
||||||
|
|
||||||
_actionHoldersQueue.Enqueue(uid);
|
_actionHoldersQueue.Enqueue(uid);
|
||||||
}
|
}
|
||||||
@@ -200,28 +200,6 @@ namespace Content.Client.Actions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public void SaveActionAssignments(string path)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Currently only tested with temporary innate actions (i.e., mapping actions). No guarantee it works with
|
|
||||||
// other actions. If its meant to be used for full game state saving/loading, the entity that provides
|
|
||||||
// actions needs to keep the same uid.
|
|
||||||
|
|
||||||
var sequence = new SequenceDataNode();
|
|
||||||
|
|
||||||
foreach (var (action, assigns) in Assignments.Assignments)
|
|
||||||
{
|
|
||||||
var slot = new MappingDataNode();
|
|
||||||
slot.Add("action", _serializationManager.WriteValue(action));
|
|
||||||
slot.Add("assignments", _serializationManager.WriteValue(assigns));
|
|
||||||
sequence.Add(slot);
|
|
||||||
}
|
|
||||||
|
|
||||||
using var writer = _resourceManager.UserData.OpenWriteText(new ResourcePath(path).ToRootedPath());
|
|
||||||
var stream = new YamlStream { new(sequence.ToSequenceNode()) };
|
|
||||||
stream.Save(new YamlMappingFix(new Emitter(writer)), false);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Load actions and their toolbar assignments from a file.
|
/// Load actions and their toolbar assignments from a file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user