Skip to content
Snippets Groups Projects

Merge Request for Issue/13 - dynamic list item removed

Merged Heine, Eric R requested to merge issue/13-dynamic-list-item-removed into master
All threads resolved!
1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
@@ -48,6 +48,7 @@ namespace Shared.SEUI {
@@ -48,6 +48,7 @@ namespace Shared.SEUI {
// Remove the given item from the list (if it is in the list)
// Remove the given item from the list (if it is in the list)
public void RemoveItem(TValueType item) {
public void RemoveItem(TValueType item) {
if (listItems.ContainsKey(item)) {
if (listItems.ContainsKey(item)) {
 
+3
OnItemRemoved(item, listItems[item]);
Destroy(listItems[item].gameObject);
Destroy(listItems[item].gameObject);
listItems.Remove(item);
listItems.Remove(item);
}
}
@@ -55,6 +56,10 @@ namespace Shared.SEUI {
@@ -55,6 +56,10 @@ namespace Shared.SEUI {
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Implement if the list needs to do something to the DynamicListItem after it has been added to the list
// Implement if the list needs to do something to the DynamicListItem after it has been added to the list
protected virtual void OnItemAdded(TValueType item, TDynamicListItem itemUI) { }
protected virtual void OnItemAdded(TValueType item, TDynamicListItem itemUI) {}
 
 
// --------------------------------------------------------------------------
 
// Implement if the list needs to do something to the DynamicListItem after it has been removed from the list
 
protected virtual void OnItemRemoved(TValueType item, TDynamicListItem itemUI) {}
}
}
}
}
Loading