Beispiel #1
0
        /* Factory method for getting specific ActionEditorView subclass objects. */
        public static ActionEditorView getActionEditorView(SupplyChainAction action)
        {
            if (action.GetType() == typeof(SupplyLink))
            {
                return(new SupplyLinkEditor((SupplyLink)action));
            }
            else if (action.GetType() == typeof(ResourceTransferAction))
            {
                return(new ResourceTransferEditor((ResourceTransferAction)action));
            }

            return(null);
        }
        public static ActionStatusView getActionDetailsView(SupplyChainAction action)
        {
            if (action.GetType() == typeof(SupplyLink))
            {
                return(new SupplyLinkStatus((SupplyLink)action));
            }
            else if (action.GetType() == typeof(ResourceTransferAction))
            {
                return(new ResourceTransferStatus((ResourceTransferAction)action));
            }

            return(null);
        }
Beispiel #3
0
 private bool drawActionFireButton(SupplyChainAction act)
 {
     if (act.active)
     {
         GUILayout.Label(
             "Action In Progress...\n" +
             "T-" + UIStyle.formatTimespan(act.timeComplete - Planetarium.GetUniversalTime(), true) + " to completion",
             UIStyle.activeStyle);
         return(false);
     }
     else
     {
         if (act.canExecute())
         {
             return(GUILayout.Button("Execute Action", UIStyle.passableStyle));
         }
         else
         {
             GUILayout.Label("Execute Action", UIStyle.impassableStyle);
             return(false);
         }
     }
 }