[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Improved Aardwolf "bigmap" miniwindow-based plugin
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Improved Aardwolf "bigmap" miniwindow-based plugin

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  3  

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Sun 26 Jul 2009 04:32 AM (UTC)

Amended on Wed 19 Aug 2009 05:51 AM (UTC) by Nick Gammon

Message
The plugin below is based on the "big map" plugin I did a while ago for Aardwolf. However the older one used a "dummy world" window, whereas this uses a miniwindow.

The miniwindow can be moved around to wherever you like. You can toggle it on or off by typing "bigmap" (it might be an idea to make a macro like F10 do that).

An improved feature of the map is a blue circle which is drawn around your current location, making it very obvious where you are on the map.

Template:saveplugin=Aardwolf_BigMap_v2 To save and install the Aardwolf_BigMap_v2 plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Aardwolf_BigMap_v2.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Aardwolf_BigMap_v2.xml (which you just saved in step 3) as a plugin
  7. Click "Close"


The plugin uses telnet negotation, so you also need this file:

http://www.gammon.com.au/mushclient/plugins/Aardwolf/telnet_options.lua

That should also go into the plugins folder.


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, June 30, 2007, 10:48  -->
<!-- MuClient version 4.13 -->

<muclient>
<plugin
   name="Aardwolf_BigMap_v2"
   author="Nick Gammon"
   id="15f26e97b2d58b7b5412c278"
   language="Lua"
   purpose="Redirects Aardwolf bigmap messages to a miniwindow"
   date_written="2009-07-26"
   requires="4.42"
   version="1.0"
   save_state="y"
   >
<description trim="y">
Redirects the bigmap to a miniwindow.

Commands:

bigmap remove map cache  --> removes the cache, forcing maps to be downloaded
                               (only do this after a major continent upgrade)
                      
bigmap auto              --> toggle auto-minimize map
bigmap auto on           --> auto-hide map when you enter an area
bigmap auto off          --> manually hide map
bigmap on                --> show the map
bigmap off               --> hide the map

</description>

</plugin>

<!--  Triggers  -->

<triggers>

  <trigger
   enabled="y"
   match="^\{bigmap\}(?<zone>\d+)\,(?<zonename>.+)$"
   script="map_redirect"
   omit_from_output="y"
   name="map_start"
   sequence="100"
   regexp="y"
  >
  </trigger>
 
  <trigger
   enabled="n"
   match="*"
   script="map_redirect"
   name="multi_line_map"
   omit_from_output="y"
   sequence="10"
  >
  </trigger>

  <trigger
   enabled="y"
   match="^\{coords\}(?<zone>\d+)\,(?<x>\d+)\,(?<y>\d+)$"
   omit_from_output="y"
   regexp="y"
   script="updatelocation"
   sequence="100"
  >
  </trigger>
  

 <trigger
   enabled="y"
   match="{coords}-1"
   omit_from_output="y"
   sequence="100"
   send_to="14"
   script="in_zone"
  >
  </trigger>

</triggers>

<aliases>

  <alias
   name="remove_alias"
   script="remove_cache"
   match="bigmap remove map cache"
   enabled="y"
   sequence="100"
   ignore_case="y"
  >
  </alias>
  
 <alias
   script="auto_minimize_alias"
   match="^bigmap auto( on| off)?$"
   enabled="y"
   regexp="y"
   sequence="100"
   ignore_case="y"
  >
  </alias>
    
<alias
   script="map_on_off_alias"
   match="^bigmap( on| off)?$"
   enabled="y"
   regexp="y"
   sequence="100"
   ignore_case="y"
  >
  </alias>
    
</aliases>


<!--  Script  -->


<script>
<![CDATA[
folder = "Aardwolf"

require "serialize"  -- needed to serialize table to string
require "checkplugin"
require "movewindow"

map = {}
continents = {}
xref = {}
auto_minimize = true
show_map = true
background_colour = 0x000028
title_colour = 0x696969
zone_name_colour = ColourNameToRGB "yellow"

function remove_cache ()
  continents = {}
  xref = {}
  ColourNote ("white", "blue", "Big maps removed from cache.")
end -- remove_cache

function auto_minimize_alias (name, line, wildcards)
  if wildcards [1] == false then
    auto_minimize = not auto_minimize
  elseif wildcards [1]:lower () == " on" then
    auto_minimize = true
  elseif wildcards [1]:lower () == " off" then
    auto_minimize = false
  end -- if
  
  if auto_minimize then
    ColourNote ("yellow", "", "Bigmap auto-hide enabled.")
  else
    ColourNote ("yellow", "", "Bigmap auto-hide DISABLED.")
  end -- if  
    
end -- auto_minimize_alias

function map_on_off_alias (name, line, wildcards)
  if wildcards [1] == false then
    show_map = not show_map
  elseif wildcards [1]:lower () == " on" then
    show_map = true
  elseif wildcards [1]:lower () == " off" then
    show_map = false
  end -- if
  
  if show_map then
    ColourNote ("yellow", "", "Bigmap enabled.")
    if map and #map > 0 then
      WindowShow (win, true)
    end -- showing
  else
    ColourNote ("yellow", "", "Bigmap DISABLED - type 'bigmap' to re-enable.")
    WindowShow (win, false)
  end -- if  
    
end -- auto_minimize_alias


function in_zone (name, line, wildcards)
  if auto_minimize then
     WindowShow (win, false)
  end -- if
end -- in_zone


function InsertLocation (line, x)
  t = {}
  col = 1
  
  for i, item in ipairs (line) do

    -- to make it easier for me, I will expand out multiple-column runs    
    if item.length > 1 then
      for j = item.length, 2, -1 do
        table.insert (line, i + 1,
                            { text = item.text:sub (j, j), 
                              textcolour = item.textcolour, 
                              backcolour = item.backcolour, 
                              length = 1, 
                              style = style } )
      end -- adding new ones
      
      item.length = 1
      item.text = item.text:sub (1, 1)
    end -- if multiple columns
    
    -- at column, do *
    
    if col == x then
      table.insert (t, { text = "*", textcolour = 0x00FFFF, backcolour = 0x000000 } )
    else
      table.insert (t, item)
    end -- if column
    
    col = col + item.length
  end -- for
  
  return t
  
end -- InsertLocation

function Display_Styled_Line (line, styles, id)

local left = 5
local top = (line - 1) * font_height + 5

  for _, v in ipairs (styles) do
    left = left + WindowText (win, id, v.text, left, top, 0, 0, v.textcolour)
  end -- for each style run                 

end -- Display_Styled_Line

function Display_Line (line, text, id, colour)

local left = 5
local top = (line - 1) * font_height

  WindowText (win, id, text, left, top, 0, 0, colour)

end -- Display_Line

function DrawMap (x, y)

  local origx, origy = x, y
  x = x + 1  -- allow for border, make 1-relative
  y = y + 1  -- ditto
  
  if not map or #map == 0 then
    return
  end -- no map
   
  local lines = #map + 2
  local columns = 0
  for _, v in ipairs (map [1]) do
    columns = columns + v.length
  end -- for
  local window_width = columns * font_width + 10
  local window_height =  lines * font_height + 15
   -- recreate the window the correct size
   WindowCreate (win, 
                 windowinfo.window_left, 
                 windowinfo.window_top, 
                 window_width,     -- width
                 window_height,  -- height
                 windowinfo.window_mode,   
                 windowinfo.window_flags,
                 background_colour) 
  
   WindowDeleteAllHotspots (win)
   movewindow.add_drag_handler (win, 0, 0, 0, font_height, 1)
   
  local name = continent or ""
  local namewidth = WindowTextWidth (win, font_id, name)
  WindowText (win, font_id, name, (window_width - namewidth) / 2, 5, 0, 0, zone_name_colour)  -- title
  
  
  for i, v in ipairs (map) do
    if i == y then
      Display_Styled_Line (i + 1, InsertLocation (v, x), font_id)
    else
      Display_Styled_Line (i + 1, v, font_id)
    end
  end -- for
  
  local our_location_x = (x - 1) * font_width + (font_width / 2) + 5
  local our_location_y = (y) * font_height + (font_height / 2) + 5
  
  -- draw circle around us
  WindowCircleOp (win, 1, 
                  our_location_x - 20, our_location_y - 20,
                  our_location_x + 20, our_location_y + 20,
                  ColourNameToRGB "cornflowerblue",  -- pen colour
                  0, -- solid pen
                  3, -- pen width
                  0, -- brush colour
                  1 ) -- null brush
                  
  WindowCircleOp (win, 1, 
                  our_location_x - 20, our_location_y - 20,
                  our_location_x + 20, our_location_y + 20,
                  ColourNameToRGB "cyan",  -- pen colour
                  0, -- solid pen
                  1, -- pen width
                  0, -- brush colour
                  1 ) -- null brush
  
  local coords = string.format ("Location: %2i, %2i", origx, origy)
  local coordswidth = WindowTextWidth (win, font_id, coords)
  WindowText (win, font_id, coords, (window_width - coordswidth) / 2, 
             (#map + 1) * font_height + 5, 0, 0, zone_name_colour)  -- title
  
  Display_Line (#map + 1, coords, font_id, 0x000000)
 
  -- DrawEdge rectangle
  WindowRectOp (win, 5, 0, 0, 0, 0, 10, 15)
  
  WindowShow (win, true)
  
  Repaint ()
end -- DrawMap

function updatelocation (name, line, wildcards)
  -- where we are
  x = tonumber (wildcards.x) 
  y = tonumber (wildcards.y)
  zone = tonumber (wildcards.zone)
  
  -- changed continent?
  if old_zone ~= zone then
  
    -- grab cached map
    map = continents [zone]
    continent = xref [zone]
    
    -- no cached map? better get it
    if not map then
      SendNoEcho "bigmap noself" -- grab map
    end -- don't know this one
    old_zone = zone
  end -- need big map
  
  -- draw our location
  if map then
    DrawMap (x, y)
  end -- if
end -- updatelocation


-- map redirector
function map_redirect (name, line, wildcards, styles)

  EnableTrigger ("multi_line_map", true)  -- capture subsequent lines

  if name == "map_start" then
    map = {}  -- start new map
    continent = wildcards.zonename
    zone = tonumber (wildcards.zone)
    xref [zone] = wildcards.zonename
  elseif line == "{/bigmap}" then
    EnableTrigger ("multi_line_map", false)  -- no more lines to go
    
    table.remove (map, 1)  -- remove first line (the border) 
    map [#map] = nil  -- remove last line (the other border)
    
    for _, v in ipairs (map) do
      
      if v [1].text == "|" then
        table.remove (v, 1)
      end -- remove first border
      
     if v [#v].text == "" then
        v [#v] = nil
      end -- remove last border
      
      if v [#v].text == "|" then
        v [#v] = nil
      end -- remove last border
    
    end -- for
    
    if zone then
      continents [zone] = map  -- cache it
    end -- we know the continent
    
    DrawMap (x, y)
  else
    table.insert (map, styles)
  end -- if

  
end -- function map_redirect 

function OnPluginInstall ()
  assert (loadstring (GetVariable ("continents") or "")) ()
  assert (loadstring (GetVariable ("xref") or "")) ()
  auto_minimize = (GetVariable ("auto_minimize") or auto_minimize) == "true"

  win = GetPluginID ()

  local fonts = utils.getfontfamilies ()
  if fonts.Dina then
    font_size = 8
    font_name = "Dina"    -- the actual font
  else
    font_size = 10
    font_name = "Courier"
  end -- if
    
  font_id = "map_font"  -- our internal name
  font_id_bold = "map_font_bold"  -- our internal name

  windowinfo = movewindow.install (win, 6)
  
  -- make miniwindow so I can grab the font info
  check (WindowCreate (win, 
                 windowinfo.window_left, 
                 windowinfo.window_top, 
                 1, 1,  
                 windowinfo.window_mode,   
                 windowinfo.window_flags,
                 background_colour) )
  
  check (WindowFont (win, font_id, font_name, font_size, false, false, false, false, 0, 49))  -- normal
  font_height = WindowFontInfo (win, font_id, 1) -  WindowFontInfo (win, font_id, 4) + 1 -- height
  font_width = WindowFontInfo (win, font_id, 6)  -- avg width
  descent = WindowFontInfo (win, font_id, 3)
  
  if GetVariable ("enabled") == "false" then
    ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
    check (EnablePlugin(GetPluginID (), false))
    return
  end -- they didn't enable us last time
  
  OnPluginEnable ()  -- do initialization stuff
  
end -- OnPluginInstall

function OnPluginSaveState ()
  SetVariable ("continents", 
               "continents = " .. serialize.save_simple (continents))
               
  SetVariable ("xref", 
               "xref = " .. serialize.save_simple (xref))
               
  SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
  SetVariable ("auto_minimize", tostring (auto_minimize))
               
  movewindow.save_state (win)
  
end -- function OnPluginSaveState

-- pull in telnet option handling
dofile (GetPluginInfo (GetPluginID (), 20) .. "telnet_options.lua")

function OnPluginConnect ()
  TelnetOptionOn (TELOPT_BIGMAP)
end -- function OnPluginConnect

function OnPluginClose ()
  -- if enabled
  if GetPluginInfo (GetPluginID (), 17) then  
    TelnetOptionOff (TELOPT_BIGMAP)
  end -- currently enabled
end -- OnPluginClose

function OnPluginEnable ()

  -- if we are connected when the plugin loads, it must have been reloaded whilst playing
  if IsConnected () then
    OnPluginConnect ()
  end -- if already connected

end -- OnPluginEnable

function OnPluginDisable ()
  TelnetOptionOff (TELOPT_BIGMAP)

  WindowShow (win, false)
  
end -- OnPluginDisable

]]>
</script>
</muclient>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 26 Jul 2009 04:33 AM (UTC)
Message

Here is an example of the bigmap window:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by KaVir   Germany  (117 posts)  [Biography] bio
Date Reply #2 on Tue 28 Jul 2009 12:12 PM (UTC)
Message
It looks really good, but like all the other maps I've seen it's still using ASCII characters. How much effort would it take to use little texture images instead? I know you support them - are there any problems with using so many at the same time? Or is it just that you wanted a generic solution, rather than one which relied on lots of predefined graphics and a mud-specific terrain set?
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #3 on Tue 28 Jul 2009 03:24 PM (UTC)
Message
There shouldn't be any problems to add such functionality.

Don't forget that these plugins have a secondary purpose of being examples on how to do more complicated things in MUSHclient. If it were to throw too many different things together in one file it would become far harder for people to get started to understand how this kind of plugin works.

Basically, the current plugin is a (simple) matter of creating the window, parsing data, and re-outputting them in a miniwindow. If it were to involve custom images and such it would be just that bit more complicated - and it is actually quite simply to add if you have the images ready.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Tue 28 Jul 2009 09:47 PM (UTC)
Message

It can certainly be done, as Worstje said. Just to show the general idea I adapted it to draw with various brushes rather than use text - the brush was selected based on the underlying character. The colour is unchanged. It looks OK, it would probably be better if you sat down and worked out individual images for each terrain type.

Notice the aspect ratio is different - each tile is now square, they weren't when drawing with a font.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Tue 28 Jul 2009 09:49 PM (UTC)
Message
The other thing you could do is to get someone artistic to simply draw a nice map of the continent, and draw that. Then just use the circle to show whereabouts you are on it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Tue 28 Jul 2009 10:06 PM (UTC)
Message
The differences are:


*** Aardwolf_bigmap_miniwindow.xml	Sun Jul 26 12:18:03 2009
--- Aardwolf_bigmap_miniwindow_graphical.xml	Wed Jul 29 07:42:14 2009
***************
*** 135,140 ****
--- 136,142 ----
  background_colour = 0x000028
  title_colour = 0x696969
  zone_name_colour = ColourNameToRGB "yellow"
+ rectangle_size = 8
  
  function remove_cache ()
    continents = {}
***************
*** 224,236 ****
    
  end -- InsertLocation
  
  function Display_Styled_Line (line, styles, id)
  
  local left = 5
! local top = (line - 1) * font_height + 5
  
    for _, v in ipairs (styles) do
!     left = left + WindowText (win, id, v.text, left, top, 0, 0, v.textcolour)
    end -- for each style run                 
  
  end -- Display_Styled_Line
--- 226,259 ----
    
  end -- InsertLocation
  
+ brushes = {
+   ["~"] = 11,
+   ["?"] = 9,
+   ["^"] = 12,
+   ["."] = 5,
+   }
+   
  function Display_Styled_Line (line, styles, id)
  
  local left = 5
! local top = (line - 1) * rectangle_size + 15
  
    for _, v in ipairs (styles) do
!     
!     for i = 1, #v.text do
!       local char = string.sub (v.text, i, i)
!       local brush = brushes [char] or 8
!       local backcolour = 0x000000
!       if brush == 0 then 
!         backcolour = v.textcolour
!       end -- if 
!       WindowCircleOp(win, 2, left, top, left + rectangle_size, top + rectangle_size,
!                     v.textcolour, 5, 0,   -- pen colour, null pen, pen width
!                     backcolour, brush)  -- brush colour, style
!       
!       left = left + rectangle_size
!     end -- for each character
!         
    end -- for each style run                 
  
  end -- Display_Styled_Line
***************
*** 259,266 ****
    for _, v in ipairs (map [1]) do
      columns = columns + v.length
    end -- for
!   local window_width = columns * font_width + 10
!   local window_height =  lines * font_height + 15
     -- recreate the window the correct size
     WindowCreate (win, 
                   windowinfo.window_left, 
--- 282,289 ----
    for _, v in ipairs (map [1]) do
      columns = columns + v.length
    end -- for
!   local window_width = columns * rectangle_size + 10
!   local window_height =  lines * rectangle_size + 15 + (font_height * 2)
     -- recreate the window the correct size
     WindowCreate (win, 
                   windowinfo.window_left, 
***************
*** 287,294 ****
      end
    end -- for
    
!   local our_location_x = (x - 1) * font_width + (font_width / 2) + 5
!   local our_location_y = (y) * font_height + (font_height / 2) + 5
    
    -- draw circle around us
    WindowCircleOp (win, 1, 
--- 310,317 ----
      end
    end -- for
    
!   local our_location_x = (x - 1) * rectangle_size + (rectangle_size / 2) + 5
!   local our_location_y = (y) * rectangle_size + (rectangle_size / 2) + 15
    
    -- draw circle around us
    WindowCircleOp (win, 1, 
***************
*** 312,318 ****
    local coords = string.format ("Location: %2i, %2i", origx, origy)
    local coordswidth = WindowTextWidth (win, font_id, coords)
    WindowText (win, font_id, coords, (window_width - coordswidth) / 2, 
!              (#map + 1) * font_height + 5, 0, 0, zone_name_colour)  -- title
    
    Display_Line (#map + 1, coords, font_id, 0x000000)
   
--- 335,341 ----
    local coords = string.format ("Location: %2i, %2i", origx, origy)
    local coordswidth = WindowTextWidth (win, font_id, coords)
    WindowText (win, font_id, coords, (window_width - coordswidth) / 2, 
!              window_height - font_height - 10, 0, 0, zone_name_colour)  -- title
    
    Display_Line (#map + 1, coords, font_id, 0x000000)
   



Basically, Display_Styled_Line was rewritten, and a couple of spots that worked out window size based on the font size used the rectangle size instead.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Tue 28 Jul 2009 10:15 PM (UTC)
Message

The new look is growing on me. ;)

Compare these two different views of the same place:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #8 on Tue 28 Jul 2009 11:30 PM (UTC)
Message
Very cool. :)

But...


+ brushes = {
+   ["~"] = 11,
+   ["?"] = 9,
+   ["^"] = 12,
+   ["."] = 5,
+   }
...
!       local brush = brushes [char] or 8
!       local backcolour = 0x000000
!       if brush == 0 then 
!         backcolour = v.textcolour
!       end -- if 


brush will never equal 0. If it's not in the table, it's 8. So why test for it?

[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Wed 29 Jul 2009 12:16 AM (UTC)
Message
lol

Yes, true. But when I was testing, I tried brush 0 for some terrain types. However for brush 0 the background colour needs to change, not the foreground colour, hence that line of code.

So, if you tweak it, and use brush 0, it will work. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Blainer   (191 posts)  [Biography] bio
Date Reply #10 on Wed 29 Jul 2009 02:06 AM (UTC)
Message
That looks great and frees up screen space.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Wed 29 Jul 2009 02:45 AM (UTC)
Message

Thanks! And if you want to take even less space, drop down the rectangle size in the code. The example below reduced from 8 x 8 to 6 x 6 pixels:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Wed 29 Jul 2009 03:17 AM (UTC)
Message
I experimented with a custom image for the zone entrance, to see how well that went. The creation was here (after creating the map window):


 WindowCreateImage (win, "zone",
        tonumber ("00011000", 2),  -- row 8
        tonumber ("00111100", 2),  -- row 7
        tonumber ("01000010", 2),  -- row 6
        tonumber ("10011001", 2),  -- row 5
        tonumber ("10011001", 2),  -- row 4
        tonumber ("01000010", 2),  -- row 3
        tonumber ("00111100", 2),  -- row 2
        tonumber ("00011000", 2))  -- row 1


And now Display_Styled_Line looks like this:


brushes = {
  ["~"] = 11,
  ["?"] = 9,
  ["^"] = 12,
  ["."] = 5,
  }
  
function Display_Styled_Line (line, styles, id)

local left = 5
local top = (line - 1) * rectangle_size + 15

  for _, v in ipairs (styles) do
    
    for i = 1, #v.text do
      local char = string.sub (v.text, i, i)
      local brush = brushes [char] or 8
      local backcolour = background_colour
      if brush == 0 then 
        backcolour = v.textcolour
      end -- if 
      WindowCircleOp(win, 2, left, top, left + rectangle_size, top + rectangle_size,
                    v.textcolour, 5, 0,   -- pen colour, null pen, pen width
                    backcolour, brush)  -- brush colour, style
                    
      -- special image for the zone entrance
      if char == "?" then
        WindowDrawImage (win, "zone", left, top, left + rectangle_size, top + rectangle_size, 2)
      end -- if

      left = left + rectangle_size
    end -- for each character
        
  end -- for each style run                 

end -- Display_Styled_Line


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Wed 29 Jul 2009 03:18 AM (UTC)
Message

With this result (the zone entrances are the things that look like circles with a dot in the middle):


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #14 on Wed 29 Jul 2009 03:21 AM (UTC)
Message
That looks great!

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


34,050 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]