Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Code for one of my moodles:
local moodle = MF.getMoodle("dtemcaffeine", player:getPlayerNum())
if moodle ~= nil then
if player:getModData().DTEMcaffeineOnBody > 0 and player:HasTrait("AddictedToCaffeine") then
moodle:setValue(0.6);
moodle:setBackground(moodle:getGoodBadNeutral(), moodle:getLevel(), getTexture("media/ui/dtemcaffeine.png"))
--print("Moodle 1 positive")
elseif player:getModData().DTEMtimeSinceLastCaffeine > 1440 and player:HasTrait("AddictedToCaffeine") then
moodle:setValue(0.4);
moodle:setBackground(moodle:getGoodBadNeutral(), moodle:getLevel(), getTexture("media/ui/dtemcaffeine.png"))
--print("Moodle 1 negative")
else
moodle:setValue(0.5);
--print("No Moodle")
end
end
I still can't see the red/green background circle in the moodle. It just displays the icon
Aside, if your mod is not hybrid B41/42, I suggest you link to B42 version of this. (not both)
Question. I had my Moodles working all good but now, my image is being displayed but the green/red circle behind the Moodle icon is not displayed anymore, do I need to add an additional line of code for that? Did something related to that changed in the latest update?
I uploaded a B42 only version with higher update frequency here . It already includes minors updates and is likely to include more in the future.
Here is a screenshot with the ProteinsMoodle
I don't think that overwriting the MF.ISMoodle.render by 3-rd patrty mods is the best solution to fix that
For example neonMoodleIndicatorVertical vertical version is 128x138 px size or other mods where background is wider
So the aspect ratio scaling is needed to respect that.
To get the propper width you can use:
finalWidth = round(texture:getWidth() * moodleSize / texture:getHeight(), 0)
And you can calculate ratio only when:
texture:getWidth() ~= texture:getHeight()
@Additive yes. you can check mods tags for that