Jump to content

gentz

Community Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by gentz

  1. On 12/18/2018 at 5:53 AM, elexis said:

    Is loading more data when the scrollbar reached the bottom the nicest solution? Paging would be an alternative. Or displaying everything is made fast enough, which ought to be the case if the cache is always prefilled. Having complete search results also means that one can sort the results.

    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. 3 hours ago, vladislavbelov said:

    I removed unrelated things from your patch and tested it. And it works. I attached my version of the patch.

    changes_short.patch

    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

     

  3. 3 hours ago, vladislavbelov said:

    We still have some limitations there. We need XML declaration for an attribute to use it in JS (like selected_column_order). Try to add scrollbar_percentage="0.0" to the replaySelection object:

    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
    3 hours ago, vladislavbelov said:

    Also we put all server/utility stuff in the tools subfolder, because it's not a part of the game.

    Will move.

  4. 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

    • Like 2
  5. 7 hours ago, elexis said:

    Sure, but that message is currently only printed if anyones ready state was reset. So if you browse the 60 random maps to find the best suited one and noone pressed ready, there will be at most one message rahter than 60.

    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.

  6. 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

  7. 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.

  8. 19 hours ago, gameboy said:

    @gentz How is your test? Can it be submitted?

    Just started working on it.

    17 hours ago, elexis said:

    The second chat column could be used to display which game settings changed however (that would be quite noisy. Browsing through 50 maps = 50 chat messages). This would allow players to see which settings changed (and also allow random maps to change settings without doing it behind the users back). On the other hand that might be so noisy that it's just not read.

    Can't we instead extend the current "A setting has changed" message to be more specific, like "The map has changed"?

  9. Shrinking the right panel by 25% and compressing the player selector thingy gives enough room for a player list! See screenshots bellow.

     

    7 hours ago, mapkoc said:

    Both are pretty sweet. Maybe you can toggle the view lobby chat with a hotkey or like a sidetab that expands and collapses

    I'll try doing that tomorrow on my A23 build, and if it works I'll submit it to phabricator.

    Screenshot_from_2018-01-02_19-43-56.png

    Screenshot_from_2018-01-02_19-44-07.png

    • Like 1
    • Thanks 1
  10. 1 hour ago, ddb_brutus said:

     

    -snip-

    1. If you look at my farmers at 7, 1/3 I don't understand why they take foods to the cc if the farm is closer to the farmstead? Is there any way to fix that or is just the way it is?

    I'm not sure what video you're referring to, but you can fix it by selecting the women, left clicking on the farmstead then shift-left clicking on the farm. (Telling them to move to the farmstead then move to the farm)

    2. when I hit the panic button, why some remote citizens within the border of the village but kind of far ignore the silver panic alert?

    I explain it to myself as that they are too far to hear the bell.

    I truly appreciate your help!

     

×
×
  • Create New...