Git Product home page Git Product logo

Comments (6)

ashblue avatar ashblue commented on August 11, 2024 1

Connected PR hits most of this. I'll cross reference the code you posted when I run through it.

from fluid-behavior-tree.

ashblue avatar ashblue commented on August 11, 2024

Great first issue if somebody wants to tackle it.

from fluid-behavior-tree.

wihu avatar wihu commented on August 11, 2024

any update on this? the PR seems stalled..

from fluid-behavior-tree.

ashblue avatar ashblue commented on August 11, 2024

Haven't touched any AI for a while so I've been working on other libraries. Somebody pushed up a PR to get this going but it still needs some work.

from fluid-behavior-tree.

ashblue avatar ashblue commented on August 11, 2024

Issue is mostly done here. Needs some cleanup to be finished #69

from fluid-behavior-tree.

JeremyVansnick avatar JeremyVansnick commented on August 11, 2024

In order to make dark mode easily visible I changed the colors of the NodeFaders based on whether the dark mode is on or not.

using UnityEditor;
using UnityEngine;

namespace CleverCrow.Fluid.BTs.Trees.Editors {

    public class NodeFaders {
        public ColorFader BackgroundFader { get; } = new ColorFader(
            EditorGUIUtility.isProSkin ?
            new Color(0, 0f, 0.8f) : new Color(0.65f, 0.65f, 0.65f), 
            EditorGUIUtility.isProSkin ? 
                new Color(0f, 1f, 0f) : new Color(0.39f, 0.78f, 0.39f));
        
        public ColorFader TextFader { get; } = new ColorFader(
            EditorGUIUtility.isProSkin ?
                Color.black : Color.white,
            EditorGUIUtility.isProSkin ?
                Color.white : Color.black);
        
        public ColorFader MainIconFader { get; } = new ColorFader(
            new Color(1, 1, 1, 0.3f), new Color(1, 1, 1, 1f));
        
        public ColorFader LastStatusFader { get; } = new ColorFader(
                Color.grey, Color.white);

        public void Update (bool active) {
            BackgroundFader.Update(active);
            TextFader.Update(active);
            MainIconFader.Update(active);
            LastStatusFader.Update(active);
        }
    }
}

I made the StatusIcons saturated and managed their darkness through code (they were really dark which didn't fit for dark mode):
image

Finally, because the last task status overlaps with the names of tasks if the text is long, I put the task status at the top right of the nodes.

public class NodePrintController {     
private void PrintLastStatus (Rect rect) {
            const float sidePadding = 1.5f;

            var icon = BehaviorTreePrinter.StatusIcons.GetIcon(_node.Task.LastStatus);
            icon.Paint(
                new Rect(
                    rect.x + rect.size.x - icon.Texture.width - sidePadding,
                    // rect.y + rect.size.y - icon.Texture.height - sidePadding, // original code
                    rect.y, // new code
                    icon.Texture.width, icon.Texture.height),
                _faders.LastStatusFader.CurrentColor);
        }
}
       

from fluid-behavior-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.