Git Product home page Git Product logo

optionfocusfix's Introduction

optionfocusfix's People

Contributors

lunatic-gh avatar commandgenius avatar

Watchers

 avatar

Forkers

commandgenius

optionfocusfix's Issues

Bugged Focusing on text-fields of external mods

First of all, i'm fully aware of this Issue. I'm going to do some explaining here, but please do not open any issue regarding this "bug".

There's a bug causing text-widgets of external mods to behave in a weird way, where they unfocus as soon as the mouse-button is released. THIS IS INTENDED BEHAVIOR!
The Reason this happens is that those text-fields have nothing to do with vanilla widgets. They entirely use their own base, with their only "connection" to the game being that they extend something like "Renderable" or "Widget".

What this mod does is injecting into the "ParentElement" class, listening for "mouseClicked" and "mouseReleased".

  • When clicked, it forcefully unfocuses all children-widgets of this element. This usually applies to lists, where "children" are the entries.
  • When released, it checks if the widget of question is an instance of "TextFieldWidget", which is the only text widget that vanilla has to offer. This applies to widgets themselves.
    • If it is, nothing will happen. This is to ensure that text fields aren't instantly unfocused after being clicked.
    • If it is not, it'll unfocus the element in question.

"But wait, if it ignores text fields, why does this happen?"
As mentioned above, a lot of modded widgets use their own base. They don't have anything in common with the vanilla "TextFieldWidget", usually only extending "Widget" or "ClickableWidget" or something similar.
This way, it is basically impossible for me to keep them apart from basically every other widget in the game.

The only mod i was able to verify this on by now is "Reeses Sodium Options" for the Search-Field, but there are very likely a lot more that i don't know of.

"What is the Alternative?"
There is really only one, which i really don't want do do. The only option is to manually add support for every single mod's widgets that this happens on.
This would Require an update every time a new mod with such behavior comes out, or a mod adds a new type of widget.
It should be obvious why this is not reasonable.

For now i'm going to "ignore" this. As said, there is no other option.
If in the future there comes something up, or you have an idea about this, feel free to comment on this issue with ideas.

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.