Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCube UI formatting

edited April 2015 in Help! with 2.0
I'm having a few issues with beating the SugarCube UI into submission.

TL;DR: How do I remove the save and restart links in the UI without affecting anything in StoryCaption?

Long version:

I want to:

1. Have text in one colour in StoryCaption
2. Have an "options" link in another colour that leads to an option passage (my game has seven different options, and I've dumped the save/restart in there as well, and I want it in an actual passage and without the gear symbol, which is why am not using default options entry)
3. Remove the default saves and restart links (since they're already in the options menu)


But in doing this I am encountering a few problems:

1. StoryCaption only accepts one <span> class. Anything else doesn't show up. So if I want two different text colours, I have to put one in the storycaption span, and then use css for the default UI-bar colour and then don't apply any other text styles to that text, as follows:

// this is bright grey
.caption a {
color: #b3b3b3;
text-decoration: none;
font-weight: bold;
}

//this is dark grey
#ui-bar a {
color: #8A8A8A;
text-shadow: 2px 2px 8px #111;
}

This is all good. It results in what I want it to do, except I can't manage to turn off the default saves and restart buttons without also affecting what's in StoryCaption.

It also seems I can't use anything like

#story-caption a {
color: #b3b3b3;
text-decoration: none;
font-weight: bold;
}

#story-caption a:hover {
color: #e6e6e6;
text-decoration: none;
font-weight: bold;
}
As this applies the style to the whole storycaption passage, even overriding any <span> tags in StoryCaption, so everything becomes one colour.


So to sum up, I basically want to:

1. Remove the save and load links without affecting StoryCaption content
2. Tell the StoryCaption passage to respect <span> tags.

However, if I could accomplish point 1, I wouldn't need to accomplish point 2, due to being able to use #ui-bar to style one set of text as written above.

Comments

  • Claretta wrote:

    1. Have text in one colour in StoryCaption
    2. Have an "options" link in another colour that leads to an option passage (my game has seven different options, and I've dumped the save/restart in there as well, and I want it in an actual passage and without the gear symbol, which is why am not using default options entry)
    3. Remove the default saves and restart links (since they're already in the options menu)


    Examples follow.

    Goes in Story Stylesheet:

    /* Do not display the Saves &amp; Restart core menu items */
    #menu-saves, #menu-restart {
    display: none;
    }

    /* Base StoryCaption text */
    #story-caption {
    color: gold;
    }

    /* Base StoryCaption links */
    #story-caption a {
    color: pink;
    }
    #story-caption a:hover {
    color: red;
    }

    /* StoryCaption options link where the <a> bears the class */
    #story-caption a.user-options-link
    {
    color: cyan;
    }
    #story-caption a.user-options-link:hover
    {
    color: blue;
    }

    /* StoryCaption options link where the <a> is contained by a <span> which bears the class */
    #story-caption .user-options-span a
    {
    color: cyan;
    }
    #story-caption .user-options-span a:hover
    {
    color: blue;
    }

    /* Extra classes to be applied to elements as further examples */
    #story-caption .foo {
    color: purple;
    }
    #story-caption .bar {
    color: lime;
    }
    Goes in the StoryCaption passage:

    This normal text is gold.

    [[This normal link is pink/red|Start]]

    <a class="user-options-link" data-passage="Start">This options link is cyan/blue</a>

    <span class="user-options-span">[[This alternate options link is also cyan/blue|Start]]</span>

    <span class="foo">Foo text is purple</span>

    <span class="bar">Bar text is lime</span>

    Claretta wrote:

    1. StoryCaption only accepts one <span> class. Anything else doesn't show up. []


    You can use as many &lt;span&gt; elements, with as many attached classes, as you want.  One or one-hundred, it makes no difference.  If something isn't working, then you've done something wrong (see the examples above).
  • Thank you. :)

    That fixed it.

    Think there was a css syntax issue that was interfering with proper display of spans, wasn't writing out some of the class properly, since your examples worked. Sorry for jumping to conclusions.
Sign In or Register to comment.