From d1030b5198e53571a21fc69398f2e651e4df4a93 Mon Sep 17 00:00:00 2001 From: Maik Wild Date: Tue, 11 Sep 2018 16:55:20 +0200 Subject: [PATCH] created getter/setter for info. reverted info change --- info.lua | 56 ++++++++++++++++------ map_gen/combined/cave_miner/cave_miner.lua | 21 ++++++++ 2 files changed, 62 insertions(+), 15 deletions(-) diff --git a/info.lua b/info.lua index 69887197..292760ec 100644 --- a/info.lua +++ b/info.lua @@ -19,22 +19,12 @@ local new_info_key = 4 local welcomed_players = {} local editable_info = { - [map_name_key] = 'Cave Miner', + [map_name_key] = 'This Map has no name', [map_description_key] = [[ -Diggy Diggy Hole. -]], - [map_extra_info_key] = [[ -Delve deep for greater treasures, but also face increased dangers. - -Mining productivity research, will overhaul your whole mining equipment, -reinforcing your pickaxe as well as increasing the size of your backpack. - -Darkness is a hazard in the mines, stay near your lamps. - -Breaking rocks is exhausting work and will make you hungry. -So don´t forget to eat some fish once in a while to stay well fed. -But be careful, eating too much might have it´s consequences too... -]], +By default this section is blank as it's supposed to be filled out on a per map basis. +(If you're seeing this message, ping the admin team to get a description added for +this map)]], + [map_extra_info_key] = 'This map has no extra infomation', [new_info_key] = 'Nothing is new. The world is at peace' } @@ -711,3 +701,39 @@ Gui.on_custom_close( Gui.destroy(event.element) end ) + +local Public = {} + +function Public.get_map_name() + return editable_info[map_name_key] +end + +function Public.set_map_name(value) + editable_info[map_name_key] = value +end + +function Public.get_map_description() + return editable_info[map_description_key] +end + +function Public.set_map_description(value) + editable_info[map_description_key] = value +end + +function Public.get_map_extra_info() + return editable_info[map_extra_info_key] +end + +function Public.set_map_extra_info(value) + editable_info[map_extra_info_key] = value +end + +function Public.get_new_info() + return editable_info[new_info_key] +end + +function Public.set_new_info(value) + editable_info[new_info_key] = value +end + +return Public diff --git a/map_gen/combined/cave_miner/cave_miner.lua b/map_gen/combined/cave_miner/cave_miner.lua index cff9d9d8..a8df65eb 100644 --- a/map_gen/combined/cave_miner/cave_miner.lua +++ b/map_gen/combined/cave_miner/cave_miner.lua @@ -17,6 +17,27 @@ local simplex_noise = require 'map_gen.shared.simplex_noise' local Event = require 'utils.event' local market_items = require "map_gen.combined.cave_miner.market_items" + +local Info = require 'info' + +Info.set_map_name('Cave Miner') +Info.set_map_description([[ +Diggy Diggy Hole. +]]) +Info.set_map_extra_info([[ +Delve deep for greater treasures, but also face increased dangers. + +Mining productivity research, will overhaul your whole mining equipment, +reinforcing your pickaxe as well as increasing the size of your backpack. + +Darkness is a hazard in the mines, stay near your lamps. + +Breaking rocks is exhausting work and will make you hungry. +So don´t forget to eat some fish once in a while to stay well fed. +But be careful, eating too much might have it´s consequences too... +]]) + + if global.scenario and global.config then if global.config.player_list then global.scenario.config.player_list.enable_coin_col = nil