示例#1
0
 private void ForceSelectPlm(int index)
 {
     if (ActiveRoomState?.MyPlmSet != null && index >= 0 &&
         index < ActiveRoomState.MyPlmSet.PlmCount)
     {
         PlmIndex  = index;
         ActivePlm = ActiveRoomState.MyPlmSet.Plms [PlmIndex];
         if (ActivePlm.MyPlmType?.Index == 0)
         {
             ActivePlm.MyPlmType.PlmID = ActivePlm.PlmID;
         }
         ForceSelectPlmType(ActivePlm.MyPlmType?.Index ?? IndexNone);
         if (ActivePlm.MyScrollPlmData != null)
         {
             int i = ScrollDatas.FindIndex(x => x == ActivePlm.MyScrollPlmData);
             ForceSelectScrollData(i);
         }
         else
         {
             ForceSelectScrollData(-1);
         }
     }
     else
     {
         PlmIndex  = IndexNone;
         ActivePlm = null;
         ForceSelectPlmType(IndexNone);
     }
 }
示例#2
0
 // Add scroll PLM data to active plm (if it is a scroll plm).
 public void AddScrollPlmData()
 {
     if (ActivePlm.MyScrollPlmData == null)
     {
         return;
     }
     if (ForceAddScrollPlmData())
     {
         HandlingSelection = true;
         int newIndex = ScrollDatas.FindIndex(x => x == ActivePlm.MyScrollPlmData);
         ForceSelectScrollData(newIndex);
         ScrollDataListChanged?.Invoke(this, new ListLoadEventArgs(newIndex));
         HandlingSelection = false;
     }
 }