*reorganized code fragments
Martin Unkel [06-14-18 - 15:27]
*reorganized code fragments
+create init lua for globale AE2 object
*fix txt file to load current project files
diff --git a/.gitignore b/.gitignore
index 764d0a8..052fb00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
/.idea/
-/sylvanaar2-elder-scrolls-online
+/eso-api-lua-intellij-baertram_API*
*~
/docs
\ No newline at end of file
diff --git a/AwesomeEvents2/AE_Init.lua b/AwesomeEvents2/AE_Init.lua
new file mode 100644
index 0000000..e66f77c
--- /dev/null
+++ b/AwesomeEvents2/AE_Init.lua
@@ -0,0 +1,28 @@
+--[[
+ This file is part of Awesome Events.
+
+ Author: @Ze_Mi <zemi@unive.de>
+ Filename: AE_Init.lua
+ Last Modified: 03.06.18 20:35
+
+ Copyright (c) 2018 by Martin Unkel
+ License : CreativeCommons CC BY-NC-SA 4.0 Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
+
+ Please read the README file for further information.
+ ]]
+
+local libAM = LibStub('LibAwesomeModule-2.0')
+
+AwesomeEvents = {
+ lib: libAM
+}
+
+AwesomeEvents.RefreshModules = function()
+ -- restore module user config
+ for mod_id,mod in libAM:module_pairs() do
+ mod:Disable()
+ if(vars[mod_id].enabled>0)then
+ mod:Enable(vars[mod_id])
+ end
+ end
+end
\ No newline at end of file
diff --git a/AwesomeEvents2/AE_Settings.lua b/AwesomeEvents2/AE_Settings.lua
index 49254ef..52a0ef8 100644
--- a/AwesomeEvents2/AE_Settings.lua
+++ b/AwesomeEvents2/AE_Settings.lua
@@ -98,13 +98,9 @@ local function ImportConfigFromCharacter(characterName)
vars[key] = __recursive_copy(tempVars[key])
end
libAM.d('settings','Imported successfully!')
- -- restore module user config
- for mod_id,mod in libAM:module_pairs() do
- mod:Disable()
- if(vars[mod_id].enabled>0)then
- mod:Enable(vars[mod_id])
- end
- end
+
+ AwesomeEvents.RefreshModules();
+
-- restore gui user config
for key,color in pairs(vars.hud.textColor) do
libAM.SetColorDef(key,color.r,color.g,color.b)
@@ -372,6 +368,17 @@ local function Initialize()
ShowHUD()
end
+function AwesomeEvents.Get(mod_id,key)
+ if(vars[mod_id] ~= nil and vars[mod_id][key] ~= nil)then
+ return vars[mod_id][key]
+ end
+end
+
+function AwesomeEvents.Set(mod_id,key,value)
+ if(vars[mod_id] == nil)then vars[mod_id] = {} end
+ vars[mod_id][key] = value
+end
+
----------------
-- INIT EVENT --
----------------
diff --git a/AwesomeEvents2/AwesomeEvents.xml b/AwesomeEvents2/AwesomeEvents.xml
deleted file mode 100644
index 95f552e..0000000
--- a/AwesomeEvents2/AwesomeEvents.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<GuiXml>
- <Controls>
- <Control name="AWEVS_ListEntry" virtual="true" inheritAlpha="true">
- <Dimensions x="315" y="52" />
- <Controls>
- <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds">
- <TextureCoords left="1" right="0.2" top="0" bottom=".8" />
- <AnchorFill/>
- </Texture>
-
- <Texture name="$(parent)Icon">
- <Dimensions x="32" y="32" />
- <Anchor point="BOTTOMRIGHT" offsetX="-15" offsetY="-11" />
- </Texture>
-
- <Label name="$(parent)Text" font="ZoFontWinH1" verticalAlignment="CENTER" color="FFFFFF" >
- <Anchor point="RIGHT" relativeTo="$(parent)Icon" relativePoint="LEFT" offsetX="-8" />
- </Label>
-
- </Controls>
- </Control>
-
- <TopLevelControl name="AwesomeEventsView" mouseEnabled="true" movable="true" clampedToScreen="true" hidden="true" allowBringToTop="true" resizeToFitDescendents="true">
- <OnInitialize>
- AwesomeEventsHUD_OnInitialize(self)
- </OnInitialize>
-
- <OnMouseEnter>
- self:SetAlpha(1)
- </OnMouseEnter>
-
- <OnUpdate>
- AwesomeEventsHUD_OnUpdate(time)
- </OnUpdate>
-
- <OnMoveStop>
- AwesomeEventsHUD_OnMoveStop(self)
- </OnMoveStop>
-
- <Anchor point="BOTTOMRIGHT" offsetY="-10" />
-
- <Controls>
- <Control name="$(parent)List" resizeToFitDescendents="true" >
- <Anchor point="CENTER" />
- <Control name="AE_ModuleEntry0" virtual="true" inheritAlpha="true">
- <Dimensions x="315" y="52" />
- <Controls>
- <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds">
- <TextureCoords left="1" right="0.2" top="0" bottom=".8" />
- <AnchorFill/>
- </Texture>
-
- <Texture name="$(parent)Icon">
- <Dimensions x="32" y="32" />
- <Anchor point="BOTTOMRIGHT" offsetX="-15" offsetY="-11" />
- </Texture>
-
- <Label name="$(parent)Text" font="ZoFontWinH5" verticalAlignment="CENTER" color="FFFFFF" text="SI_AWEVS_NO_ACTIVE_MOD" >
- <Anchor point="RIGHT" relativeTo="$(parent)Icon" relativePoint="LEFT" offsetX="-8" />
- </Label>
-
- </Controls>
- </Control>
- </Control>
- </Controls>
-
- </TopLevelControl>
- </Controls>
-</GuiXml>
\ No newline at end of file
diff --git a/AwesomeEvents2/AwesomeEvents2.txt b/AwesomeEvents2/AwesomeEvents2.txt
index a116b68..ce4d4c8 100644
--- a/AwesomeEvents2/AwesomeEvents2.txt
+++ b/AwesomeEvents2/AwesomeEvents2.txt
@@ -44,6 +44,11 @@ Modules/Skills.lua
Modules/SkyShards.lua
Modules/SoulGems.lua
Modules/WeaponCharge.lua
-AwesomeEvents.lua
-AwesomeEvents.xml
-AwesomeModuleLabel.xml
\ No newline at end of file
+
+AE_Init.lua
+AE_DebugWindow.lua
+AE_HUD.lua
+AE_Settings.lua
+AwesomeEvents2.lua
+
+AwesomeEvents2.xml
\ No newline at end of file
diff --git a/AwesomeEvents2/AwesomeEvents2.xml b/AwesomeEvents2/AwesomeEvents2.xml
new file mode 100644
index 0000000..95f552e
--- /dev/null
+++ b/AwesomeEvents2/AwesomeEvents2.xml
@@ -0,0 +1,69 @@
+<GuiXml>
+ <Controls>
+ <Control name="AWEVS_ListEntry" virtual="true" inheritAlpha="true">
+ <Dimensions x="315" y="52" />
+ <Controls>
+ <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds">
+ <TextureCoords left="1" right="0.2" top="0" bottom=".8" />
+ <AnchorFill/>
+ </Texture>
+
+ <Texture name="$(parent)Icon">
+ <Dimensions x="32" y="32" />
+ <Anchor point="BOTTOMRIGHT" offsetX="-15" offsetY="-11" />
+ </Texture>
+
+ <Label name="$(parent)Text" font="ZoFontWinH1" verticalAlignment="CENTER" color="FFFFFF" >
+ <Anchor point="RIGHT" relativeTo="$(parent)Icon" relativePoint="LEFT" offsetX="-8" />
+ </Label>
+
+ </Controls>
+ </Control>
+
+ <TopLevelControl name="AwesomeEventsView" mouseEnabled="true" movable="true" clampedToScreen="true" hidden="true" allowBringToTop="true" resizeToFitDescendents="true">
+ <OnInitialize>
+ AwesomeEventsHUD_OnInitialize(self)
+ </OnInitialize>
+
+ <OnMouseEnter>
+ self:SetAlpha(1)
+ </OnMouseEnter>
+
+ <OnUpdate>
+ AwesomeEventsHUD_OnUpdate(time)
+ </OnUpdate>
+
+ <OnMoveStop>
+ AwesomeEventsHUD_OnMoveStop(self)
+ </OnMoveStop>
+
+ <Anchor point="BOTTOMRIGHT" offsetY="-10" />
+
+ <Controls>
+ <Control name="$(parent)List" resizeToFitDescendents="true" >
+ <Anchor point="CENTER" />
+ <Control name="AE_ModuleEntry0" virtual="true" inheritAlpha="true">
+ <Dimensions x="315" y="52" />
+ <Controls>
+ <Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds">
+ <TextureCoords left="1" right="0.2" top="0" bottom=".8" />
+ <AnchorFill/>
+ </Texture>
+
+ <Texture name="$(parent)Icon">
+ <Dimensions x="32" y="32" />
+ <Anchor point="BOTTOMRIGHT" offsetX="-15" offsetY="-11" />
+ </Texture>
+
+ <Label name="$(parent)Text" font="ZoFontWinH5" verticalAlignment="CENTER" color="FFFFFF" text="SI_AWEVS_NO_ACTIVE_MOD" >
+ <Anchor point="RIGHT" relativeTo="$(parent)Icon" relativePoint="LEFT" offsetX="-8" />
+ </Label>
+
+ </Controls>
+ </Control>
+ </Control>
+ </Controls>
+
+ </TopLevelControl>
+ </Controls>
+</GuiXml>
\ No newline at end of file