예제 #1
0
        ///<summary> Add electric charge sub-panel, including tooltips </summary>
        private static void AddSubPanelEC(Panel p)
        {
            // get simulated resource
            SimulatedResource res = resource_sim.Resource("ElectricCharge");

            // create tooltip
            string tooltip = res.Tooltip();

            // render the panel section
            p.AddSection(Local.Planner_ELECTRICCHARGE);                                         //"ELECTRIC CHARGE"
            p.AddContent(Local.Planner_storage, Lib.HumanReadableAmount(res.storage), tooltip); //"storage"
            p.AddContent(Local.Planner_consumed, Lib.HumanReadableRate(res.consumed), tooltip); //"consumed"
            p.AddContent(Local.Planner_produced, Lib.HumanReadableRate(res.produced), tooltip); //"produced"
            p.AddContent(Local.Planner_duration, Lib.HumanReadableDuration(res.Lifetime()));    //"duration"
        }
예제 #2
0
        ///<summary> Add supply resource sub-panel, including tooltips </summary>
        ///<remarks>
        /// does not include electric charge
        /// does not include special resources like waste atmosphere
        /// restricted to resources that are configured explicitly in the profile as supplies
        ///</remarks>
        private static void AddSubPanelResource(Panel p, string res_name)
        {
            // get simulated resource
            SimulatedResource res = resource_sim.Resource(res_name);

            // create tooltip
            string tooltip = res.Tooltip();

            // render the panel section
            p.AddSection(Lib.SpacesOnCaps(res_name).ToUpper(), string.Empty,
                         () => { p.Prev(ref resource_index, panel_resource.Count); update = true; },
                         () => { p.Next(ref resource_index, panel_resource.Count); update = true; });
            p.AddContent("storage", Lib.HumanReadableAmount(res.storage), tooltip);
            p.AddContent("consumed", Lib.HumanReadableRate(res.consumed), tooltip);
            p.AddContent("produced", Lib.HumanReadableRate(res.produced), tooltip);
            p.AddContent("duration", Lib.HumanReadableDuration(res.Lifetime()));
        }
예제 #3
0
        ///<summary> Add supply resource sub-panel, including tooltips </summary>
        ///<remarks>
        /// does not include electric charge
        /// does not include special resources like waste atmosphere
        /// restricted to resources that are configured explicitly in the profile as supplies
        ///</remarks>
        private static void AddSubPanelResource(Panel p, string res_name)
        {
            // get simulated resource
            SimulatedResource res = resource_sim.Resource(res_name);

            // create tooltip
            string tooltip = res.Tooltip();

            var resource = PartResourceLibrary.Instance.resourceDefinitions[res_name];

            // render the panel section
            p.AddSection(Lib.SpacesOnCaps(resource.displayName).ToUpper(), string.Empty,
                         () => { p.Prev(ref resource_index, panel_resource.Count); enforceUpdate = true; },
                         () => { p.Next(ref resource_index, panel_resource.Count); enforceUpdate = true; });
            p.AddContent(Local.Planner_storage, Lib.HumanReadableAmount(res.storage), tooltip);         //"storage"
            p.AddContent(Local.Planner_consumed, Lib.HumanReadableRate(res.consumed), tooltip);         //"consumed"
            p.AddContent(Local.Planner_produced, Lib.HumanReadableRate(res.produced), tooltip);         //"produced"
            p.AddContent(Local.Planner_duration, Lib.HumanReadableDuration(res.Lifetime()));            //"duration"
        }