Skip to content

Commit 94e5598

Browse files
michaelwestbrookGuimDev
authored andcommitted
Reset settings (#23)
* Added important file to config. * Moved reset code to local function. No longer pass reference to defaults * Few housecleaning items.
1 parent 40ac099 commit 94e5598

File tree

5 files changed

+34
-18
lines changed

5 files changed

+34
-18
lines changed

deploy/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
See '[config.js](./config.js)' for available configurations. <br />
77
`modName`: Name of the mod. (duh) <br />
88
`defaultBuildDir`: Destination for 'built' addon files. <br />
9-
`sourceFiles`: Provides the list of files to be deployed. New files that should be included with the addon should be added to the list. <br />
9+
`sourceFiles`: Provides the list of files to be deployed. New files that should be included with the addon need to be added to the list. <br />
1010
`esoAddonDir`: Specifies where to deploy game files. It looks to see if the `ESO_ADDON_DIR` environment variable is set.
1111

1212
# Available commands

deploy/config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const addonConfig = {
1212
'Bindings.xml',
1313
'header.lua',
1414
'TeamFormation.lua',
15-
'TeamFormation.xml'
15+
'TeamFormation.xml',
16+
'ProvisionsTeamFormation.txt'
1617
]
1718
};
1819

deploy/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"license": "MIT",
66
"scripts": {
77
"build": "grunt clean:build && grunt copy:build",
8-
"deploy": "grunt clean:deploy && grunt copy:deploy"
8+
"deploy": "grunt clean:deploy && grunt copy:deploy",
9+
"build-deploy": "yarn run build && yarn run deploy"
910
},
1011
"devDependencies": {
1112
"grunt": "^1.0.3",

function/LAM2Panel.lua

+25-11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,30 @@ local function TeamFormation_mapJRULES()
1919
return TeamFormation_mapChoices(colorizePseudo, ProvTF.vars.jRules)
2020
end
2121

22+
local function TeamFormation_reset()
23+
ProvTF.vars = {}
24+
ProvTF.vars.enabled = ProvTF.defaults.enabled
25+
ProvTF.vars.posx = ProvTF.defaults.posx
26+
ProvTF.vars.posy = ProvTF.defaults.posy
27+
ProvTF.vars.width = ProvTF.defaults.width
28+
ProvTF.vars.height = ProvTF.defaults.height
29+
ProvTF.vars.refreshRate = ProvTF.defaults.refreshRate
30+
ProvTF.vars.circle =ProvTF.defaults.circle
31+
ProvTF.vars.camRotation = ProvTF.defaults.camRotation
32+
ProvTF.vars.scale = ProvTF.defaults.scale
33+
ProvTF.vars.logdist = ProvTF.defaults.logdist
34+
ProvTF.vars.cardinal = ProvTF.defaults.cardinal
35+
ProvTF.vars.siege = ProvTF.defaults.siege
36+
ProvTF.vars.myAlpha =ProvTF.defaults.myAlpha
37+
ProvTF.vars.roleIcon = ProvTF.defaults.roleIcon
38+
-- Don't pass default's jRules reference.
39+
ProvTF.vars.jRules = {}
40+
41+
ProvTF.UI:SetAnchor(CENTER, GuiRoot, CENTER, ProvTF.vars.posx, ProvTF.vars.posy)
42+
TeamFormation_SetHidden(not ProvTF.vars.enabled)
43+
TeamFormation_ResetRefreshRate()
44+
end
45+
2246
function TeamFormation_createLAM2Panel()
2347
local panelData =
2448
{
@@ -30,17 +54,7 @@ function TeamFormation_createLAM2Panel()
3054
slashCommand = "/tf",
3155
registerForRefresh = true,
3256
registerForDefaults = true,
33-
resetFunc = function()
34-
ProvTF.vars = nil
35-
ProvTF.vars = ProvTF.defaults
36-
ProvTF.vars.jRules = nil
37-
ProvTF.vars.jRules = {}
38-
39-
ProvTF.UI:SetAnchor(CENTER, GuiRoot, CENTER, ProvTF.vars.posx, ProvTF.vars.posy)
40-
TeamFormation_SetHidden(not ProvTF.vars.enabled)
41-
42-
TeamFormation_ResetRefreshRate()
43-
end,
57+
resetFunc = TeamFormation_reset,
4458
}
4559

4660
local optionsData =

lang/en.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ZO_CreateStringId("SI_TF_SETTING_WIDTH_TOOLTIP", "Change the Width of TeamFormat
2323
ZO_CreateStringId("SI_TF_SETTING_HEIGHT", "Height")
2424
ZO_CreateStringId("SI_TF_SETTING_HEIGHT_TOOLTIP", "Change the Height of TeamFormation.")
2525
ZO_CreateStringId("SI_TF_SETTING_LOCK", "Lock Position")
26-
ZO_CreateStringId("SI_TF_SETTING_LOCK_TOOLTIP", "Lock TeamFormation position, make it unmovable.")
26+
ZO_CreateStringId("SI_TF_SETTING_LOCK_TOOLTIP", "Lock TeamFormation position, make it immovable.")
2727

2828
ZO_CreateStringId("SI_TF_SETTING_FOCUSOPTIONS", "TeamFormation screen")
2929
ZO_CreateStringId("SI_TF_SETTING_FOCUSOPTIONS_TOOLTIP", "Configure the UI of TeamFormation.")
@@ -42,7 +42,7 @@ ZO_CreateStringId("SI_TF_SETTING_SCALE_TOOLTIP", "Change the scale of pins.")
4242
ZO_CreateStringId("SI_TF_SETTING_LOGDIST", "Distance logarithmic")
4343
ZO_CreateStringId("SI_TF_SETTING_LOGDIST_TOOLTIP", "0 = Linear\nAdjusts the maximum pin distance.")
4444
ZO_CreateStringId("SI_TF_SETTING_CARDINAL", "Opacity of the cardinal points")
45-
ZO_CreateStringId("SI_TF_SETTING_CARDINAL_TOOLTIP", "0 = Hidden\Adjusts the transparency of the four cardinal points (North, South, East, & West).")
45+
ZO_CreateStringId("SI_TF_SETTING_CARDINAL_TOOLTIP", "0 = Hidden\nAdjusts the transparency of the four cardinal points (North, South, East, & West).")
4646
ZO_CreateStringId("SI_TF_SETTING_SIEGE", "Show UI when at siege weapon")
4747
ZO_CreateStringId("SI_TF_SETTING_SIEGE_TOOLTIP", "Show TeamFormation when you use siege weapon.")
4848

@@ -53,10 +53,10 @@ ZO_CreateStringId("SI_TF_SETTING_YOURALPHA_TOOLTIP", "0 = Hidden\nChanges the tr
5353
ZO_CreateStringId("SI_TF_SETTING_ROLE", "Role icon")
5454
ZO_CreateStringId("SI_TF_SETTING_ROLE_TOOLTIP", "Show role icon instead of class icon.")
5555

56-
ZO_CreateStringId("SI_TF_SETTING_HRADDON", "[NEW] Customize icon color with following parameters.");
56+
ZO_CreateStringId("SI_TF_SETTING_HRADDON", "[NEW] Customize icon color with the following settings.");
5757

5858
ZO_CreateStringId("SI_TF_SETTING_COLOROPTIONS", "Color customization")
59-
ZO_CreateStringId("SI_TF_SETTING_COLOROPTIONS_TOOLTIP", "Customize the color for the icons displayed in the TeamFormation.")
59+
ZO_CreateStringId("SI_TF_SETTING_COLOROPTIONS_TOOLTIP", "Customize the color for the icons displayed in TeamFormation.")
6060
ZO_CreateStringId("SI_TF_SETTING_COLORRESET", "Reset")
6161
ZO_CreateStringId("SI_TF_SETTING_COLORRESET_TOOLTIP", "Reset the player and class color.")
6262
ZO_CreateStringId("SI_TF_SETTING_JRULES", "Based on player name")

0 commit comments

Comments
 (0)