Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Commit

Permalink
Set learning progress to be displayed according to the saved data
Browse files Browse the repository at this point in the history
Previously, learning progress cannot be seen when the player logged in
again. With this commit, player can see his/her learning progress in the
school at anytime (even changed rooms)

Also add the learning status to the profile command so players can see
what others are learning
  • Loading branch information
Seniru committed Jan 10, 2020
1 parent 0004f5c commit bbc31cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,9 @@ function displayProfile(name, target)
local p = players[name] or players[up] or players[up .. "#0000"] or players[target]
if p then
ui.addTextArea(900, closeButton ..
"<p align='center'><font size='15'><b><BV>" .. p:getName() .."</BV></b></font><br>« " .. p:getTitle() .. " »</p><br><b>Level:</b> " .. tostring(p:getLevel()) .. "<BL><font size='12'> [" .. tostring(p:getXP()) .. "XP / " .. tostring(calculateXP(p:getLevel() + 1)) .. "XP]</font></BL><br><b>Money:</b> $" .. formatNumber(p:getMoney()) .. "<br><br><b>Working as a</b> " .. p:getJob()
, target, 300, 100, 200, 130, nil, nil, 1, true)
"<p align='center'><font size='15'><b><BV>" .. p:getName() .."</BV></b></font><br>« " .. p:getTitle() .. " »</p><br><b>Level:</b> " .. tostring(p:getLevel()) .. "<BL><font size='12'> [" .. tostring(p:getXP()) .. "XP / " .. tostring(calculateXP(p:getLevel() + 1)) .. "XP]</font></BL><br><b>Money:</b> $" .. formatNumber(p:getMoney()) .. "<br><br><b>Working as a</b> " .. p:getJob() ..
"<br><b>Learning</b>: " .. (p:getLearningCourse() == "" and "NA" or p:getLearningCourse())
, target, 300, 100, 200, 140, nil, nil, 1, true)
end
end

Expand Down Expand Up @@ -1006,6 +1007,7 @@ function setUI(name)
ui.addTextArea(4, "<a href='event:shop'><b><font color='#000000' size='15'>Shop</font></b></a>", name, 100, 230, 50, 40, nil, nil, 0, false)
--school button
ui.addTextArea(5, "<a href='event:courses'><font size='15'><b>Enter</b></font></a>", name, 600, 270, 60, 20, nil, nil, 0, false)
ui.addTextArea(3000, "<p align='center'><b>Lessons left: " .. p:getLearningProgress() .." / " .. courses[p.learning].lessons .. "</b></p>", name, 480, 180, 300, 20, nil, nil, 0, false)
--jobs button
tfm.exec.addImage("16f88c66ed1.png", ":10", 610, 25) -- Job search image by Freepik in 'Flaticon.com'
ui.addTextArea(6, "<a href='event:jobs'>\t\n\t\n\t\n</a>", name, 610, 25, 30, 30, nil, nil, 0, true)
Expand Down

0 comments on commit bbc31cc

Please sign in to comment.