Page MenuHomeWildfire Games
Paste P133

Attempt at a better UI for external links
ActivePublic

Authored by smiley on Oct 2 2018, 10:42 PM.
Tags
None
Subscribers
Tokens
"Pirate Logo" token, awarded by nani.
Index: binaries/data/mods/mod/gui/common/modern/setup.xml
===================================================================
--- binaries/data/mods/mod/gui/common/modern/setup.xml (revision 21896)
+++ binaries/data/mods/mod/gui/common/modern/setup.xml (working copy)
@@ -2,6 +2,10 @@
<!DOCTYPE setup SYSTEM "..\..\gui.dtd">
<setup>
+ <icon name="external_link"
+ sprite="stretched:global/icon/external_link.png"
+ size="16 8"
+ />
<!--
==========================================
- SCROLLBARS -
Index: binaries/data/mods/mod/gui/common/modern/styles.xml
===================================================================
--- binaries/data/mods/mod/gui/common/modern/styles.xml (revision 21896)
+++ binaries/data/mods/mod/gui/common/modern/styles.xml (working copy)
@@ -170,6 +170,14 @@
text_valign="center"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
+ <style name="URLButton"
+ font="sans-bold-stroke-14"
+ textcolor="white"
+ textcolor_disabled="210 210 210 160"
+ text_align="left"
+ text_valign="center"
+ sound_pressed="audio/interface/ui/ui_button_click.ogg"
+ />
<style name="ModernProgressBarBackground"
sprite="ModernProgressBarBackground"
/>
Index: binaries/data/mods/mod/gui/modmod/modmodio.js
===================================================================
--- binaries/data/mods/mod/gui/modmod/modmodio.js (revision 21896)
+++ binaries/data/mods/mod/gui/modmod/modmodio.js (working copy)
@@ -9,11 +9,11 @@
"callback": openModIo,
"urlButtons": [
{
- "caption": translate("mod.io Terms"),
+ "caption": "https://mod.io/terms " + '[icon="external_link"]',
"url": "https://mod.io/terms"
},
{
- "caption": translate("mod.io Privacy Policy"),
+ "caption": "https://mod.io/privacy " + '[icon="external_link"]',
"url": "https://mod.io/privacy"
}
]
Index: binaries/data/mods/mod/gui/termsdialog/termsdialog.xml
===================================================================
--- binaries/data/mods/mod/gui/termsdialog/termsdialog.xml (revision 21896)
+++ binaries/data/mods/mod/gui/termsdialog/termsdialog.xml (working copy)
@@ -18,16 +18,18 @@
</object>
<object size="20 60 100%-20 100%-50">
- <object name="mainTextPanel" type="image" sprite="ModernFade">
+ <object name="mainTextPanel" type="image" size="0 0 100% 90%" sprite="ModernFade">
<object name="mainText" type="text" style="ModernTextPanel"/>
</object>
+
+ <object name="urlButtons" type="image" size="0 90% 100% 100%" sprite="ModernFade">
+ <object size="0 0 20% 50%" type="button" name="button[0]" style="URLButton" hidden="true"/>
+ <object size="0 50% 20% 100%" type="button" name="button[1]" style="URLButton" hidden="true"/>
+ </object>
</object>
<object size="25 100%-45 100% 100%-16">
- <object size="0 0 160 100%" type="button" name="button[0]" style="ModernButtonRed" hidden="true"/>
- <object size="170 0 330 100%" type="button" name="button[1]" style="ModernButtonRed" hidden="true"/>
-
<object size="100%-355 0 100% 100%">
<object type="button" style="ModernButtonRed" size="0 0 160 100%" hotkey="cancel">
<translatableAttribute id="caption">Decline</translatableAttribute>

Event Timeline

smiley created this paste.Oct 2 2018, 10:42 PM

Intended only for seeing how it looks so not much care was given to quality. The icon is obviously not added here.
https://imgur.com/a/qT1M8VQ ( how it looks with the icon )

nani added a subscriber: nani.EditedOct 3 2018, 11:32 AM

What about an object which works as a button but renders it as text like lets say an href?

In P133#1025, @nani wrote:

What about an object which works as a button but renders it as text like lets say an href?

Those URLs are buttons. And that icon is also part of the clickable text.

smiley added a comment.EditedOct 3 2018, 11:39 AM


There is the external link icon. White on white...

hmm... the picture looks nice, the white on black has a nice contrast that does not hurt eyes. Btw why do you not want to remain mod.io privacy policy as a name that could be clicked upon rather than straight having the URL shown?

It could be clicked. What changed is the button style and the text being the actual URL.

elexis added a subscriber: elexis.EditedOct 3 2018, 1:23 PM

Did you read what the author wrote about that?

Mostly decided for actual buttons because that's the way the user is informed of a way to initiate an action. It's more explicit than a link. (Part due to the hover-over effect as you mentioned, which looked ugly on a label.)

The ideal solution would probably be to integrate link support in CText.cpp, or even downloading the terms from the server and displaying them locally, if we can rule out security risks and persistence of the url.

smiley added a comment.Oct 4 2018, 8:43 AM

downloading the terms from the server and displaying them locally, if we can rule out security risks and persistence of the url.

I guess I could ask them about it in their discord.

smiley added a comment.EditedOct 4 2018, 9:04 AM

I guess I could ask them about it in their discord.

While they did not say it wont change, they did say it was highly unlikely.

And it's better to display these two links imo. (if its decided to curl it, then these are the links to get too)
https://mod.io/privacy/widget
https://mod.io/terms/widget

elexis changed the visibility from "All Users" to "Public (No Login Required)".Mar 24 2019, 8:10 PM
nani awarded a token.Mar 24 2019, 8:30 PM