add HosterText

master
Christopher 2018-01-02 02:51:19 +01:00
parent 1d590786df
commit d534be2020
1 changed files with 19 additions and 0 deletions

View File

@ -86,6 +86,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
private bool m_enable_regionName = false;
private bool m_enable_regionPosition = false;
private bool m_enable_refreshEveryMonth = false;
private bool m_enable_HostedBy = false;
private String m_enable_HostedByText = "";
// private Bitmap lastImage = null;
private DateTime lastImageTime = DateTime.MinValue;
@ -122,6 +124,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
m_enable_regionName = Util.GetConfigVarFromSections<bool>(m_config, "enableName", configSections, false);
m_enable_regionPosition = Util.GetConfigVarFromSections<bool>(m_config, "enablePosition", configSections, false);
m_enable_refreshEveryMonth = Util.GetConfigVarFromSections<bool>(m_config, "RefreshEveryMonth", configSections, true);
m_enable_HostedBy = Util.GetConfigVarFromSections<bool>(m_config, "enableHostedBy", configSections, false);
m_enable_HostedByText = Util.GetConfigVarFromSections<String>(m_config, "HosterText", configSections, String.Empty);
if (!Directory.Exists(m_cacheDirectory))
Directory.CreateDirectory(m_cacheDirectory);
@ -230,6 +234,18 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
g.Flush();
}
private void writeHostedByOnMap(ref Bitmap _map)
{
RectangleF rectf = new RectangleF(2, m_scene.RegionInfo.RegionSizeX - 15, 200, 25);
Graphics g = Graphics.FromImage(_map);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.DrawString(m_enable_HostedByText, new Font("Arial", 8), Brushes.Gray, rectf);
g.Flush();
}
public Bitmap CreateMapTile()
{
if ((File.GetCreationTime(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp")).Month != DateTime.Now.Month) && m_enable_refreshEveryMonth == true)
@ -274,6 +290,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
if (m_enable_regionPosition)
writePositionOnMap(ref tile);
if (m_enable_HostedBy)
writeHostedByOnMap(ref tile);
tile.Save(System.IO.Path.Combine(m_cacheDirectory, m_scene.RegionInfo.RegionID + ".bmp"));
m_primMesher = null;
return tile;