mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Removed notify and added warning follow roads
This commit is contained in:
parent
187b9be57a
commit
43d28ebe19
@ -9,6 +9,7 @@ import { ROEDescriptions, ROEs, altitudeIncrements, emissionsCountermeasures, em
|
||||
import { ftToM, knotsToMs, mToFt, msToKnots } from "../other/utils";
|
||||
import { GeneralSettings, Radio, TACAN } from "../interfaces";
|
||||
import { ContextActionSet } from "../unit/contextactionset";
|
||||
import { Popup } from "../popups/popup";
|
||||
|
||||
export class UnitControlPanel extends Panel {
|
||||
#altitudeSlider: Slider;
|
||||
@ -97,6 +98,8 @@ export class UnitControlPanel extends Panel {
|
||||
/* Follow roads switch */
|
||||
this.#followRoadsSwitch = new Switch("follow-roads-switch", (value: boolean) => {
|
||||
getApp().getUnitsManager().setFollowRoads(value);
|
||||
if (value)
|
||||
(getApp().getPopupsManager().get("infoPopup") as Popup).setText("Warning: follow roads movements can cause lag");
|
||||
});
|
||||
|
||||
/* Operate as */
|
||||
|
||||
@ -100,7 +100,7 @@
|
||||
</div>
|
||||
|
||||
<div id="follow-roads" class="switch-control yes-no">
|
||||
<h4>Follow roads <img src="/resources/theme/images/icons/circle-question-regular.svg" title=""></h4>
|
||||
<h4>Follow roads <img src="/resources/theme/images/icons/circle-question-regular.svg" title="WARNING: follow roads movements can cause lag"></h4>
|
||||
<div id="follow-roads-switch" class="ol-switch"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -40,12 +40,14 @@ local lfs = require('lfs')
|
||||
-- Print a debug message if the debug option is true
|
||||
function Olympus.debug(message, displayFor)
|
||||
if debug == true then
|
||||
Olympus.log:info(message)
|
||||
trigger.action.outText(message, displayFor)
|
||||
end
|
||||
end
|
||||
|
||||
-- Print a notify message
|
||||
function Olympus.notify(message, displayFor)
|
||||
Olympus.log:info(message)
|
||||
trigger.action.outText(message, displayFor)
|
||||
end
|
||||
|
||||
|
||||
@ -5,7 +5,11 @@
|
||||
function Olympus.protectedCall(...)\n\n \
|
||||
local status, retval = pcall(...)\n \
|
||||
if not status then\n \
|
||||
trigger.action.outText(\"ERROR: \" ..retval, 20)\n \
|
||||
if Olympus.log ~= nil then\n \
|
||||
Olympus.log:error(retval)\n \
|
||||
else\n \
|
||||
trigger.action.outText(\"Olympus critical error: \" ..retval, 20)\n \
|
||||
end\n \
|
||||
end\n \
|
||||
end\n \
|
||||
trigger.action.outText(\"Olympus.protectedCall registered successfully\", 10)\n"
|
||||
|
||||
@ -44,6 +44,7 @@ std::string to_string(const std::wstring& wstr)
|
||||
|
||||
std::string random_string(size_t length)
|
||||
{
|
||||
srand(time(NULL));
|
||||
auto randchar = []() -> char
|
||||
{
|
||||
const char charset[] =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user