Giter VIP home page Giter VIP logo

Comments (8)

gfgtdf avatar gfgtdf commented on April 27, 2024

I assume this is a request about the addon manager and not the campaign selection screen?

from wesnoth.

jostephd avatar jostephd commented on April 27, 2024

This should be pretty straightforward. The addon manager is implemented in src/gui/dialogs/addon/manager.cpp and src/gui/dialogs/addon/manager.cpp; it already shows the list of translations, all that's needed is to add some UI to match against them.

from wesnoth.

CelticMinstrel avatar CelticMinstrel commented on April 27, 2024

Probably in the filter UI?

from wesnoth.

jostephd avatar jostephd commented on April 27, 2024

Yeah, the value of the search textbox could be matched against the text in the "Translations" label. Or maybe a dropdown could be added. A dropdown would have the advantage that a player could filter for several languages at once ("Campaigns with either Danish or Swedish translation").

from wesnoth.

CelticMinstrel avatar CelticMinstrel commented on April 27, 2024

Yeah, filtering for multiple languages is probably a good idea, and even if you didn't want to support that, I think a dropdown is better. Actually... maybe this is a place where a combobox would be the best choice - basically a cross between a text field and a combobox, so they can either pick a language from the menu or type in a language code in the text field.

from wesnoth.

Kingofd avatar Kingofd commented on April 27, 2024

Hello,
I am interested in adding this feature.
I am thinking of adding a dropdown, similar to the "Type"-dropdown.

"None"-translations will default to English translation.

As I am new could you give me some pointers as to where stuff is added to the UI?

from wesnoth.

soliton- avatar soliton- commented on April 27, 2024

Did you take a look at src/gui/dialogs/addon/manager.cpp as mentioned by jostephd above? Anything specific you're missing? The related config is in data/gui/window/addon_manager.cfg in case you haven't found it.

from wesnoth.

Kingofd avatar Kingofd commented on April 27, 2024

@soliton- Thx, addon_manager.cfg was what I was missing

So the feature is done, however I need to iron out some bugs and unwanted behaviour:

Firstly: When I select multiple languages, it can happen, that the list, where the addons are shown does not expand to fit the newly selected addons that fit the language filter and it throws the following error:
20220831 15:14:04 error gui/layout: grid [] place: Failed to place a grid, we have (1031,59) space but we need (1920,59) space. This happened at a grid with the id '' in a 'N4gui24gridE' with the id '' in a 'N4gui24gridE' with the id '' in a 'N4gui25panelE' with the id '' in a 'N4gui24gridE' with the id '_window_content_grid' in a 'N4gui24gridE' with the id '_content_grid' in a 'N4gui215scrollbar_panelE' with the id '' in a 'N4gui24gridE' with the id '' in a 'N4gui27dialogs13addon_managerE' with the id 'addon_manager'.
Did I miss some additional update_gui() function to update the addon_list. From what I see it should be done by apply_filters()?

Secondly:
I scrape the addon.locales information vector for all available translations. The function langcode_to_string() that is used to show which translations are available in the dedicated addon window does not give a readable language string for all languages, only langcodes (see picture). Should I only display those, for which langcode_to_string() gives valid results or show everything that is indeed listed in the respective addon descriptions?
BfW-LangUI

from wesnoth.

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.