Default Colors

Post Reply
Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Default Colors

Post by Jor'Mox »

Is there a way to get access to the colors in settings, so, for instance, you can always make something the same "light red" that the user sees when they get "light red" text from the game? I can obviously capture my own colors and store them in with the rest of the colors (and those are the default colors, so I'm sure they will work for most people) but once someone changes what their color settings are, then using those colors will no longer match.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Default Colors

Post by Vadi »

It's not possible to access that from Lua right now.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Default Colors

Post by Jor'Mox »

Thanks, I guess I'll just stick with what I have for now then. Is it just my imagination, or can you pull the colors for the mapper in Lua (which are also able to be adjusted in settings)?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Default Colors

Post by Vadi »

I think you can make use of them by setting the environment IDs, but not actually retrieve the values.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Default Colors

Post by Heiko »

The idea of user defined colors is that users can override script or game settings.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Default Colors

Post by Jor'Mox »

Exactly. I don't want to be able to change them, I want to be able to use those colors so that my script uses their color scheme.

User avatar
kevutian
Posts: 217
Joined: Fri Aug 20, 2010 8:18 pm
Location: United Kingdom
Contact:

Re: Default Colors

Post by kevutian »


User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Default Colors

Post by Vadi »

You can make use of them like I mentioned, you just can't retrieve the colors. See http://wiki.mudlet.org/w/Manual:Lua_Fun ... omEnvColor and setRoomEnv(). Here's an example from one of the mapping scripts:
Code: [show] | [select all] lua
  mmp.envids =
  {
		beach = 11,
		shallowwater = 4,
		river = 4,
		water = 4,
		["deep water"] = 4,
		bridge = 6,
		ocean = 4,
		underground = 8,
		cliffs = 1,
		mountain = 1,
		plains = 3,
		forest = 2,
		road = 6,
		urban = 8,
		building = 13,
		tundra = 7,
		swamp = 2,
		jungle = 10,
		desert = 11,
        highway = 6,
        path = 6,
  }

  for name, number in pairs(mmp.envids) do
    mmp.envids[name] = number+256 -- adjust for in-built colors
  end

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Default Colors

Post by Jor'Mox »

Thanks for the advice. I think for now I'll stick with tempColorTriggers used to capture each color as it first appears and then append it to the color table for later use. So, it will have my default values initially, and then have their default values ones the mud sends them any text using that ANSI color code.

Post Reply