Changeset View
Standalone View
binaries/data/mods/public/gui/mapbrowser/mapbrowser.xml
<?xml version="1.0" encoding="utf-8"?> | |||||
<objects> | |||||
<script directory="gui/common/"/> | |||||
<script directory="gui/mapbrowser/"/> | |||||
<!-- Add a translucent black background to fade out the menu page --> | |||||
<object type="image" sprite="ModernFade"/> | |||||
<object type="image" style="ModernDialog" size="0%+10 0%+20 100%-10 100%-10"> | |||||
<action on="Tick"> | |||||
onTick(); | |||||
</action> | |||||
<object style="ModernLabelText" type="text" size="50%-128 -18 50%+128 14" z="200"> | |||||
<translatableAttribute id="caption">Map Browser</translatableAttribute> | |||||
</object> | |||||
<!-- Grid full of maps previews --> | |||||
<object name="MapBrowserContainer" size="15 15 100%-400-20 100%-15"> | |||||
<repeat count="100" var="n"> | |||||
<object name="map[n]" hidden="true"> | |||||
<object name="mapBox[n]"> | |||||
<!-- <object name="mapButton[n]" type="button" style="ModernButtonRed"> --> | |||||
<object type="image" sprite="ModernDarkBoxGold" ghost="true" size="8 8 100%-8 100%-8"> | |||||
<object name="mapName[n]" type="text" style="ModernLabelText" size="10 100%-25 100%-10 100%-5"/> | |||||
<object name="mapPreview[n]" type="image" size="1 1 100%-1 100%-1"/> | |||||
</object> | |||||
<object name="mapButton[n]" type="button" sprite="color : 255 0 0 0" size="4 4 100%-4 100%-4"> | |||||
<action on="MouseWheelUp">mapZoom.in()</action> | |||||
elexis: textcolor, style or gui tags no? | |||||
Done Inline ActionsWhat do you mean? nani: What do you mean? | |||||
Done Inline ActionsWas wondering whether sprite="color : 255 0 0 0" wasn't achievable with a textcolor="red" XML property, or .caption = setGUITags(text, "color": "red" ). But perhaps the sprite thing sets the entire background? I didnt check elexis: Was wondering whether `sprite="color : 255 0 0 0"` wasn't achievable with a `textcolor="red"`… | |||||
<action on="MouseWheelDown">mapZoom.out()</action> | |||||
</object> | |||||
</object> | |||||
</object> | |||||
Done Inline ActionsThat's 100 maps max? That sounds almost too easy to reach if we already have like 70 random maps in the repository. elexis: That's 100 maps max? That sounds almost too easy to reach if we already have like 70 random… | |||||
Done Inline ActionsThat number is the maximum to show at the same time, remember that the map browser is paged. There can be as many maps as you want. nani: That number is the maximum to show at the same time, remember that the map browser is paged. | |||||
Done Inline ActionsSo it's the number of maps that can be displayed simultaneously. elexis: So it's the number of maps that can be displayed simultaneously.
That's 10x10 or 13*8 or 11*9. | |||||
</repeat> | |||||
<action on="MouseWheelUp">mapZoom.in()</action> | |||||
<action on="MouseWheelDown">mapZoom.out()</action> | |||||
<!-- Recalculate grid to fill all screen space --> | |||||
<action on="WindowResized"> | |||||
mapBrowser.generateGrid(); | |||||
</action> | |||||
</object> | |||||
<action on="MouseWheelUp">mapZoom.in()</action> | |||||
<action on="MouseWheelDown">mapZoom.out()</action> | |||||
<!-- Right side info and controls --> | |||||
<object size="100%-420 15 100% 100%-15" type="image" sprite="ModernFade" z="50"> | |||||
<object size="100%-400 30 100%-30 100%-30"> | |||||
<object size="0 5 100% 70"> | |||||
<object size="0% 0% 100% 50%-2"> | |||||
<!-- Page: --> | |||||
<object type="text" style="ModernRightLabelText" size="0% 0% 20% 100%"> | |||||
Done Inline ActionsWhy are there so many MouseWheelDown / Up subscribers all doing the same thing, rather than only one global subscriber? elexis: Why are there so many MouseWheelDown / Up subscribers all doing the same thing, rather than… | |||||
Done Inline ActionsEach map must be selectable but I also want to be able to use scroll on top of the maps, their padding and the border of the grid. Not possible otherwise (that I know of). nani: Each map must be selectable but I also want to be able to use scroll on top of the maps, their… | |||||
Done Inline ActionsI think global hotkeys are triggered as long as no text input is focused. (This could also be problematic if a user assigned a GUI hotkey to the mousewheel events. That might be more realistic in the future, for example if we had hotkeys to increase the entire UI scale #5389.) elexis: I think global hotkeys are triggered as long as no text input is focused.
This also brings us… | |||||
Done Inline ActionsI view onMouseWheel events like analogous to onPress onRelease given that they are mouse events. BTW I don't see any onPress onRelease options in the default.cfg config. nani: I view onMouseWheel events like analogous to onPress onRelease given that they are mouse events. | |||||
<translatableAttribute id="caption">Page:</translatableAttribute> | |||||
</object> | |||||
<!-- Page number text--> | |||||
<object name="currentPageNum" type="text" style="ModernLeftLabelText" size="20% 0% 40% 100%"/> | |||||
<!-- Previous button eae--> | |||||
Done Inline Actions(Didn't check, but seems like on object layer is unneeded) elexis: (Didn't check, but seems like on object layer is unneeded) | |||||
Done Inline ActionsNeeded. Also much more easy to change. nani: Needed. Also much more easy to change. | |||||
Done Inline Actionsif then pro :-) ffffffff: if then pro :-) | |||||
Done Inline Actions<object size="100%-420 15 100% 100%-15" type="image" sprite="ModernFade" z="50"> elexis: <object size="100%-420 15 100% 100%-15" type="image" sprite="ModernFade" z="50">
only contains… | |||||
<object name="prevButton" type="button" style="ModernButtonRed" size="40% 0% 70% 100%"> | |||||
<translatableAttribute id="caption">Previous</translatableAttribute> | |||||
<action on="Press">mapBrowser.previousPage();</action> | |||||
</object> | |||||
<!-- Next button --> | |||||
<object name="nextButton" type="button" style="ModernButtonRed" size="70% 0% 100% 100%"> | |||||
<translatableAttribute id="caption">Next</translatableAttribute> | |||||
<action on="Press">mapBrowser.nextPage();</action> | |||||
</object> | |||||
</object> | |||||
<object size="0% 50%+2 100% 100%"> | |||||
<!-- Zoom button in --> | |||||
<object name="mapsZoomIn" type="button" style="ModernButtonRed" size="0% 0% 0%+30 100%"> | |||||
<translatableAttribute id="caption">+</translatableAttribute> | |||||
</object> | |||||
<!-- Zoom button out --> | |||||
<object name="mapsZoomOut" type="button" style="ModernButtonRed" size="0%+30 0% 0%+60 100%"> | |||||
<translatableAttribute id="caption">-</translatableAttribute> | |||||
Done Inline ActionsIf a zoom level is implemented, considerable alternatives to two buttons are a slider and a dropdown. elexis: If a zoom level is implemented, considerable alternatives to two buttons are a slider and a… | |||||
Done Inline ActionsThe drop down would be a bad idea imho. nani: The drop down would be a bad idea imho. | |||||
Done Inline ActionsAnd what is that the opinion based on? (Not that I'm saying it's wrong, but opinions can be random if they are not qualified with objective arguments). Dropdowns have the advantage that they display the current zoom level. That could be displayed with a label too. A disadvantage of the dropdown is that one needs two clicks and mouse movement in between to select, whereas the two buttons only need a single click to change the zoom value. elexis: And what is that the opinion based on? (Not that I'm saying it's wrong, but opinions can be… | |||||
</object> | |||||
<!-- Dropdowns --> | |||||
<object size="0%+60 0% 100% 100%"> | |||||
<object name="mapTypeDropdown" type="dropdown" style="ModernDropDown" size="0% 0% 50% 100%"/> | |||||
Done Inline Actionsredundant elexis: redundant | |||||
<object name="mapFilterDropdown" type="dropdown" style="ModernDropDown" size="50% 0% 100% 100%"/> | |||||
</object> | |||||
</object> | |||||
</object> | |||||
<!-- Map preview + Map name --> | |||||
<object size="0 70+10 100% 70+300-30"> | |||||
<object name="nameSelected" type="text" style="ModernLabelText" size="10 100%-25 100%-10 100%-25+20"/> | |||||
<object name="previewSelected" type="image"/> | |||||
</object> | |||||
<!-- Select map button --> | |||||
<object name="selectMapButton" type="button" style="StoneButtonFancy" size="0% 70+300+10-30 100% 70+300+10-30+30"> | |||||
<translatableAttribute id="caption">Select map</translatableAttribute> | |||||
<action on="Press">mapBrowserReturn(true);</action> | |||||
</object> | |||||
<!-- Map Description --> | |||||
<object size="0%-4 70+300+10-30+30+10 100% 100%-30-10"> | |||||
<object name="descriptionSelected" type="text" style="ModernText" size="0 0 100% 100%"/> | |||||
</object> | |||||
<!-- Close button --> | |||||
<object name="closeButton" type="button" style="StoneButton" size="0% 100%-30 100% 100%" hotkey="cancel"> | |||||
<translatableAttribute id="caption">Close</translatableAttribute> | |||||
<action on="Press">mapBrowserReturn(false);</action> | |||||
</object> | |||||
</object> | |||||
</object> | |||||
<object hotkey="tab.prev"> | |||||
<action on="Press">mapBrowser.previousPage();</action> | |||||
</object> | |||||
<object hotkey="tab.next"> | |||||
Done Inline ActionsUsually GUI objects are specified with fixed width instead of relative width, so that we don't have 'degenerate shapes' (buttons that are 500px wide but only 16px high and similar), and so that the borders / margings between elements remain fixed. Would have to look in specific where it's good or bad to have it relative. elexis: Usually GUI objects are specified with fixed width instead of relative width, so that we don't… | |||||
Done Inline ActionsParent object is fixed size so it doesn't matter. nani: Parent object is fixed size so it doesn't matter. | |||||
<action on="Press">mapBrowser.nextPage();</action> | |||||
</object> | |||||
</object> | |||||
</objects> | |||||
Done Inline Actions
elexis: * *hotkey name:** Those aren't tabs, right? So the hotkey name and explanation may be… | |||||
Done Inline Actions\n elexis: \n |
textcolor, style or gui tags no?