{"slug":"databindings/hudcontexts/moonshine/moonshine","category":"databindings","title":"Moonshine","kind":"code","intro":"","body":"local rootContainer = DatabindingAddDataContainerFromPath(\"\", \"Moonshine_ProgressBars\")\n\nfunction ShowMoonshineProgressBars()\n    EnableHudContext(`HUD_CTX_MP_MOONSHINE_BUSINESS`)\nend\n\nfunction ShowMoonshineCash(toggle)\n    DatabindingAddDataBool(rootContainer, \"MoonshineShowCash\", toggle)\nend\n\nfunction SetMoonshineMash(value, max, color)\n    DatabindingAddDataInt(rootContainer, \"MoonshineMashValue\", value)\n    DatabindingAddDataInt(rootContainer, \"MoonshineMashMaximum\", max)\n    DatabindingAddDataInt(rootContainer, \"MoonshineMashColorID\", color)\nend\n\nfunction SetMoonshineFlavorType(flavor)\n    DatabindingAddDataBool(rootContainer, \"MoonshineFlavorTimeMeterShowLabel\", true)\n    DatabindingAddDataInt(rootContainer, \"MoonshineFlavor\", flavor)\nend\n\nfunction SetMoonshineFlavorTime(value, max, fillColor, trackColor)\n    DatabindingAddDataBool(rootContainer, \"MoonshineFlavorTimeMeterShowLabel\", false)\n    DatabindingAddDataInt(rootContainer, \"FlavoringTimeMeterValue\", value)\n    DatabindingAddDataInt(rootContainer, \"FlavoringTimeMeterMaximum\", max)\n    DatabindingAddDataInt(rootContainer, \"FlavoringTimeMeterFillColorID\", fillColor)\n    DatabindingAddDataInt(rootContainer, \"FlavoringTimeMeterTrackColorID\", trackColor)\nend\n\nfunction SetMoonshineBottles(value, max, color, threshold)\n    DatabindingAddDataInt(rootContainer, \"MoonshineBottlesValue\", value)\n    DatabindingAddDataInt(rootContainer, \"MoonshineBottlesMaximum\", max)\n    DatabindingAddDataInt(rootContainer, \"MoonshineBottlesColorID\", color)\n    DatabindingAddDataInt(rootContainer, \"MoonshineBottlesThresholdValue\", threshold)\nend\n\nfunction HideMoonshineProgressBars()\n    DisableHudContext(`HUD_CTX_MP_MOONSHINE_BUSINESS`)\nend\n\n--[[\n--------------------------------------------------------------------------------------------------------------------------------------------\n--                                                                                                                                        --\n--                                                                EXAMPLE USAGE                                                           --\n--                                                                                                                                        --\n--------------------------------------------------------------------------------------------------------------------------------------------\n]]\n\nShowMoonshineCash(true)\nSetMoonshineMash(0, 100, 1)\nSetMoonshineFlavorType(2)\nSetMoonshineBottles(0, 100, 1, 50)\n\nShowMoonshineProgressBars()\n\nWait(2000)\n\nShowMoonshineCash(false)\nSetMoonshineMash(50, 100, 1)\nSetMoonshineBottles(50, 100, 1, 50)\n\nWait(2000)\n\nSetMoonshineMash(100, 100, 1)\nSetMoonshineFlavorTime(100, 100, 1, 1)\nSetMoonshineBottles(100, 100, 1, 50)\n\nWait(2000)\n\nSetMoonshineMash(100, 100, 0)\nSetMoonshineFlavorTime(100, 100, 0, 0)\nSetMoonshineBottles(100, 100, 0, 50)\n\nWait(2000)\n\nHideMoonshineProgressBars()","tables":[],"sourceUrl":"https://github.com/femga/rdr3_discoveries/blob/477aaaccadb7f0c042286611d9939009636cff12/databindings/hudcontexts/moonshine/moonshine.lua","rows":[]}