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

Commit

Permalink
small PR adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Apr 23, 2021
1 parent 06bfb95 commit 47856cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions ActionEventsLoader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ActionEventsLoader.actionEventAttributes = {
{name = 'callbackState', getXmlFunction = getXMLInt},
{name = 'isDisabledCallbackFunc', getXmlFunction = getXMLString},
{name = 'text', getXmlFunction = getXMLString},
{name = 'textVisibilityNeeded', getXmlFunction = getXMLBool},
{name = 'textAlwaysVisible', getXmlFunction = getXMLBool},
}

---All the setting action events attributes
Expand All @@ -22,7 +22,7 @@ ActionEventsLoader.settingActionEventAttributes = {
{name = 'callbackState', getXmlFunction = getXMLInt},
{name = 'isDisabledCallbackFunc', getXmlFunction = getXMLString},
{name = 'text', getXmlFunction = getXMLString},
{name = 'textVisibilityNeeded', getXmlFunction = getXMLBool},
{name = 'textAlwaysVisible', getXmlFunction = getXMLBool},
}

---String to class reference, only for global classes.
Expand Down Expand Up @@ -331,7 +331,7 @@ end
---Needs the action event text to be visible?
---@param table actionEventData from the config xml
function ActionEventsLoaderUtil.isActionEventTextVisible(actionEventData)
return courseplay.globalSettings.showActionEventsTexts:get() or actionEventData.textVisibilityNeeded
return courseplay.globalSettings.showActionEventsTexts:get() or actionEventData.textAlwaysVisible
end

---Is the action event disabled ?
Expand Down
4 changes: 2 additions & 2 deletions base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,12 @@ function courseplay:onUpdate(dt)
self.cp.infoText = nil
end

if self.cp.firstRun == nil then
if self.cp.postInitDone == nil then
if self.cp.driver then
---Post init function, as not all giants variables are
---set correctly at the first courseplay:setAIDriver() call.
self.cp.driver:postInit()
self.cp.firstRun = true
self.cp.postInitDone = true
end
end

Expand Down
26 changes: 13 additions & 13 deletions config/ActionEventsConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
isDisabledCallbackFunc: is used to disable a action event after a action event refresh or on load.
callbackState: isDisabledCallbackFunc parameter, this is an int!
text: is the action event text, by default it returns courseplay:loc(name), where 'name' is the previous defined action event name.
textVisibilityNeeded: Is disabling action event text forbidden ? (default: false)
textAlwaysVisible: Should the action event texts always be visible, regardless of settings, etc..
-->
<!--HUD Actions-->
<ActionEvent name="COURSEPLAY_ACTION_OPEN_CLOSE_HUD" callbackFunc="actionEventOpenCloseHud" isDisabledCallbackFunc="isActionEventOpenCloseHudDisabled"/>
Expand All @@ -33,17 +33,17 @@
<ActionEvent name="COURSEPLAY_ACTION_DRIVE_NOW" callbackFunc="actionEventDriveNow" isDisabledCallbackFunc="isActionEventDriveNowDisabled"/>

<!--Editor Actions-->
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_TOGGLE" class="courseEditor" callbackFunc="setEnabledActionEvent" isDisabledCallbackFunc="getIsNotAllowedToUse" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_UNDO" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="undo" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_SAVE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="save" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_SPEED_INCREASE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="increaseSpeed" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_SPEED_DECREASE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="decreaseSpeed" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_WAYPOINT" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="delete" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_NEXT_WAYPOINT" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="deleteNext" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_TO_START" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="deleteToStart" isDisabledCallbackFunc="getIsDisabled"textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_TO_END" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="deleteToEnd" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_INSERT_WAYPOINT" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="insert" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_CYCLE_WAYPOINT_TYPE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="cycleType" isDisabledCallbackFunc="getIsDisabled" textVisibilityNeeded="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_TOGGLE" class="courseEditor" callbackFunc="setEnabledActionEvent" isDisabledCallbackFunc="getIsNotAllowedToUse" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_UNDO" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="undo" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_SAVE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="save" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_SPEED_INCREASE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="increaseSpeed" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_SPEED_DECREASE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="decreaseSpeed" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_WAYPOINT" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="delete" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_NEXT_WAYPOINT" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="deleteNext" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_TO_START" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="deleteToStart" isDisabledCallbackFunc="getIsDisabled"textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_DELETE_TO_END" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="deleteToEnd" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_INSERT_WAYPOINT" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="insert" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>
<ActionEvent name="COURSEPLAY_ACTION_EDITOR_CYCLE_WAYPOINT_TYPE" class="courseEditor" callbackParameter ="courseEditor" callbackFunc="cycleType" isDisabledCallbackFunc="getIsDisabled" textAlwaysVisible="true"/>

</ActionEvents>

Expand All @@ -56,7 +56,7 @@
isDisabledCallbackFunc: is used to disable a action event after a action event refresh or on load optional, default is setting:isDisabled().
callbackState: isDisabledCallbackFunc parameter, this is an int!
text: is the action event text, by default it returns courseplay:loc(name), where 'name' is the previous defined action event name.
textVisibilityNeeded: Is disabling action event text forbidden ? (default: false)
textAlwaysVisible: Should the action event texts always be visible, regardless of settings, etc..
-->
<!--Starting point driver-->
<SettingActionEvent name="COURSEPLAY_ACTION_CHANGE_STARTING_POINT" setting="startingPoint" callbackFunc="actionEvent"/>
Expand Down

0 comments on commit 47856cd

Please sign in to comment.