CORE/mcl_colors: Add mod providing global color values #172

Merged
erlehmann merged 3 commits from add-mcl-colors into master 2021-11-18 21:57:09 +01:00
Owner
Problem

TRACKING ISSUE: #171

Code from MineClone2 and compatible with MineClone2 increasingly relies on having a single mod providing a table with color values. That mod is named mcl_colors. Newer MineClone2 mods – notably mcl_speedrun – may depend on mcl_colors and not work without it.

Solution

Cherry-pick the following commits, in order, from MineClone2:

  • ee084f33a7 – Add mcl_colors
  • 6f9c1856b8bae6b7293ead323ab291aa482a0b81 – add API documentation to mcl_colors (!)
Details

The content of mods/CORE/mcl_colors/init.lua is just one table:

mcl_colors = {
	BLACK = "#000000",
	DARK_BLUE = "#0000AA",
	DARK_GREEN = "#00AA00",
	DARK_AQUA = "#00AAAA",
	DARK_RED = "#AA0000",
	DARK_PURPLE = "#AA00AA",
	GOLD = "#FFAA00",
	GRAY = "#AAAAAA",
	DARK_GRAY = "#555555",
	BLUE = "#5555FF",
	GREEN = "#55FF55",
	AQUA = "#55FFFF",
	RED = "#FF5555",
	LIGHT_PURPLE = "#FF55FF",
	YELLOW = "#FFFF55",
	WHITE = "#FFFFFF",
	background = {
		BLACK = "#000000",
		DARK_BLUE = "#00002A",
		DARK_GREEN = "#002A00",
		DARK_AQUA = "#002A2A",
		DARK_RED = "#2A0000",
		DARK_PURPLE = "#2A002A",
		GOLD = "#2A2A00",
		GRAY = "#2A2A2A",
		DARK_GRAY = "#151515",
		BLUE = "#15153F",
		GREEN = "#153F15",
		AQUA = "#153F3F",
		RED = "#3F1515",
		LIGHT_PURPLE = "#3F153F",
		YELLOW = "#3F3F15",
		WHITE = "#373501",
	}
}
Testing Steps
  1. Get the mcl_speedrun mod from https://github.com/AFCMS/mcl_speedrun and put it in the mods directory.
  2. Create a new Mineclonia world and activate the mcl_speedrun mod for it.
  3. In advanced settings, activate for mcl_speedrun the speedrun type all-achievements.
  4. Start Mineclonia at commit 434e545745. Note that mcl_speedrun complains about missing mcl_colors and no timer and no list of achievements are shown at the left side of the screen.
  5. Start Mineclonia at commit 6bd4b0e62c. Note that a timer and a list of achievements are shown at the left side of the screen.
To do
  • Finish PR description
  • Write test plan
  • Test
##### Problem TRACKING ISSUE: https://git.minetest.land/Mineclonia/Mineclonia/issues/171 Code from MineClone2 and compatible with MineClone2 increasingly relies on having a single mod providing a table with color values. That mod is named mcl_colors. Newer MineClone2 mods – notably mcl_speedrun – may depend on mcl_colors and not work without it. ##### Solution Cherry-pick the following commits, in order, from MineClone2: * ee084f33a7 – Add mcl_colors * 6f9c1856b8bae6b7293ead323ab291aa482a0b81 – add API documentation to mcl_colors (!) ##### Details The content of `mods/CORE/mcl_colors/init.lua` is just one table: ``` mcl_colors = { BLACK = "#000000", DARK_BLUE = "#0000AA", DARK_GREEN = "#00AA00", DARK_AQUA = "#00AAAA", DARK_RED = "#AA0000", DARK_PURPLE = "#AA00AA", GOLD = "#FFAA00", GRAY = "#AAAAAA", DARK_GRAY = "#555555", BLUE = "#5555FF", GREEN = "#55FF55", AQUA = "#55FFFF", RED = "#FF5555", LIGHT_PURPLE = "#FF55FF", YELLOW = "#FFFF55", WHITE = "#FFFFFF", background = { BLACK = "#000000", DARK_BLUE = "#00002A", DARK_GREEN = "#002A00", DARK_AQUA = "#002A2A", DARK_RED = "#2A0000", DARK_PURPLE = "#2A002A", GOLD = "#2A2A00", GRAY = "#2A2A2A", DARK_GRAY = "#151515", BLUE = "#15153F", GREEN = "#153F15", AQUA = "#153F3F", RED = "#3F1515", LIGHT_PURPLE = "#3F153F", YELLOW = "#3F3F15", WHITE = "#373501", } } ``` ##### Testing Steps 1. Get the mcl_speedrun mod from https://github.com/AFCMS/mcl_speedrun and put it in the `mods` directory. 2. Create a new Mineclonia world and activate the `mcl_speedrun` mod for it. 3. In advanced settings, activate for `mcl_speedrun` the speedrun type `all-achievements`. 4. Start Mineclonia at commit 434e545745889197982a4bb80f22862048855e43. Note that `mcl_speedrun` complains about missing `mcl_colors` and no timer and no list of achievements are shown at the left side of the screen. 5. Start Mineclonia at commit 6bd4b0e62c703f4e5a599e3bf8df9201aa7deae0. Note that a timer and a list of achievements are shown at the left side of the screen. ##### To do - [x] Finish PR description - [x] Write test plan - [x] Test
erlehmann added 2 commits 2021-11-18 19:22:18 +01:00
erlehmann added 1 commit 2021-11-18 19:24:14 +01:00
Li0n approved these changes 2021-11-18 21:55:22 +01:00
Li0n left a comment
Member

looks ok. seems unlikely to introduce bugs. I playtested it for an hour and did not run into any issues.

looks ok. seems unlikely to introduce bugs. I playtested it for an hour and did not run into any issues.
erlehmann merged commit fc47f0a87e into master 2021-11-18 21:57:09 +01:00
erlehmann deleted branch add-mcl-colors 2021-11-18 21:58:15 +01:00
This repo is archived. You cannot comment on pull requests.
No description provided.