GithubHelp home page GithubHelp logo

Comments (5)

asamy avatar asamy commented on June 3, 2024
  • g_things.getThingNameById(id)
  • g_things.getThingIdByName(name)

Should these return an ItemType (OTB Type) or ThingType (DAT Type)?

  • g_map.colorThing(thing, { r, g, b, a})
  • g_map.removeThingColor(thing)

These functions sound expensive, i'll try to find another approach.

from forgottenmapeditor.

tosty33 avatar tosty33 commented on June 3, 2024

ItemType, they'll be used in search module :-)

from forgottenmapeditor.

asamy avatar asamy commented on June 3, 2024

The first one "getThingNameById" is already there:

local itemType = g_things.findItemTypeByClientId(id);
local itemName = itemType:getName()

The second one isn't, so i'm going to make it like so:

local itemType = g_things.findItemTypeByName(name);
local clientId = itemType:getClientId()
local serverId = itemType:getServerId()

(Being generic is better, because if I were not to make it generic, it would still use the same loop and everything)

from forgottenmapeditor.

asamy avatar asamy commented on June 3, 2024

OTClient's upstream commit edubart/otclient@5849136 implements g_things.findItemTypeByName

from forgottenmapeditor.

asamy avatar asamy commented on June 3, 2024

OTClient's upstream commit edubart/otclient@32647f1 implements:

  • g_map.colorizeThing(thing, color)
  • g_map.removeThingColor(thing)

Color can be in RGBA (a table) or a string (#ffffffff for example or just color name). Closing this now, open new issue if any bug.

from forgottenmapeditor.

Related Issues (20)

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.