lib/lotrd/view/town.rb in lotrd-0.1.8 vs lib/lotrd/view/town.rb in lotrd-0.1.9
- old
+ new
@@ -10,11 +10,11 @@
require_relative '../model/events'
module Town
def menu
system 'clear'
- player = YAML.load(File.read("lib/lotrd/model/playerdata.yml"))
+ player = YAML.load(File.read(ENV['HOME'] + "/." + "playerdata.yml"))
puts "Welcome to #{'Hazelwood'.colorize(:magenta)}, #{player.name.colorize(:yellow)}!" + "\n" + "=" * 40 + "\n"*2
puts ::Events.town + "\n"*2
prompt = TTY::Prompt.new
prompt.select("What would you like to do?") do |menu|
menu.choice 'Adventure'.colorize(:green), -> {::Adventure.start}
@@ -25,10 +25,10 @@
end
end
def quit
system 'clear'
- player = YAML.load(File.read("lib/lotrd/model/playerdata.yml"))
+ player = YAML.load(File.read(ENV['HOME'] + "/." + "playerdata.yml"))
system 'clear'
titleStyle = Artii::Base.new :font => 'slant'
puts "Thanks for playing! See you next time," +"\n"*4 + "#{(titleStyle.asciify(player.name)).colorize(:yellow)}"
sleep(3)
exit!