Slight restructure and more cvars
This commit is contained in:
		
							parent
							
								
									51686d0f32
								
							
						
					
					
						commit
						243e1e83e8
					
				
					 1 changed files with 22 additions and 19 deletions
				
			
		|  | @ -1,22 +1,3 @@ | ||||||
| local function unsetBinding(action) |  | ||||||
|     local key1, key2 = GetBindingKey(action); |  | ||||||
|     if key1 then |  | ||||||
|         SetBinding(key1, nil); |  | ||||||
|     end |  | ||||||
|     if key2 then |  | ||||||
|         SetBinding(key2, nil); |  | ||||||
|     end |  | ||||||
| end |  | ||||||
| 
 |  | ||||||
| local function setBindingRM(key, action) |  | ||||||
|     unsetBinding(action); |  | ||||||
|     if SetBinding(key, action) then |  | ||||||
|         print("Set binding " .. key .. " to " .. action); |  | ||||||
|     else |  | ||||||
|         print("Failed to set binding " .. key .. " to " .. action); |  | ||||||
|     end |  | ||||||
| end |  | ||||||
| 
 |  | ||||||
| -- https://wowpedia.fandom.com/wiki/BindingID | -- https://wowpedia.fandom.com/wiki/BindingID | ||||||
| local myBinds = { | local myBinds = { | ||||||
|     -- Movement |     -- Movement | ||||||
|  | @ -102,6 +83,26 @@ local myBinds = { | ||||||
|     ["CTRL-6"] = "MULTIACTIONBAR4BUTTON12", |     ["CTRL-6"] = "MULTIACTIONBAR4BUTTON12", | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | local function unsetBinding(action) | ||||||
|  |     local key1, key2 = GetBindingKey(action); | ||||||
|  |     if key1 then | ||||||
|  |         SetBinding(key1, nil); | ||||||
|  |     end | ||||||
|  |     if key2 then | ||||||
|  |         SetBinding(key2, nil); | ||||||
|  |     end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | local function setBindingRM(key, action) | ||||||
|  |     unsetBinding(action); | ||||||
|  |     if SetBinding(key, action) then | ||||||
|  |         print("Set binding " .. key .. " to " .. action); | ||||||
|  |     else | ||||||
|  |         print("Failed to set binding " .. key .. " to " .. action); | ||||||
|  |     end | ||||||
|  | end | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| local function setAllBinds() | local function setAllBinds() | ||||||
|     for key, action in pairs(myBinds) do |     for key, action in pairs(myBinds) do | ||||||
|         setBindingRM(key, action) |         setBindingRM(key, action) | ||||||
|  | @ -119,6 +120,8 @@ local function enableBars() | ||||||
|     SetCVar("alwaysShowActionBars", 1); |     SetCVar("alwaysShowActionBars", 1); | ||||||
|     SetCVar("lockActionBars", 1); |     SetCVar("lockActionBars", 1); | ||||||
|     SetCVar("countdownForCooldowns", 1); |     SetCVar("countdownForCooldowns", 1); | ||||||
|  |     SetCVar("autoLootDefault", 1); | ||||||
|  |     SetCVar("cameraDistanceMaxZoomFactor", 2); | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| local function BindsHandler(msg, editbox) | local function BindsHandler(msg, editbox) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Imbus
						Imbus