Jump to content


Community Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

7 Neutral

About gentz

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Pages would probably be a better solution, and I'll probably switch to that once the RDB is more feature complete. Currently the server does all the sorting and filtering and just sends the saves over. Sending complete search results would be impractical. Currently each save is ~2kb for the commands and ~15kb for the metadata, the latter being pretty large, so once the weekend comes by I'll start only sending metadata when requested. Currently there is no cache of any sorts.
  2. Thank you @vladislavbelov for your time, that was such a dumb mistake.
  3. That's interesting, with your patch applied on a fresh copy 0ad I'm getting the following: WARNING: onTick WARNING: IGUIObject: setting scrollbar_percentage was not found on an object ERROR: JavaScript error: gui/replaymenu/replay_menu.js line 162 Error: Invalid GUIObject property 'scrollbar_percentage' onTick@gui/replaymenu/replay_menu.js:162:2 __eventhandler45 (tick)@__internal(0) tick:0:1 I used the following commands after getting a fresh copy of 0ad (r21946): patch -p0 < ~/Downloads/changes_short.patch cd build/workspaces/ ./update-workspaces.sh -j5 --without-tests && cd gcc make config=debug -j5 && ../../../binaries/system/pyrogenesis
  4. Adding `scrollbar_percentage` gives this error: ERROR: GUI: (object: replaySelection) Can't set "scrollbar_percentage" to "0.0" TIMER| rdb/replay_menu.xml: 49.1224 ms WARNING: IGUIObject: setting scrollbar_percentage was not found on an object ERROR: JavaScript error: gui/rdb/replay_menu.js line 203 Error: Invalid GUIObject property 'scrollbar_percentage' onTick@gui/rdb/replay_menu.js:203:1 __eventhandler64 (tick)@__internal(0) tick:0:1 Will move.
  5. Right, so I'm trying to expose how far the scrollbar's scrolled down, so that when it nears the edge, I query the server for more replays. This is part of my project to make a Replay Database for 0ad. Alas, I'm getting this evil error: WARNING: IGUIObject: setting scrollbar_percentage was not found on an object ERROR: JavaScript error: gui/rdb/replay_menu.js line 203 Error: Invalid GUIObject property 'scrollbar_percentage' onTick@gui/rdb/replay_menu.js:203:1 __eventhandler125 (tick)@__internal(0) tick:0:1 Now, for sake of ease for the reader, I've boiled down my 6k line diff file to these 3 short excerpts, the first a diff file, the second an example of the html used and the final is an example of the js: Index: binaries/data/mods/mod/gui/gui.rnc =================================================================== --- binaries/data/mods/mod/gui/gui.rnc (revision 21928) +++ binaries/data/mods/mod/gui/gui.rnc (working copy) @@ -74,6 +74,7 @@ attribute offset { pos }?& attribute readonly { bool }?& attribute scrollbar { bool }?& + attribute scrollbar_percentage { xsd:decimal }?& attribute scrollbar_style { text }?& attribute scroll_bottom { bool }?& attribute scroll_top { bool }?& Index: binaries/data/mods/mod/gui/gui.rng =================================================================== --- binaries/data/mods/mod/gui/gui.rng (revision 21928) +++ binaries/data/mods/mod/gui/gui.rng (working copy) @@ -315,6 +315,11 @@ </attribute> </optional> <optional> + <attribute name="scrollbar_percentage"> + <data type="decimal"/> + </attribute> + </optional> + <optional> <attribute name="scrollbar_style"/> </optional> <optional> Index: source/gui/COList.cpp =================================================================== --- source/gui/COList.cpp (revision 21928) +++ source/gui/COList.cpp (working copy) @@ -33,6 +33,9 @@ AddSetting(GUIST_CGUISpriteInstance, "sprite_asc"); // Show the order of sorting AddSetting(GUIST_CGUISpriteInstance, "sprite_desc"); AddSetting(GUIST_CGUISpriteInstance, "sprite_not_sorted"); + AddSetting(GUIST_float, "scrollbar_percentage"); + + GUI<float>::SetSetting(this, "scrollbar_percentage", 0.0); } void COList::SetupText() @@ -119,6 +122,14 @@ GetScrollBar(0).SetY(rect.top); GetScrollBar(0).SetZ(GetBufferedZ()); GetScrollBar(0).SetLength(rect.bottom - rect.top); + + GUI<float>::SetSetting( + this, + "scrollbar_percentage", + GetScrollBar(0).GetMaxPos() == 0 + ? 1 + : GetScrollBar(0).GetPos() / GetScrollBar(0).GetMaxPos() + ); } } <object name="replaySelection" size="0 35 100% 100%-24" type="olist" style="ModernSortedList" sortable="true" selected_column="months" selected_column_order="-1" font="sans-stroke-13" auto_scroll="true" scrollbar="true" > <action on="SelectionChange">displayReplayDetails();</action> <action on="SelectionColumnChange">displayReplayList();</action> <action on="mouseleftdoubleclickitem">startReplay();</action> <!-- Columns --> <column id="id" color="172 172 212" width="10%"> <translatableAttribute id="heading" context="replay">Save Id</translatableAttribute> </column> <column id="months" color="172 172 212" width="11%"> <translatableAttribute id="heading" context="replay">Date / Time</translatableAttribute> </column> <column id="players" color="192 192 192" width="40%"> <translatableAttribute id="heading" context="replay">Players</translatableAttribute> </column> <column id="mapName" color="192 192 192" width="12%"> <translatableAttribute id="heading" context="replay">Map Name</translatableAttribute> </column> <column id="mapSize" color="192 192 192" width="9%"> <translatableAttribute id="heading" context="replay">Size</translatableAttribute> </column> <column id="popCapacity" color="192 192 192" width="9%"> <translatableAttribute id="heading" context="replay">Population</translatableAttribute> </column> <column id="duration" color="192 192 192" width="9%"> <translatableAttribute id="heading" context="replay">Duration</translatableAttribute> </column> </object> if (!g_WaitingForQueryResponce) { var replaySelection = Engine.GetGUIObjectByName("replaySelection"); if (replaySelection.scrollbar_percentage > 0.9) { RdbQueryForReplayList(); warn("Requery"); } } I've attached the full diff file bellow for those it interests. 0ad-diff
  6. In the patch I have it setup to print a message if someone is ready or if the change is different from the last change. So if someone cycles thought 60 maps they will have one message. I'd argue its the users responsibility to check that they like the new map before hitting ready. Edit: Well that's sopouesed to happen, still some bugs to iron out.
  7. Bellow is a patch with 3 things added to A22: 1- Chat panel like in the first patch 2- Player list like in second set of screenshots 3- Advanced what changed messages (I'll add it to A23 to phabricator tomorrow) The generic something has changed message has been replaced with the following: The map has been changed' The map type has been changed The map filter has been changed he map path has beem changed The game\'s speed has been changed The map\'s size has been changed The game\'s population cap has been changed The game\'s starting resources has been changed The length of the game\'s ceasefire has been changed The game\'s victory condition has been changed The teams have been changed The total number of relics has been changed The number of minutes till a player has won has been changed Whether heros can garrison has been changed Whether the game\'s map is revealed has been changed Whether the game\'s map is explored has been changed Whether the game has treasures has been changed Whether the game allows spies has been changed Whether the game\'s teams are locked has been changed Whether the gme is last man standing or not has been changed 'Whether cheats are enabled has been changed Whether the game is rated has been changed The game\'s name has been changed The game\'s description has been changed LobbyAndAdvancesMessagesPatch.patch
  8. I've made this little patch which shrinks the size of all the existing stuff: https://code.wildfiregames.com/D1194 It is required for the addition of a player list to the left of the player selector thingy. Its also be needed for the creation of a second chat window, unless you want it peanut sized at 1024x768. The other option would be turning the existing chat window into an equivalently sized window with 3 tabs (2 chats and 1 player list,) however I'd imagine that wouldn't be as nice.
  9. Just started working on it. Can't we instead extend the current "A setting has changed" message to be more specific, like "The map has changed"?
  10. Shrinking the right panel by 25% and compressing the player selector thingy gives enough room for a player list! See screenshots bellow. I'll try doing that tomorrow on my A23 build, and if it works I'll submit it to phabricator.
  11. I didn't submit it cause something better is already implemented for A23: https://code.wildfiregames.com/D817
  12. Only works at 1080p. 0adsplitpatches.patch
  13. Experimental feature.... will post more info soon
  • Create New...