Giter VIP home page Giter VIP logo

tilesheets's Introduction

Tilesheets MediaWiki Extension

Adds a parser function that looks up a table for an item and returns the requested image.

tilesheets's People

Contributors

alexia avatar applehat avatar chaud avatar elifoster avatar jinbobo avatar majr25 avatar noahm avatar retep998 avatar robert-nix avatar telshin avatar xbony2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tilesheets's Issues

Licensing and Repository Ownership [Tilesheets]

There are two legal issues need to be taken care of by the end of next week.

1.) Licensing
There was discussion on the #gamepedia IRC channel previously about this. I forget what the final open source license was decided on and if it was for OreDict or Tilesheets.

The company(Curse Inc.) is requesting to be able to use Tilesheets under the MIT license. However, if not MIT then GPLv2 would be acceptable.

Preferably the license would be included in the repository in the root folder titled similar to "LICENSE" in all capital letters.

2.) Repository Ownership
Even though Tilesheets is used primarily on a Gamepedia wiki the primary maintainers of the Tilesheets project are not Curse employees or contractors. As such legal has informed us that it would be best that the repository ownership be officially transferred to either the personal Github account of a primary maintainer or a an organization account controlled by the primary maintainers. I will facilitate transferring the repository to the location decided.

Race condition in adding tiles

Before adding a new tile it checks whether the tile already exists. However because it does not do the check and insertion as a single atomic transaction, there is a race condition where another request can insert the tile between the check and the insertion resulting in the tile being duplicated.

Error when importing tiles with < and >

Exception encountered, of type "TypeError"
[9d263bf59c5102e2cc29954f] /Special:CreateTileSheet TypeError from line 501 of /home/hydra/stable_public_html/includes/logging/LogEntry.php: Argument 1 passed to ManualLogEntry::setTarget() must be an instance of Title, null given, called in /home/hydra/stable_public_html/extensions/Tilesheets/special/TileManager.php on line 107
Backtrace:
#0 /home/hydra/stable_public_html/extensions/Tilesheets/special/TileManager.php(107): ManualLogEntry->setTarget(NULL)
#1 /home/hydra/stable_public_html/extensions/Tilesheets/special/CreateTileSheet.php(87): TileManager::createTile(string, string, string, string, User, string)
#2 /home/hydra/stable_public_html/includes/specialpage/SpecialPage.php(479): CreateTileSheet->execute(NULL)
#3 /home/hydra/stable_public_html/includes/specialpage/SpecialPageFactory.php(576): SpecialPage->run(NULL)
#4 /home/hydra/stable_public_html/includes/MediaWiki.php(282): SpecialPageFactory::executePath(Title, RequestContext)
#5 /home/hydra/stable_public_html/includes/MediaWiki.php(745): MediaWiki->performRequest()
#6 /home/hydra/stable_public_html/includes/MediaWiki.php(519): MediaWiki->main()
#7 /home/hydra/stable_public_html/index.php(43): MediaWiki->run()
#8 {main}

For example, MFDevice <Debugger>.

Better localization

  • Localized API documentation (supported by MediaWiki directly, this'll probably end up removing quite a bit of code from the api classes)
  • Localized errors and warnings
  • Localized API errors (not yet supported by MW)

ViewTile special page

It's not super-useful, but having a special page for looking at a particular tile could be useful. The unofficial wiki and the Minecraft wiki use single-image tiles so they can be linked to which is useful (for example, linking to https://ftbwiki.org/File:Grid_Dragon_Heart.png was used to help create the /r/ftb part of /r/place).

Improve filtering stuff in TileList

  • Remove "Filter by prefix" because why is that even there
  • Add "Filter by name": Regex applicable search string
  • Add "Filter by languages": search for all tiles translated to any of the provided language codes (comma separated)
    • Inverse selection (all tiles NOT translated to the provided language codes– empty search with this checked will search all tiles that haven't been translated to anything)
  • "Filter by mod" remains untouched
  • "Search from entry ID": exclude all tiles whose entry ID < provided, like in OreDictList
  • Remove "Filter by prefix" from SheetList

In progress at tilelist-filters

Naming consistency

It's called "Tilesheets" as well as "Tile Sheets" in many places. We should decide on a single term. Personally, I prefer "Tilesheets" because that's just what we've been calling them this whole time.

deletesheet API seems be broken

irb(main):006:0> butt.post({action: "deletesheet", tsmods: "FSPA", tssummary: "", tstoken: butt.get_token("edit")})
=> {"edit"=>{"deletesheet"=>[]}}

...worked before (with the exclusion of the changed argument), but no tilesheet is deleted now.

Make the tilesheets deletable in the interface.

The SheetManager doesn't allow the sheet to be deleted. Trying to click the checkmarks yields to nothing. The only way to delete it is using the API.

I literally had to use irb to delete it >.> and since the extension api isn't part of the butt gem yet I had to type out butt.post({action: "deletesheet", tsmod: "TDM", tssummary: "", tstoken: butt.get_token("edit")}) which was kind of annoying.

Edit: tsmod should be "tsmods" right now.

WhatLinksHere for tiles

We need a way to see all uses of a given tile, like WhatLinksHere but for tile invocations.

There needs to be a database table that tracks every single time a tile is used on a given article, with a special page to browse it. Look into how it's implemented for the actual backlinks thing within MW.

Name for the special page is Special:WhatUsesThisTile

  • Special:WhatUsesThisTile functionality
  • Special:WhatUsesThisTilesheet functionality

Different right for tile translators

There should be two distinct rights: tiletranslator, and whatever the current one is. tiletranslator will allow you to use the TileTranslator and see the "Translate" button on the TileList, while not allowing you to modify tile data or sheet data.

API item name matching regex

On [[Special:TileList]], there are options that aren't available in the API: "Search item names matching regex," "Filter by languages translated to (comma separated)," and "Invert language selection." I sort of just threw in the last two but the first would be fairly useful.

Lua/Scribunto wrapper

Since {{Gc}} is written in lua, it would make sense to have a lua wrapper to shave off the extra millisecond or whatever that callParserFunction() causes.

I would consider doing this myself, but last time I tried to touch PHP I ended up... [let's not scare curse staff, bony]

Item List index value incrementing by 3

For some reason all new items that get added to the item list have an index that is incrementing by 3 rather than 1.

For example:
https://ftb.gamepedia.com/index.php?title=Special:TileList&page=17&regex=&mod=&langs=&invertlang=0&limit=5000

    # Item name Mod name X position Y position Registered sizes
Edit Translate View 272089 Lazurite Plate TR 13 15 16px,32px
Edit Translate View 272092 Lead Dust TR 14 15 16px,32px
Edit Translate View 272095 Magic Energy Absorber TR 15 15 16px,32px

Hidden RC logging per default

I was going to try to work on this to practice some PHP but time is short.

Restricting the creation of tilesheets because you have to use a bot so it won't spam the RC is the dumbest thing ever; making tilesheets should be easy as possible, you shouldn't have to rely on the two people who can (not to mention bots and this don't work right now anyway).

Logging

Can the recent changes log get the untranslated name along with the tile ID because seeing that tile 11023 has been translated means nothing, but that Iron Horse Armor (11023) has been translated is useful information.

Silly return values

If you ask for the description of a tile without any translation it will return the tilename, instead of what you'd expect of an empty string.

Like {{#itemloc:Macerator|IC2|description|en}} should be "" as there's no translation but it instead returns Macerator, which you'd only expect to occur if you called for the name.

Override existing broken

On Special:CreateTileSheet, clicking the "override existing" checkbox and then saving yields this:

A database query error has occurred. This may indicate a bug in the software.

(which it does so indicate).

Test input:

  • Mod name: ESAEBSADTEST (A tilesheet with one entry, "ESAEBSADTEST" at 0, 0)
  • Tilesheet sizes: 16, 32
  • Data: "0 0 ESAE" or nothing at all; yields the same result.

[Update: test input is crap right now because ESAEBSADTEST is deleted]

Test 2:

  • First creating tilesheet "ESAETEST" with data "0 0 ESAE IS ESAE" and size 16, 32 (no files uploaded) [everything seems normal]
  • Re-creating tilesheet with new data "0 0 ESAE IS ESAY" + override existing checkbox.
  • Re-creating it again with no data + override existing checkbox.

It seems to work.

IRC web service

Could an IRC web service be added with the following settings:

Server: irc.esper.net
Port: 6667
Room: #FTB-Wiki-Dev
Nick: Tilesheets
Branches:
NickServ Password:
SSL: false
Message Without Join: true
No colors: false
Long URL: false
Notice: true

Description length is too short

https://github.com/HydraWiki/Tilesheets/blob/master/install/sql/ext_tilesheet_languages.sql#L5

 `description` varchar(100)

This is way too short for some descriptions, in particular GT6 where &bConverts 1 HU into +1 K per 100kg/&4Melts down when stored Heat is too much! (2500 K)/Can put Blocks around it on Fire! (4m)/&8Tool to harvest: &fPickaxe (0)/&7Contains 7.0 Units of Clay/Melt: 2000 K - Boil: 4000 K - Weight: 1392.355 kg was truncated to &bConverts 1 HU into +1 K per 100kg/&4Melts down when stored Heat is too much! (2500 K)/Can put Bloc

Special:CreateTileSheet overwrite existing option doesn't work

[9424e66706b9a361a2d5bdc4] /Special:CreateTileSheet TypeError from line 493 of /home/hydra/stable_public_html/includes/logging/LogEntry.php: Argument 1 passed to ManualLogEntry::setPerformer() must be an instance of User, string given, called in /home/hydra/stable_public_html/extensions/Tilesheets/special/SheetManager.php on line 96

Backtrace:

#0 /home/hydra/stable_public_html/extensions/Tilesheets/special/SheetManager.php(96): ManualLogEntry->setPerformer(string)
#1 /home/hydra/stable_public_html/extensions/Tilesheets/special/CreateTileSheet.php(72): SheetManager::deleteEntry(string, string)
#2 /home/hydra/stable_public_html/includes/specialpage/SpecialPage.php(522): CreateTileSheet->execute(NULL)
#3 /home/hydra/stable_public_html/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
#4 /home/hydra/stable_public_html/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#5 /home/hydra/stable_public_html/includes/MediaWiki.php(862): MediaWiki->performRequest()
#6 /home/hydra/stable_public_html/includes/MediaWiki.php(523): MediaWiki->main()
#7 /home/hydra/stable_public_html/index.php(43): MediaWiki->run()
#8 {main}

API needed

The extension needs an API. Here's what is needed:

  • List sheets
  • Add sheets
  • Delete sheets
  • Edit sheets
  • List tiles with filtering by mod
  • Add tiles
  • Delete tiles
  • Edit tiles

Do all work on the API branch until fully working.

Tile localization and better tooltips

In an effort to improve the tilesheet extension the following plan has been laid out which will allow for translation of tilesheet icons as well as improved tooltips. Even translation into English will be useful as it will allow multiple icons on a tilesheet to share the same display name, as well as allowing custom tooltips to be assigned across the wiki.

  • Add a table to the database with 4 columns for entry id (matching the entry id in the existing table), language code (such as en, de, or ru), display name, and description.
  • Add a special page where translators can translate tilesheet icons, assigning them a display name and description that suits their language.
  • For invoking the tilesheet extension add tooltip parameters and having the extension output the appropriate tooltip code, instead of the wrapping template handle it. Order of priority for the tooltip is tooltip parameter at invocation, display name + description from the new table, and defaulting to the item name in the tilesheet itself.

[API] Tiles query broken

I was trying to make a tile deletion script because I was too lazy to delete the tiles manually, but it didn't work.

# Copyright (C) 2016, Eric Schneider (xbony2)
# All rights reserved.

require "mediawiki/butt"

butt = MediaWiki::Butt.new("http://ftb.gamepedia.com")

puts "Please enter the password."
butt.login("ESAEBSAD", gets.chomp)

puts "Please enter the tilesheet abbreviation."
tilesheet = gets.chomp

tiles = butt.post({action: "query", list: "tiles", tslimit: 500, tsmod: tilesheet})

#butt.post({action: "deletetiles", tsids: tiles["query"]["tiles"].keys, tssummary: "", tstoken: butt.get_token("edit")})
puts tiles.to_s

returns

{"batchcomplete"=>"", "query"=>{"tiles"=>[]}}

Showing that the query seems to be broken or that I'm missing something.

(Also TODO: delete tilesheet "ESAEBSADTEST" on the FTB Wiki once possible)

E_USER_WARNING: Invalid parameter for message "logentry-tilesheet-deletesheet": a:1:{i:0;s:3:&quot;TDM&quot;;}

This came out of New Relic error reporting. I can not find exactly what caused it other than the user being on Special:RecentChanges.

in trigger_error called at includes/Message.php (1078)
in Message::extractParam called at includes/Message.php (1037)
…sage::replaceParameters called at includes/Message.php (804)
in Message::toString called at includes/Message.php (897)
…e::escaped called at includes/logging/LogFormatter.php (407)
…tActionText called at includes/changes/ChangesList.php (442)
…LogEntry called at includes/changes/OldChangesList.php (115)
…angeLine called at includes/changes/OldChangesList.php (51)
…e called at includes/specials/SpecialRecentchanges.php (356)
…led at includes/specialpage/ChangesListSpecialPage.php (348)
…led at includes/specialpage/ChangesListSpecialPage.php (77)
…e called at includes/specials/SpecialRecentchanges.php (64)
…execute called at includes/specialpage/SpecialPage.php (384)
… called at includes/specialpage/SpecialPageFactory.php (553)
…eFactory::executePath called at includes/MediaWiki.php (281)
…aWiki::performRequest called at includes/MediaWiki.php (714)
in MediaWiki::main called at includes/MediaWiki.php (508)
in MediaWiki::run called at index.php (41)

Aliases

This is one of my crazy ideas, but I don't think it's too crazy, so I'll share it. Simple idea: allowing a tile to have aliases. For example, Stained Clay, Hardened Clay and Terracotta are all three names for one block in Vanilla in different versions. Doing {{Gc|mod=V|dis=false|title=Blue Hardened Clay|Blue Terracotta}} every page through 1.10-1.11 seems silly, and also it hurts automatically translated tile names (hopefully each alias could be translated).

Getting permission denied when trying to delete tiles

When I attempt to delete tiles using my bot account via the API I get the following error.

{
  "error": {
    "*": "See http://ftb.gamepedia.com/api.php for API usage",
    "code": "tspermissiondenied",
    "info": "You do not have permission to delete tiles"
  }
}

I'm pretty sure I am logged in to my bot account and my bot account is definitely has the edittilesheets right, so I'm not sure what is going on.

Peter's addtile complaints

  • Different maximum number of sizes for users and bots. Users can make tilesheets with 50 sizes, but bots can make sheets with 500 sizes. There's no real reason for this to be the case.
  • Performance is terrible. Peter says it was around 2 tiles per second
    • He wants an addtiles thing to import multiple at once.
  • JSON result does not give you the added tile's ID
  • Tiles can be added to nonexistent sheets.

TileList search case sensitivity

It's kind of hard to search for items there because of the exactitude you have to use for an item, take for instance searching "conduit" and on "mod" you input "EIO", if I do that, it doesn't give back any results, but under "mod: EIO" only, there's like 5 or 6 items with "conduit" on its name, I think it's because it case sensitive.

From Frenchiveruti on Template talk:Navbox Ender IO

Item name and mod abbreviation input validation

The item names and mod abbreviations must go through input validation to ensure we don't have errors by putting weird characters in them. Both of these must match $wgLegalTitleChars (see also #56) to be valid for page titles.

After this is implemented, someone will need to run a script to check all tile names and mod abbreviations that they are valid. For invalid chars, someone will need to manually update the database directly (since invalid characters prevents you from saving any changes after the invalid characters are added).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.