Advertisement
Jaizu85

Untitled

Oct 10th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. module GameData
  2. module Colors
  3. Fonts.define_fill_color(24, Color.new(0, 0, 0))
  4. Fonts.define_shadow_color(24, Color.new(148, 148, 165))
  5. end
  6. end
  7.  
  8. class Spriteset_Map
  9. PANNEL_COORDINATES = {
  10. 0 => {
  11. bg_x: 10,
  12. bg_y: -25,
  13. txt_height: 27,
  14. txt_x: 15,
  15. txt_y: -20,
  16. fill_color: 24
  17. },
  18. 10 => {
  19. bg_x: 4,
  20. bg_y: -24,
  21. txt_height: 27,
  22. txt_x: 14,
  23. txt_y: -20, # <= Fix this value
  24. fill_color: 24
  25. }
  26. }
  27. PANNEL_COORDINATES.default = PANNEL_COORDINATES[0]
  28.  
  29. def create_panel(zone)
  30. return unless zone && GameData::Zone.get(zone).panel_id > 0
  31. coords = PANNEL_COORDINATES[pid = GameData::Zone.get(zone).panel_id]
  32. @sp_bg ||= Sprite.new
  33. @sp_bg.set_position(coords[:bg_x], coords[:bg_y])
  34. @sp_bg.z = 5001
  35. @sp_bg.bitmap = RPG::Cache.windowskin("pannel_#{pid}")
  36. map_name = PFM::Text.parse_string_for_messages(GameData::Zone.get(zone).map_name)
  37. color = coords[:fill_color]
  38. map_name.gsub!(/\\c\[([0-9]+)\]/) do
  39. color = $1.to_i
  40. nil
  41. end
  42. @sp_fg&.dispose
  43. @sp_fg = Text.new(0, nil, coords[:txt_x], coords[:txt_y], 0, coords[:txt_height],
  44. map_name, 0, Text::Util::DEFAULT_OUTLINE_SIZE, color)
  45. @sp_fg.z = 5002
  46. @counter = 0
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement