Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worlds.ini update, worlds.simba bug fix and added features #141

Closed
wants to merge 4 commits into from
Closed

Worlds.ini update, worlds.simba bug fix and added features #141

wants to merge 4 commits into from

Conversation

ClaritySRL
Copy link
Contributor

Ignore the second commit description, it's totally wrong.

The amount of favorite worlds present on the worlds list shrunk the size of the scrolling area, which affected world searching by _scrollToWorld(). Picture of problem from Mayor: http://puu.sh/c3yeN/0c7321b7e9.png
The following changes have removed this problem:

  • New internal function: _getFavoriteCount(): integer; returns the amount of favorite worlds present on the screen.
  • _scrollToWorld(); now calls _getFavoriteCount(); to alter the Y coordinate before color searching.
  • New functions: TRSLobbyWorlds.addFavoriteWorlds(wArray): boolean; and TRSLobbyWorlds.removeFavoriteWorlds(wArray): boolean; which add and remove favorite worlds, should anybody want to do this in a script.

TRSLobbyWorlds.selectRandomWorld has been overhauled to avoid a default list of worlds that have been breaking scripts, listed below:
* World 18 - Legacy Only
* World 30 - Skill Total (2000)
* World 33 - Legacy Only
* World 48 - Skill Total (2400)
* World 52 - VIP Server
* World 57 - Legacy Only
* World 86 - Skill Total (1500)
* World 96 - Quick Chat
* World 97 - Legacy Only
* World 114 - Skill Total (1500)
* World 115 - Legacy Only
* World 120 - Legacy Only
* World 136 - Legacy Only
* World 137 - Legacy Only
The update, which is backwards compatible, adds new boolean and TIntegerArray parameters. If standardAvoid is true, the random selector will avoid all worlds in the above list. The TIntegerArray allows the user to specify their own worlds to avoid, such as clan home worlds or heavily populated worlds.

Demonstration: http://i.gyazo.com/f88b2f009274d84580da702fcf9b3e34.png

  • New boolean property "avoid" for all worlds, indicating whether they will ignored when selecting a random world. Worlds.ini updated accordingly.

Added "avoid" boolean to all worlds, used by new functions in worlds.simba
- The amount of favorite worlds present on the worlds list shrunk the size of the scrolling area, which affected world searching since the worldNumArea was a static variable.  The following changes have removed this problem:
- New internal function: _getFavoriteCount(): integer; returns the amount of favorite worlds present on the screen.
- _findWorldNumber(); now calls _getFavoriteCount(); to update the worldNumArea before searching.  A boolean, backwards compatible and defaulted to false, has been added to _findWorldNumber(); and selectWorld(); which, if true, will alter the worldNumArea to only the favorites list.  If no favorites are present and the function was incorrectly used with a "true" favorite search value, it will skip this and search normally.
- New functions: TRSLobbyWorlds.addFavoriteWorlds(wArray): boolean; and TRSLobbyWorlds.removeFavoriteWorlds(wArray): boolean; which add and remove favorite worlds, should anybody want to do this in a script.
- New boolean property "avoid" for all worlds, indicating whether they will ignored when selecting a random world.  Worlds.ini updated accordingly.
- TRSLobbyWorlds.selectRandomWorld has been overhauled to avoid a default list of worlds that have been breaking scripts, listed below:
    * World 18 - Legacy Only
    * World 30 - Skill Total (2000)
    * World 33 - Legacy Only
    * World 48 - Skill Total (2400)
    * World 52 - VIP Server
    * World 57 - Legacy Only
    * World 86 - Skill Total (1500)
    * World 96 - Quick Chat
    * World 97 - Legacy Only
    * World 114 - Skill Total (1500)
    * World 115 - Legacy Only
    * World 120 - Legacy Only
    * World 136 - Legacy Only
    * World 137 - Legacy Only
The update, which is backwards compatible, adds new boolean and TIntegerArray parameters.  If standardAvoid is true, the random selector will avoid all worlds in the above list.  The TIntegerArray allows the user to specify their own worlds to avoid, such as clan home worlds or heavily populated worlds.
Documentation error fixes and removed unused variable.
@ashaman88
Copy link
Contributor

First glace looks great. I won't have time to have a look through until later tonight, but another dev may take a crack at it and push it through beforehand. Great work man!

exit();
end;

if (not self.isOpen()) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to check twice, worlds.open() checks already

@TheTS
Copy link
Member

TheTS commented Oct 10, 2014

Gave this a whirl, it works sweet on my PC, and will fix all those issues when switching worlds and ending up on a legacy world.

Only thing I would suggest is removing favorite worlds via the top bar(s). Currently you scroll through the list to remove the world (so if you try and remove a world which isn't already favourited you will end up adding it instead).

@ClaritySRL
Copy link
Contributor Author

Currently the order of the code as intended first searches the list (including the top bar), and if that check fails then it will scroll down. Then at that point I suppose yes that mess-up would occur if tesseract failed twice to find this favorited world. Would people rather it continually check the top bar instead of check once and then scroll?

@TheTS
Copy link
Member

TheTS commented Oct 10, 2014

I mean if I had 1 favorite world and it was w7 and I said removeFavoriteWorlds(8) it would go down and add world 8. I think the function shouldn't take any parameters and just remove all favorite worlds (and then user can call this before adding fav worlds). I don't think people are going to remove known worlds from favourites. Just a suggestion :D

@ClaritySRL
Copy link
Contributor Author

Ah, that's a good idea! Will edit this up and send in a new commit

@ashaman88
Copy link
Contributor

i've got an easy fix for it clarity one sec

@ashaman88
Copy link
Contributor

done. i don't know how to apply changes to your commit so i just made a different one :)

comment there if any issues discovered:

bcaccd1

@ashaman88 ashaman88 closed this Oct 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants