Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Courseplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Courseplay:init()

g_overlayManager:addTextureConfigFile(Utils.getFilename("img/iconSprite.xml", self.BASE_DIRECTORY), "cpIconSprite")
g_overlayManager:addTextureConfigFile(Utils.getFilename("img/ui_courseplay.xml", self.BASE_DIRECTORY), "cpUi")
g_gui:loadProfiles(Utils.getFilename("config/gui/GUIProfiles.xml", self.BASE_DIRECTORY))
end

function Courseplay:registerXmlSchema()
Expand Down
124 changes: 2 additions & 122 deletions config/gui/GUIProfiles.xml
Original file line number Diff line number Diff line change
@@ -1,126 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<GUIProfiles>
<Presets>
<Preset name="colorTransparent" value="0 0 0 0" />

<Preset name="colorGlass" value="0.018 0.016 0.015 0.6" />
<Preset name="colorGlass_50" value="0.018 0.016 0.015 0.25" />

<Preset name="colorGlassVeryLight" value="0.718 0.716 0.715 0.04" />
<Preset name="colorGlassExtremelyLight" value="0.918 0.916 0.915 0.15" />
<Preset name="colorGlassMedium" value="0.118 0.116 0.115 0.20" />
<Preset name="colorGlassDark" value="0.018 0.016 0.015 0.65" />
<Preset name="colorGlassLight" value="0.718 0.716 0.715 0.25" />
<Preset name="colorGlassLight_50" value="0.718 0.716 0.715 0.0625" />
<Preset name="colorGlassLight_75" value="0.718 0.716 0.715 0.09375" />

<Preset name="colorMainUI" value="0.0227 0.5346 0.8519 1.0"/>
<Preset name="colorMainUI_80" value="0.0227 0.5346 0.8519 0.8"/>
<Preset name="colorMainUI_70" value="0.0227 0.5346 0.8519 0.7"/>
<Preset name="colorMainUI_60" value="0.0227 0.5346 0.8519 0.6"/>
<Preset name="colorMainUI_50" value="0.0227 0.5346 0.8519 0.5"/>
<Preset name="colorMainUI_40" value="0.0227 0.5346 0.8519 0.4"/>
<Preset name="colorMainUI_30" value="0.0227 0.5346 0.8519 0.3"/>
<Preset name="colorMainUI_20" value="0.0227 0.5346 0.8519 0.2"/>
<Preset name="colorMainUI_10" value="0.0227 0.5346 0.8519 0.1"/>
<Preset name="colorMainUI_6" value="0.0227 0.5346 0.8519 0.06"/>
<Preset name="colorMainUIAlt" value="0.9900 0.4640 0.0010 1" />
<Preset name="colorDisabled" value="0.4 0.4 0.4 1" />

<Preset name="colorWhite" value="1 1 1 1" />
<Preset name="colorWhite_50" value="1 1 1 0.5" />
<Preset name="colorWhite_25" value="1 1 1 0.25" />
<Preset name="colorRed" value="0.8069 0.0097 0.0097 1" />
<Preset name="colorDarkRed" value="0.2832 0.0091 0.0091 1" />
<Preset name="colorBlue" value="0.0742 0.4341 0.6939 1" />
<Preset name="colorGreen" value="0.0781 0.2233 0.0478 1" />
<Preset name="colorGreen2" value="0.2122 0.5271 0.0307 1" />

<Preset name="colorBlack" value="0 0 0 1" />
<Preset name="colorBlack2" value="0.0075 0.0075 0.0075 1" />
<Preset name="colorBlack3" value="0.013 0.013 0.013 1" />
<Preset name="colorBlack3_97" value="0.013 0.013 0.013 0.97" />
<Preset name="colorBlack3_70" value="0.013 0.013 0.013 0.7" />
<Preset name="colorBlack3_0" value="0.013 0.013 0.013 0" />

<Preset name="colorDarkGrey" value="0.0284 0.0284 0.0284 1" />
<Preset name="colorDarkGrey_0" value="0.0284 0.0284 0.0284 0" />
<Preset name="colorDarkGrey2" value="0.0630 0.0630 0.0630 1" />
<Preset name="colorDarkGrey2_50" value="0.0630 0.0630 0.0630 0.5" />
<Preset name="colorDarkGrey2_70" value="0.0630 0.0630 0.0630 0.7" />
<Preset name="colorDarkGrey3" value="0.0194 0.0194 0.0194 1" />
<Preset name="colorDarkGrey4" value="0.0723 0.0723 0.0723 1" />
<Preset name="colorDarkGrey5" value="0.1356 0.1356 0.1356 1" />
<Preset name="colorDarkGrey6" value="0.03 0.03 0.03 1" />
<Preset name="colorDarkGrey7" value="0.0212 0.0212 0.0212 1" />

<Preset name="colorListRowBackground" value="$preset_colorGlassLight_50" />

<Preset name="colorLightGrey" value="0.0482 0.0482 0.0482 1" />
<Preset name="colorDescriptionText" value="0.2918 0.2918 0.2918 1" />
<Preset name="colorDescriptionText2" value="0.6 0.6 0.6 1" />
<Preset name="colorDescriptionText3" value="0.1845 0.1845 0.1845 1" />
<Preset name="colorDescriptionText4" value="0.6307 0.6307 0.6307 1" />
<!-- UVs -->
<Preset name="colorUVs" value="10px 1010px 4px 4px" />
</Presets>

<Traits>
<Trait name="debugging">
<Value name="debugEnabled" value="true" />
</Trait>
<Trait name="anchorTopLeft">
<Value name="anchors" value="0 0 1 1" />
</Trait>
<Trait name="anchorTopCenter">
<Value name="anchors" value="0.5 0.5 1 1" />
</Trait>
<Trait name="anchorMiddleCenter">
<Value name="anchors" value="0.5 0.5 0.5 0.5" />
<!--

<Value name="screenAlign" value="middleCenter" />
<Value name="positionOrigin" value="middleCenter" />
-->
</Trait>
</Traits>

<Profile name="cpCourseGeneratorBackground" extends="emptyFullPanel" with="anchorTopLeft">
<Value name="size" value="1220px 840px"/>
<Value name="imageColor" value="0.0111 0.0276 0.0377 0.95"/>
<Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<position value="-500px 0px" />
</Profile>

<Profile name="cpIngameMenuSettingsBox" extends="ingameMenuSettingsBox">
<Value name="size" value="1200px 756px"/>
</Profile>

<Profile name="cpIngameMenuSettingsLayout" extends="ingameMenuSettingsLayout">
<Value name="size" value="1200px 756px"/>
</Profile>

<Profile name="cpMultiTextOptionSettingsTooltip" extends="multiTextOptionSettingsTooltip">
<Value name="textMaxWidth" value="332px" />
</Profile>

<Profile name="cpControllerGuiLayout" extends="ingameMenuAICreateLayout">
<Value name="position" value="-40px 0px" />
</Profile>

<Profile name="cpDrawingCustomFieldHeader" extends="ingameMenuFrameHeaderText" with="anchorTopCenter">
<Value name="position" value="0px -40px" />
</Profile>
<Profile name="cpDrawingCustomFieldSubHeader" extends="ingameMenuFrameHeaderText" with="anchorTopCenter">
<Value name="position" value="0px -70px" />
</Profile>

<Profile name="cpMultiTextOptionText" extends="multiTextOptionText">
<Value name="imageColor" value="0 0 0 0"/>
</Profile>

<Profile name="cpMultiTextOptionSettingsText" extends="multiTextOptionSettingsText">
<Value name="size" value="210px 48px"/>
<Value name="imageColor" value="0 0 0 0"/>
</Profile>


</GUIProfiles>
4 changes: 0 additions & 4 deletions config/gui/pages/ConstructionFrame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,8 @@
</ThreePartBitmap>
</ThreePartBitmap> -->
<GUIProfiles>
<Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<position value="-500px 0px" />
</Profile>
<Profile name="cpHelpDisplay" with="anchorStretchingYLeft">
<position value="700px -230px" />
</Profile>

</GUIProfiles>
</GUI>
4 changes: 2 additions & 2 deletions config/gui/pages/CourseGeneratorFrame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@
</ThreePartBitmap>
</ThreePartBitmap>
<GUIProfiles>
<Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<!-- <Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<position value="-500px 0px" />
</Profile>
</Profile> -->
<Profile name="cpLeftSideBackground" extends="fs25_fullScreenBackground" with="pivotMiddleLeft">
<height value="100%"/>
<width value="250px" />
Expand Down
4 changes: 2 additions & 2 deletions config/gui/pages/GlobalSettingsFrame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
</ThreePartBitmap>
</ThreePartBitmap>
<GUIProfiles>
<Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<!-- <Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<position value="-500px 0px" />
</Profile>
</Profile> -->
</GUIProfiles>
</GUI>
4 changes: 2 additions & 2 deletions config/gui/pages/VehicleSettingsFrame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
</ThreePartBitmap>
</ThreePartBitmap>
<GUIProfiles>
<Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<!-- <Profile name="cpSettingsMultiOptionTitle" extends="fs25_settingsMultiTextOptionTitle">
<position value="-500px 0px" />
</Profile>
</Profile> -->
</GUIProfiles>
</GUI>
4 changes: 2 additions & 2 deletions scripts/gui/CpInGameMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function CpInGameMenu.new(target, customMt, messageCenter, l10n, inputManager, c
g_gui:showGui("CpInGameMenu")
self:changeScreen(CpInGameMenu)
self:updatePages()
-- local index = self.pagingElement:getPageMappingIndexByElement(self.page)
-- self.pageSelector:setState(pageAIIndex, true)
local index = self.pagingElement:getPageMappingIndexByElement(self.pageCourseGenerator)
self.pageSelector:setState(index, true)
end, self)
self.messageCenter:subscribe(MessageType.GUI_CP_INGAME_OPEN_GLOBAL_SETTINGS, function (menu)
g_gui:showGui("CpInGameMenu")
Expand Down
59 changes: 55 additions & 4 deletions scripts/gui/pages/CpCourseGeneratorFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,32 @@ function CpCourseGeneratorFrame:update(dt)
if hasChanged then
self:updateStatusMessages()
end
local inputMode = g_inputBinding:getInputHelpMode()
if inputMode ~= self.lastInputHelpMode then
self.lastInputHelpMode = inputMode
-- p102.buttonSelectIngame:setVisible(v104 == GS_INPUT_HELP_MODE_GAMEPAD)
-- p102:updateContextInputBarVisibility()
g_inputBinding:setShowMouseCursor(inputMode ~= GS_INPUT_HELP_MODE_GAMEPAD)
-- self:updateInputGlyphs()
end
if inputMode == GS_INPUT_HELP_MODE_GAMEPAD then
local x, y = self.ingameMap:getLocalPointerTarget()
if self.isPickingLocation then
local dx, dz = self.ingameMap:localToWorldPos(x, y)
self.aiTargetMapHotspot:setWorldPosition(dx, dz)
elseif self.isPickingRotation then
local dx, dz = self.ingameMap:localToWorldPos(x, y)
local nx = dx - self.pickingRotationOrigin[1]
local nz = dz - self.pickingRotationOrigin[2]
local rotY = math.atan2(nx, nz) + math.pi
if self.pickingRotationSnapAngle > 0 then
rotY = MathUtil.round(rotY / self.pickingRotationSnapAngle, 0) *
self.pickingRotationSnapAngle
end
self.aiTargetMapHotspot:setWorldRotation(rotY)
end
end

CpCourseGeneratorFrame:superClass().update(self, dt)
end

Expand Down Expand Up @@ -341,6 +367,7 @@ function CpCourseGeneratorFrame:onFrameOpen()
end
end
end
self.activeWorkerList:reloadData()
end, self)
g_messageCenter:subscribe(MessageType.AI_JOB_REMOVED, function(self, jobId)
table.removeElement(self.playerFarmActiveJobs, jobId)
Expand Down Expand Up @@ -432,6 +459,7 @@ function CpCourseGeneratorFrame:onFrameOpen()
self:setMapSelectionItem(nil)
end
g_customFieldManager:refresh()
-- self:updateInputGlyphs()
end

function CpCourseGeneratorFrame:saveHotspotFilter()
Expand Down Expand Up @@ -1071,6 +1099,7 @@ function CpCourseGeneratorFrame:onStartedJob(args, state, jobTypeIndex)
g_messageCenter:unsubscribe(AIJobStartRequestEvent, self)
if state == AIJob.START_SUCCESS then
self.mapOverviewSelector:setState(self.MAP_SELECTOR_ACTIVE_JOBS, true)
FocusManager:setFocus(self.activeWorkerList)
else
local jobType = g_currentMission.aiJobTypeManager:getJobTypeByIndex(jobTypeIndex)
local text = jobType.classObject.getIsStartErrorText(state)
Expand Down Expand Up @@ -1357,7 +1386,6 @@ function CpCourseGeneratorFrame:updateInputGlyphs()
}, nil, nil, self)
self.mapMoveGlyphText:setText(moveText)
self.mapZoomGlyphText:setText(self.zoomText)

end

-- Lines 992-1005
Expand Down Expand Up @@ -1494,20 +1522,30 @@ function CpCourseGeneratorFrame:initializeContextActions()
actionOnly = true
}
}
FocusManager:linkElements(self.contextButtonList, FocusManager.TOP, nil)
FocusManager:linkElements(self.contextButtonList, FocusManager.BOTTOM, nil)
FocusManager:linkElements(self.contextButtonList, FocusManager.LEFT, nil)
FocusManager:linkElements(self.contextButtonList, FocusManager.RIGHT, nil)
FocusManager:linkElements(self.filterList, FocusManager.LEFT, nil)
FocusManager:linkElements(self.filterList, FocusManager.RIGHT, nil)
FocusManager:linkElements(self.filterList, FocusManager.BOTTOM, nil)
FocusManager:linkElements(self.customFieldList, FocusManager.LEFT, nil)
FocusManager:linkElements(self.customFieldList, FocusManager.RIGHT, nil)
FocusManager:linkElements(self.customFieldList, FocusManager.BOTTOM, nil)
end

function CpCourseGeneratorFrame:updateContextActions()
local vehicle = self.cpMenu:getCurrentVehicle()
self.contextActions[self.CONTEXT_ACTIONS.ENTER_VEHICLE].isActive = vehicle and vehicle:getIsEnterableFromMenu() and self.mode ~= self.AI_MODE_CREATE
self.canCancel = vehicle and vehicle.spec_aiJobVehicle and vehicle:getIsAIActive()
self.canCreateJob = false
if vehicle and not self.currentJobVehicle then
if vehicle and not self.currentJobVehicle and not self.canCancel then
for _, job in pairs(self.jobTypeInstances) do
if job:getIsAvailableForVehicle(vehicle, true) then
self.canCreateJob = true
end
end
end
self.canCancel = vehicle and vehicle.spec_aiJobVehicle and vehicle:getIsAIActive()
self.contextActions[self.CONTEXT_ACTIONS.CREATE_JOB].isActive = self.canCreateJob and self.mode ~= self.AI_MODE_CREATE
self.contextActions[self.CONTEXT_ACTIONS.START_JOB].isActive = self:getCanStartJob()
self.contextActions[self.CONTEXT_ACTIONS.STOP_JOB].isActive = self:getCanCancelJob() and self.mode ~= self.AI_MODE_CREATE
Expand Down Expand Up @@ -1631,8 +1669,21 @@ function CpCourseGeneratorFrame:setMapSelectionItem(hotspot)
InGameMenuMapUtil.hideContextBox(self.contextBoxCustomField)
InGameMenuMapUtil.showContextBox(self.currentContextBox, hotspot, name, imageFilename, uvs, farmId, playerName, false, true, false)
self:updateContextActions()
FocusManager:setFocus(self.contextButtonList)
else
local state = self.mapOverviewSelector:getState()
local hasFocus = not self.currentContextBox:getIsVisible()
if state == self.AI_MODE_WORKER_LIST then
hasFocus = FocusManager:setFocus(self.activeWorkerList) or FocusManager:getFocusedElement() == self.activeWorkerList
elseif state == self.CUSTOM_FIELD_HOTSPOTS then
hasFocus = FocusManager:setFocus(self.customFieldList) or FocusManager:getFocusedElement() == self.customFieldList
else
hasFocus = FocusManager:setFocus(self.jobMenuLayout) or FocusManager:getFocusedElement() == self.jobMenuLayout
end
InGameMenuMapUtil.hideContextBox(self.currentContextBox)
if not hasFocus then
FocusManager:setFocus(self.mapOverviewSelector)
end
end
end

Expand Down Expand Up @@ -1694,7 +1745,7 @@ function CpCourseGeneratorFrame:setJobMenuVisible(isVisible)
self.currentJob = nil
self.currentJobVehicle = nil
self:updateCourseGenerator(false)
FocusManager:setFocus(self.mapOverviewSelector)
-- FocusManager:setFocus(self.mapOverviewSelector)
self.mapOverviewSelector:setState(self.MAP_SELECTOR_ACTIVE_JOBS, true)
else
self.mapOverviewSelector:setState(self.MAP_SELECTOR_CREATE_JOB, true)
Expand Down
Loading