-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Peppie84/development
v1.1.0.0 Release
- Loading branch information
Showing
17 changed files
with
262 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,7 @@ luac.out | |
|
||
# repo specific | ||
.testrunner/ | ||
|
||
# Giants debugger | ||
*.gdpu | ||
*.gdp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
FS22_ExtendedGameInfoDisplay/extendedgameinfodisplaygui.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
--- | ||
-- ExtendedGameInfoDisplayGui | ||
-- | ||
-- Class to handle the new ui controls on the settings frame | ||
-- to control the temperature info on & off and saves the | ||
-- value in the modSettings-folder. | ||
-- | ||
-- Copyright (c) Peppie84, 2023 | ||
-- | ||
ExtendedGameInfoDisplayGui = { | ||
MOD_DIRECTORY = g_currentModDirectory, | ||
MOD_SETTINGS_DIRECTORY = g_currentModSettingsDirectory .. '../', | ||
MOD_SETTINGS_FILENAME = 'ExtendedGameInfoDisplay.xml', | ||
MOD_SETTINGS_XML_ROOT_NODE = 'settings', | ||
CURRENT_MOD = g_currentModName or 'unknown', | ||
L10N_SYMBOLS = { | ||
MOD_TITLE = 'mod_title', | ||
TEMPERATURE_SETTING_LABEL = 'settings_temperature_label', | ||
TEMPERATURE_SETTING_DESCRIPTION = 'settings_temperature_description', | ||
EASYARMCONTROL_TEMPERATURE_OPTION1 = 'settings_temperature_option1', | ||
EASYARMCONTROL_TEMPERATURE_OPTION2 = 'settings_temperature_option2', | ||
}, | ||
ENUM_EASYARMCONTROL_INDEX = { | ||
LABEL = 4, | ||
DESCRIPTION = 6, | ||
}, | ||
ENUM_TEMPERATURE_VIEW_STATE = { | ||
ON = 1, | ||
OFF = 2, | ||
} | ||
} | ||
|
||
ExtendedGameInfoDisplayGui.settings = {} | ||
ExtendedGameInfoDisplayGui.settings.temperatureVisibility = true | ||
|
||
---Append to InGameMenuGeneralSettingsFrame.onFrameOpen | ||
---Initialize our gui elements for the settings frame that we need. | ||
function ExtendedGameInfoDisplayGui:initGui() | ||
if not self.initGuiDone then | ||
local title = TextElement.new() | ||
local temperaturSettingTitleText = g_i18n:getText(ExtendedGameInfoDisplayGui.L10N_SYMBOLS.MOD_TITLE, ExtendedGameInfoDisplayGui.CURRENT_MOD) | ||
local temperaturSettingLabelText = g_i18n:getText(ExtendedGameInfoDisplayGui.L10N_SYMBOLS.TEMPERATURE_SETTING_LABEL, ExtendedGameInfoDisplayGui.CURRENT_MOD) | ||
local temperaturSettingDescriptionText = g_i18n:getText(ExtendedGameInfoDisplayGui.L10N_SYMBOLS.TEMPERATURE_SETTING_DESCRIPTION, ExtendedGameInfoDisplayGui.CURRENT_MOD) | ||
local temperaturSettingOption1Text = g_i18n:getText(ExtendedGameInfoDisplayGui.L10N_SYMBOLS.EASYARMCONTROL_TEMPERATURE_OPTION1, ExtendedGameInfoDisplayGui.CURRENT_MOD) | ||
local temperaturSettingOption2Text = g_i18n:getText(ExtendedGameInfoDisplayGui.L10N_SYMBOLS.EASYARMCONTROL_TEMPERATURE_OPTION2, ExtendedGameInfoDisplayGui.CURRENT_MOD) | ||
|
||
self.ExtendedGameInfoDisplay = self.checkUseEasyArmControl:clone() | ||
self.ExtendedGameInfoDisplay.target = ExtendedGameInfoDisplayGui | ||
self.ExtendedGameInfoDisplay.id = 'ExtendedGameInfoDisplay' | ||
self.ExtendedGameInfoDisplay:setCallback('onClickCallback', 'onExtendedGameInfoDisplayChanged') | ||
self.ExtendedGameInfoDisplay:setTexts({temperaturSettingOption1Text, temperaturSettingOption2Text}) | ||
self.ExtendedGameInfoDisplay.elements[ExtendedGameInfoDisplayGui.ENUM_EASYARMCONTROL_INDEX.LABEL]:setText(temperaturSettingLabelText) | ||
self.ExtendedGameInfoDisplay.elements[ExtendedGameInfoDisplayGui.ENUM_EASYARMCONTROL_INDEX.DESCRIPTION]:setText(temperaturSettingDescriptionText) | ||
|
||
title:applyProfile('settingsMenuSubtitle', true) | ||
title:setText(temperaturSettingTitleText) | ||
|
||
self.boxLayout:addElement(title) | ||
self.boxLayout:addElement(self.ExtendedGameInfoDisplay) | ||
|
||
local state = ExtendedGameInfoDisplayGui.ENUM_TEMPERATURE_VIEW_STATE.ON | ||
if ExtendedGameInfoDisplayGui.settings.temperatureVisibility == false then | ||
state = ExtendedGameInfoDisplayGui.ENUM_TEMPERATURE_VIEW_STATE.OFF | ||
end | ||
|
||
self.ExtendedGameInfoDisplay:setState(state) | ||
self.initGuiDone = true | ||
end | ||
end | ||
|
||
---Callback function for our gui element by on change | ||
---@param state number | ||
function ExtendedGameInfoDisplayGui:onExtendedGameInfoDisplayChanged(state) | ||
ExtendedGameInfoDisplayGui.settings.temperatureVisibility = true | ||
if state == ExtendedGameInfoDisplayGui.ENUM_TEMPERATURE_VIEW_STATE.OFF then | ||
ExtendedGameInfoDisplayGui.settings.temperatureVisibility = false | ||
end | ||
|
||
ExtendedGameInfoDisplayGui:saveSettings() | ||
g_currentMission.hud.gameInfoDisplay:setTemperatureVisible(nil) | ||
end | ||
|
||
---Appand to and InGameMenuGeneralSettingsFrame.updateGameSettings() | ||
---Just udpate the gui | ||
function ExtendedGameInfoDisplayGui:updateGui() | ||
if self.initGuiDone and self.ExtendedGameInfoDisplay ~= nil then | ||
self.ExtendedGameInfoDisplay:setState(ExtendedGameInfoDisplayGui.ENUM_TEMPERATURE_VIEW_STATE.ON) | ||
end | ||
end | ||
|
||
---Save the settings into its own xml under modSettings/ path | ||
function ExtendedGameInfoDisplayGui:saveSettings() | ||
local filename = ExtendedGameInfoDisplayGui.MOD_SETTINGS_DIRECTORY .. ExtendedGameInfoDisplayGui.MOD_SETTINGS_FILENAME | ||
local xmlRootNode = ExtendedGameInfoDisplayGui.MOD_SETTINGS_XML_ROOT_NODE | ||
local xmlFile = XMLFile.create("settingsXML", filename, xmlRootNode) | ||
|
||
if xmlFile ~= nil then | ||
xmlFile:setBool(xmlRootNode .. ".temperatureVisibility", self.settings.temperatureVisibility) | ||
|
||
xmlFile:save() | ||
xmlFile:delete() | ||
end | ||
end | ||
|
||
---Load the settings xml from modSettings/ | ||
function ExtendedGameInfoDisplayGui:loadSettings() | ||
local filename = ExtendedGameInfoDisplayGui.MOD_SETTINGS_DIRECTORY .. ExtendedGameInfoDisplayGui.MOD_SETTINGS_FILENAME | ||
local xmlRootNode = ExtendedGameInfoDisplayGui.MOD_SETTINGS_XML_ROOT_NODE | ||
local xmlFile = XMLFile.loadIfExists("settingsXML", filename, xmlRootNode) | ||
|
||
if xmlFile ~= nil then | ||
ExtendedGameInfoDisplayGui.settings.temperatureVisibility = Utils.getNoNil(xmlFile:getBool(xmlRootNode .. ".temperatureVisibility"), true) | ||
|
||
xmlFile:delete() | ||
end | ||
end | ||
|
||
---Event from addModEventListener after loading the map | ||
function ExtendedGameInfoDisplayGui:loadMap() | ||
ExtendedGameInfoDisplayGui:loadSettings() | ||
g_currentMission.hud.gameInfoDisplay:setTemperatureVisible(nil) | ||
end | ||
|
||
---Init | ||
local function init() | ||
InGameMenuGeneralSettingsFrame.onFrameOpen = Utils.appendedFunction(InGameMenuGeneralSettingsFrame.onFrameOpen, ExtendedGameInfoDisplayGui.initGui) | ||
InGameMenuGeneralSettingsFrame.updateGameSettings = Utils.appendedFunction(InGameMenuGeneralSettingsFrame.updateGameSettings, ExtendedGameInfoDisplayGui.updateGui) | ||
end | ||
|
||
init() | ||
addModEventListener(ExtendedGameInfoDisplayGui) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no"?> | ||
<modDesc descVersion="73"> | ||
<modDesc descVersion="74"> | ||
<author>Peppie84</author> | ||
<version>1.0.0.0</version> | ||
<version>1.1.0.0</version> | ||
<title> | ||
<en>Extended Game Infodisplay</en> | ||
<de>Erweiterte Spiel-Infodarstellung</de> | ||
</title> | ||
<description> | ||
<en> | ||
<![CDATA[ | ||
<en><![CDATA[ | ||
Expands the current GameInfoDisplay in the upper right corner by displaying the current year under the date and activates a hidden temperature feature with an indicator of whether the temperature is falling, staying constant or rising, the display of the current temperature. I also added the min/max temperature of the day. | ||
For more information, help, and reporting issues please visit <a href='https://github.com/Peppie23/FS22_ExtendedGameInfoDisplay'>GitHub</a>. | ||
]]> | ||
</en> | ||
<de> | ||
<![CDATA[ | ||
Changelog v1.1.0.0 | ||
- Decreased min/max temperature font size | ||
- Added settings area to en-/disable temperature info | ||
- Added CZ translations | ||
For more information, help, and reporting issues please visit <a href='https://github.com/Peppie84/FS22_ExtendedGameInfoDisplay'>GitHub</a>. | ||
]]> </en> | ||
<de><![CDATA[ | ||
Erweitert die aktuelle GameInfoDisplay oben rechts um die Anzeige des aktuellen Jahres unter dem Datum und aktiviert ein verstecktes Temperaturfeature mit einem Indikator ob die Temepratur fällt, gleich bleibt oder steigt, die Anzeige der aktuellen Temperatur und der min/max Temperatur des Tages. | ||
Weitere Informationen, Hilfe und Probleme melden finden Sie unter <a href='https://github.com/Peppie23/FS22_ExtendedGameInfoDisplay'>GitHub</a>. | ||
]]> | ||
</de> | ||
Changelog v1.1.0.0 | ||
- Schriftgröße der min/max Temperatur verkleinert | ||
- Bei Settings kann die Temperaturanzeige ein-/ausgeblendet werden | ||
- CZ translations hinzugefügt | ||
Weitere Informationen, Hilfe und Probleme melden finden Sie unter <a href='https://github.com/Peppie84/FS22_ExtendedGameInfoDisplay'>GitHub</a>. | ||
]]> </de> | ||
</description> | ||
<iconFilename>mod_icon.dds</iconFilename> | ||
<iconFilename>icon_ExGameInfoDisp.dds</iconFilename> | ||
<multiplayer supported="true" /> | ||
<extraSourceFiles> | ||
<sourceFile filename="yearinfo.lua" /> | ||
<sourceFile filename="tempinfo.lua" /> | ||
<sourceFile filename="extendedgameinfodisplaygui.lua" /> | ||
</extraSourceFiles> | ||
<l10n> | ||
<text name="current_year"> | ||
<en>Year</en> | ||
<de>Jahr</de> | ||
</text> | ||
</l10n> | ||
<l10n filenamePrefix="translations/l10n" /> | ||
</modDesc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no" ?> | ||
<l10n> | ||
<translationContributors>SniperKittenCz</translationContributors> | ||
<elements> | ||
<e k="mod_title" v="Rozšířený herní info displej"/> | ||
<e k="yearinfo_current_year" v="Rok"/> | ||
<e k="settings_temperature_label" v="Teplota"/> | ||
<e k="settings_temperature_description" v="Přepíná pohled na aktuální, min & maximální teplotu v pravém horním rohu HUD."/> | ||
<e k="settings_temperature_option1" v="Zap"/> | ||
<e k="settings_temperature_option2" v="Vyp"/> | ||
</elements> | ||
</l10n> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no" ?> | ||
<l10n> | ||
<translationContributors>Peppie84</translationContributors> | ||
<elements> | ||
<e k="mod_title" v="Erweiterte Spiel-Infodarstellung"/> | ||
<e k="yearinfo_current_year" v="Jahr"/> | ||
<e k="settings_temperature_label" v="Temperaturanzeige"/> | ||
<e k="settings_temperature_description" v="Steuert die Anzeige der aktuellen, min & max Temperatur oben rechts im Hud."/> | ||
<e k="settings_temperature_option1" v="An"/> | ||
<e k="settings_temperature_option2" v="Aus"/> | ||
</elements> | ||
</l10n> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="no" ?> | ||
<l10n> | ||
<translationContributors>Peppie84</translationContributors> | ||
<elements> | ||
<e k="mod_title" v="Extended Game Infodisplay"/> | ||
<e k="yearinfo_current_year" v="Year"/> | ||
<e k="settings_temperature_label" v="Temperature"/> | ||
<e k="settings_temperature_description" v="Toggles view of the current, min & max temperature on the upper right corner hud."/> | ||
<e k="settings_temperature_option1" v="On"/> | ||
<e k="settings_temperature_option2" v="Off"/> | ||
</elements> | ||
</l10n> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.