Jump to content

Where do you go to check the definition of a certain XML element—as in what it does, and what attributes it expects or accepts?


FLLOG123
 Share

Recommended Posts

As a premise, I'm a novice to skinning but I've always been curious about the topic and the whole community surrounding it, and I really wanted to try my hands at it at least once.

And believe me, I get it when people say it's mostly a matter of trial and error. This is how we all learn, after all. So in principle I have nothing against changing a few things in the code, seeing what effects it has, and thus inferring its meaning. For example, at first I was confused about some of the layout numbers (e.g. layout="-1,-2"), but after a couple attempts I figured out that's how you determine the spatial proportions of some elements.

However, things changed when I came across the nationality segment, which is usually displayed as flag + demonym in a player's profile page. Now, I wanted to try and remove the flag, and I focused on this one aspect here by pure chance: it's just one thing that I wanted to try in order to see how easy it would be. And... well, I can't say it was a pleasant experience. I explored the whole code, every possible related file (including nation properties), I even extracted the whole classes file to see if nation_button was somehow defined there so that it orders the game to display a flag... but I couldn't find anything.

Then, when I had almost given up hope, I decided to at least look it up online; that's when I found a random thread from five years ago where they suggest that I should add this:

icon_enabled="false"

And this, incredibly, works.

Now... how am I supposed to know that? That attribute is not part of the original code of the default skin (altering the format attribute doesn't remove the flag, by the way):

<record id="widget_info" class="nation_button" auto_size="vertical" format="[%nation#1-nationality]" />

And this isn't a matter that can be solved through simple trial and error: even if you write icon_disabled="true", that won't work—you have to nail the exact wording for that attribute or it will have no effect (since this is how XML works), not to mention that you need to know that the flag pops up or not depending on the value of a given attribute in the first place.

So I have two questions, one specific to this case and a more general one:

  • is there a nation_button file somewhere that lists the specifics of this element (including, apparently, the fact that it accepts an icon_enabled attribute for the national flag)? I couldn't find one, no matter how hard I looked, even before I was aware such an attribute was needed; but still, a file like that has to exist somewhere, right? The game has to know what a valid nation_button thingy looks like, right?
  • more generally, is there a way to know how elements have to be formatted? when it comes to single properties that I want to retrieve, I'm more or less familiar with the routine process of just grabbing the abbreviation from the relevant property file in order to display it as text; but when it comes to specific pre-packaged elements like nation_button, or more generally any other such thing, is there a comprehensive list of attributes that can be tried? or at least a specific folder or file I can check to read the definition of these widget infos (which nation_button seems to be a class of), so I know how to properly edit them?
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...