Middle Mouse Button does not Rotate Templates [SOLVED]

Tournaments announces and results.

Moderators: FtXCommando, Stups

Middle Mouse Button does not Rotate Templates [SOLVED]

Postby The Mak » 11 Mar 2014, 21:45

Hi, I am trying to track down where you can remove the setting that the middle mouse button activates Free Pan Mode (move the camera like the arrow keys, but instead move it around with your mouse). I want the middle mouse button to instead rotate templates. I have set the rotate templates to on in the options menu, but it still activates the free panning. Any help would be appreciated.
Last edited by The Mak on 18 Mar 2014, 19:17, edited 2 times in total.
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak

Re: Middle Mouse Button set to Camera Pan, want Rotate Templ

Postby Anaryl » 12 Mar 2014, 16:13

Rebind in F1 menu?
Image
User avatar
Anaryl
Banned
 
Posts: 453
Joined: 20 Dec 2011, 18:54
Location: Rohangrad
Has liked: 13 times
Been liked: 6 times
FAF User Name: Anaryl

Re: Middle Mouse Button set to Camera Pan, want Rotate Templ

Postby The Mak » 13 Mar 2014, 01:27

Cannot find an entry in there that deals with camera pan or even if middle mouse button is assigned to anything. Even dug up the old SupCom manual to see if it lists the middle mouse button as that function (it doesn’t).

What is also weird is that if I start FA retail version, the middle button works fine. It actually does both functions (rotate template and pan the camera) at the same time. I think the recent update may have broken something.

What is also weird is that GAZ_UI is no longer listed on my FAF version Mod Manager. There is just no entry. The mod folder is installed in the right place and I am able to select the mod under the FA retail version. The recent update must somehow block that from being displayed. That is something that should not be done, it sets a bad precedent.


Back to the issue at hand, here is the code that is in GAZ_UI for the template rotator.
GAZ_UI\hook\lua\ui\game\construction.lua , line 286
Spoiler: show
Code: Select all
   --template rotator
   if options.gui_template_rotator != 0 then
      local oldOnClickHandler = OnClickHandler
      function OnClickHandler(button, modifiers)
         oldOnClickHandler(button, modifiers)
         local item = button.Data
         if item.type == "templates" then
            local activeTemplate = item.template.templateData
            local worldview = import('/lua/ui/game/worldview.lua').viewLeft
            local oldHandleEvent = worldview.HandleEvent
            worldview.HandleEvent = function(self, event)
               if event.Type == 'ButtonPress' then
                  if event.Modifiers.Middle then
                     ClearBuildTemplates()
                     local tempTemplate = table.deepcopy(activeTemplate)
                     for i = 3, table.getn(activeTemplate) do
                        local index = i
                        activeTemplate[index][3] = 0 - tempTemplate[index][4]
                        activeTemplate[index][4] = tempTemplate[index][3]
                     end
                     SetActiveBuildTemplate(activeTemplate)
                  elseif event.Modifiers.Shift then
                  else
                     worldview.HandleEvent = oldHandleEvent
                  end
               end
            end
         end
      end
   end



Where this is implemented in FAF is as follows,
faforever.nxt\lua\ui\game\construction.lua , line 1310
Spoiler: show
Code: Select all
    elseif item.type == 'templates' then
        ClearBuildTemplates()
        if modifiers.Right then
            if button.OptionMenu then
                button.OptionMenu:Destroy()
                button.OptionMenu = nil
            else
                button.OptionMenu = CreateTemplateOptionsMenu(button)
            end
            for _, otherBtn in controls.choices.Items do
                if button != otherBtn and otherBtn.OptionMenu then
                    otherBtn.OptionMenu:Destroy()
                    otherBtn.OptionMenu = false
                end
            end
        else
            import('/lua/ui/game/commandmode.lua').StartCommandMode('build', {name=item.template.templateData[3][1]})
            SetActiveBuildTemplate(item.template.templateData)
        end

        if options.gui_template_rotator != 0 then
            local item = button.Data
            local activeTemplate = item.template.templateData
            local worldview = import('/lua/ui/game/worldview.lua').viewLeft
            local oldHandleEvent = worldview.HandleEvent
            worldview.HandleEvent = function(self, event)
                if event.Type == 'ButtonPress' then
                    if event.Modifiers.Middle then
                        ClearBuildTemplates()
                        local tempTemplate = table.deepcopy(activeTemplate)
                        for i = 3, table.getn(activeTemplate) do
                            local index = i
                            activeTemplate[index][3] = 0 - tempTemplate[index][4]
                            activeTemplate[index][4] = tempTemplate[index][3]
                        end
                        SetActiveBuildTemplate(activeTemplate)
                    elseif event.Modifiers.Shift then
                    else
                        worldview.HandleEvent = oldHandleEvent
                    end
                end
            end
        end


In the FAF file, it is within an if..elseif where it begins on line 1194. Perhaps there is an issue with the condition.

Does your template rotate via middle mouse button work Anaryl?
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak

Re: SOLVED Middle Mouse Button does not Rotate Templates  Topic is solved

Postby The Mak » 18 Mar 2014, 19:15

Ok found the problem. It was a UI mod called AZUI (uid: 8c5dc7d0-4fa4-11dd-ae16-0800200c9a66). It has been a mod I have been using for a very long time that removed some lag from the UI. It seems Zep has already integrated all this into FAF :D

Also it fixed some other issues I was having as some mods did not show their build pic in the construction bar whether it was for engineers or factories. So big win.

It was a bitch to trace down though. After I disabled the mod I had to run two games in order to see the effect. So you can image disabling the mod, running a game, then seeing no change, only to re-enable the mod, disable another mod, running another game, and seeing again no change. I was like WTF.

What I had to do was disable the mod, run a game, end the game, then run another game, and then I can see the change. Pain in the ass.
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak

Re: Middle Mouse Button does not Rotate Templates [SOLVED]

Postby rxnnxs » 20 Mar 2014, 13:41

I have also this problem. i always have to start twice before getting the desired effect.
then i disabled all mods and so and all worked again (after deleting game.prefs).
but then ONE button is still not working.
is your "make form units a factory template" button working?
User avatar
rxnnxs
Priest
 
Posts: 346
Joined: 14 Feb 2013, 14:55
Has liked: 92 times
Been liked: 24 times
FAF User Name: rxnnxs

Re: Middle Mouse Button does not Rotate Templates [SOLVED]

Postby The Mak » 22 Mar 2014, 23:22

Just to be clear you are talking about Factory Templates, that is, from a factory create a queue of units to build in a particular order.

[EDIT]
Correct Way

WRONG STUFF HIDDEN, SORRY (it was how it use to work)
Spoiler: show
Since this was a function that was created initially in GAZUI, the create template button is kind of hidden. Steps to follow.
Select a factory, then select pause.
Queue up the units you wish to construct in the order you want.
Select the Selection and Storage button (Second button below build options)
Factory Build Queue01.png
Select Selection and Storage
Factory Build Queue01.png (153.25 KiB) Viewed 2674 times

You will now see the create build template button.
Factory Build Queue02.png
Save Template Button for Factory
Factory Build Queue02.png (77.05 KiB) Viewed 2674 times


Also make sure the Allow Factory Build Templates is enabled under options.
Factory Build Queue03.png
Option Menu for Factory Build Queue
Factory Build Queue03.png (95.07 KiB) Viewed 2674 times
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak


Return to Tournaments

Who is online

Users browsing this forum: No registered users and 1 guest