Skip to content

Interface changes = crash.

User Avatar
#7
Auto-translated
Waterfall_13
These are the correct ClassTypeIDs:

<BackgroundSimpleScallingTexture>
    <ClassTypeID>285694784</ClassTypeID>

<BackgroundSimpleTexture>
    <ClassTypeID>285694785</ClassTypeID>

<BackgroundTiledTexture>
    <ClassTypeID>285694786</ClassTypeID>

Regarding mipmaps, you just need a simple rule - always disable their generation (if it's an interface texture).

Here are some more of my observations while working on the game interface:
For regular textures in ...(Texture).xdb files, this structure proved to be more stable

<Type>REGULAR</Type>
<ConversionType>CONVERT_ORDINARY</ConversionType>
For selection and Highlight textures I use

<Type>REGULAR</Type>
<ConversionType>CONVERT_TRANSPARENT_ADD</ConversionType>
and
<Type>REGULAR</Type>
<ConversionType>CONVERT_TRANSPARENT</ConversionType>
The TF_8888 format (lossless) is the least picky about non-standard width and height dimensions; with other formats (TF_DXT1 - TF_DXT5, TF_565) sometimes you have to "play around with the canvas size".
in ...(Texture).xdb files these formats are used successfully:

TF_565
TF_4444
TF_8888
TF_DXT5
TF_DXT4
TF_DXT3
TF_DXT1
Don't forget about precise element positioning

EPA_HIGH_END - align to right\bottom edge
EPA_LOW_END - align to left\top edge
EPA_MARGIN - stretch across the entire screen
ERA_CENTER - position at center
can be used together with values (x\y) in the Position section; they won't be taken into account as long as the value in the Second section = false.

I also noticed that you're not working with buttons "correctly" - they can be combined into groups and track visual state
[spoiler=Something like this:]
you can combine them into a group where they will turn on when pressed and turn off when another button from the group is activated

To do this, in the files:
SpellsInfoTableButton.(WindowMSButton).xdb
BloodInfoTableButton.(WindowMSButton).xdb
CreatureInfoTableButton.(WindowMSButton).xdb
ElementInfoTableButton.(WindowMSButton).xdb
HeroesInfoTableButton.(WindowMSButton).xdb
NecroInfoTableButton.(WindowMSButton).xdb
Set:
    <ButtonStates>
        <Item>
            <MessageOnEnterState/>
            <CommandsOnEnterState>
                <Commands/>
                <Reversable>false</Reversable>
            </CommandsOnEnterState>
            <CommandsOnRightClick>
                <Commands/>
                <Reversable>false</Reversable>
            </CommandsOnRightClick>
            <commandsOnLDblKlick>
                <Commands/>
                <Reversable>false</Reversable>
            </commandsOnLDblKlick>
            <WaitVisual>false</WaitVisual>
            <ReverseCommands>false</ReverseCommands>
            <Name/>
        </Item>
        <Item>
            <MessageOnEnterState/>
            <CommandsOnEnterState>
                <Commands/>
                <Reversable>false</Reversable>
            </CommandsOnEnterState>
            <CommandsOnRightClick>
                <Commands/>
                <Reversable>false</Reversable>
            </CommandsOnRightClick>
            <commandsOnLDblKlick>
                <Commands/>
                <Reversable>false</Reversable>
            </commandsOnLDblKlick>
            <WaitVisual>false</WaitVisual>
            <ReverseCommands>false</ReverseCommands>
            <Name/>
        </Item>
    </ButtonStates>
   <ButtonGroupID>1</ButtonGroupID>
    <AutoChangeState>true</AutoChangeState>
    <PushEffect>
        <Commands/>
        <Reversable>false</Reversable>
    </PushEffect>
    <State>0</State>
    <TextFileRef href=""/>
    <TextFormat/>
</WindowMSButton>
And in their Shared files add a handler for changing the visual state in "button press mode":

        <Item>
...
...
            <DefaultSubState>BST_NORMAL</DefaultSubState>
            <VisualOnEnterState>
                <Commands>
                    <Item href="Open.(UISSendUIMessage).xdb#xpointer(/UISSendUIMessage)"/>
                </Commands>
                <Reversable>false</Reversable>
            </VisualOnEnterState>
        </Item>
        <Item>
...
...
            <DefaultSubState>BST_NORMAL</DefaultSubState>
            <VisualOnEnterState>
                <Commands>
                    <Item href="Close.(UISSendUIMessage).xdb#xpointer(/UISSendUIMessage)"/>
                </Commands>
                <Reversable>false</Reversable>
            </VisualOnEnterState>
        </Item>
    </VisualStates>
    <TriggerMode>BCST_ON_PUSH</TriggerMode>
</WindowMSButtonShared>

[/spoiler]
Грешить, злодействовать, а равно и делать добро или совершать подвиги надо без натуги. А если с натугой — то лучше не надо.
К. Прутков-инженер. Мысль № 77.
Многие вещи нам непонятны не потому, что наши понятия слабы; но потому, что сии вещи не входят в круг наших понятий.
© Козьма Прутков