Giter Club home page Giter Club logo

Comments (1)

JulianStiebler avatar JulianStiebler commented on September 6, 2024

Related code:

function MDT:DrawNote(x, y, text, objectIndex)
  if not notePoolCollection then
    notePoolCollection = CreateFramePoolCollection()
    notePoolCollection:CreatePool("Button", MDT.main_frame.mapPanelFrame, "QuestPinTemplate")
  end
  local scale = MDT:GetScale()
  --setup
  local note = notePoolCollection:Acquire("QuestPinTemplate")
  -- FramePoolCollection_GetPoolKey is concatenating the sixth argument of CreatePool ("specialization").
  -- This naive approach is just using toString on any value, even nil, which results in "nil" as a string.
  -- Because of this our pool key is "QuestPinTemplatenil" instead of "QuestPinTemplate".
  note.noteIdx = notePoolCollection.pools.QuestPinTemplatenil.numActiveObjects
  note.objectIndex = objectIndex
  note:ClearAllPoints()
  note:SetPoint("CENTER", MDT.main_frame.mapPanelTile1, "TOPLEFT", x, y)
  note:SetSize(12 * scale, 12 * scale)
  note.NormalTexture:SetSize(15 * scale, 15 * scale)
  note.PushedTexture:SetSize(15 * scale, 15 * scale)
  note.HighlightTexture:SetSize(15 * scale, 15 * scale)
  note.Display.Icon:SetSize(16 * scale, 16 * scale)
  note.NormalTexture:SetTexture("Interface/WorldMap/UI-QuestPoi-NumberIcons")
  note.PushedTexture:SetTexture("Interface/WorldMap/UI-QuestPoi-NumberIcons")
  note.HighlightTexture:SetTexture("Interface/WorldMap/UI-QuestPoi-NumberIcons")
  note.Display.Icon:SetTexture("Interface/WorldMap/UI-QuestPoi-NumberIcons")
  note.NormalTexture:SetTexCoord(0.500, 0.625, 0.375, 0.5)
  note.PushedTexture:SetTexCoord(0.375, 0.500, 0.375, 0.5)
  note.HighlightTexture:SetTexCoord(0.625, 0.750, 0.375, 0.5)
  -- temporary fix for there not being enough textures in the atlas
  -- should copy and fix the atlas instead
  local idx = note.noteIdx % 25
  if idx == 0 then idx = 1 end
  note.Display.Icon:SetTexCoord(POIButton_CalculateNumericTexCoords(idx, 0))
  note.Display.Icon:Show()
  note.tooltipText = text or ""

from mythicdungeontools.

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.