Forged Alliance Forever Forged Alliance Forever Forums 2014-03-22T23:22:41+02:00 /feed.php?f=26&t=6985 2014-03-22T23:22:41+02:00 2014-03-22T23:22:41+02:00 /viewtopic.php?t=6985&p=69570#p69570 <![CDATA[Re: Middle Mouse Button does not Rotate Templates [SOLVED]]]>
[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
You will now see the create build template button.
Factory Build Queue02.png


Also make sure the Allow Factory Build Templates is enabled under options.
Factory Build Queue03.png

Statistics: Posted by The Mak — 22 Mar 2014, 23:22


]]>
2014-03-20T13:41:56+02:00 2014-03-20T13:41:56+02:00 /viewtopic.php?t=6985&p=69412#p69412 <![CDATA[Re: Middle Mouse Button does not Rotate Templates [SOLVED]]]> 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?

Statistics: Posted by rxnnxs — 20 Mar 2014, 13:41


]]>
2014-03-18T19:15:04+02:00 2014-03-18T19:15:04+02:00 /viewtopic.php?t=6985&p=69267#p69267 <![CDATA[Re: SOLVED Middle Mouse Button does not Rotate Templates]]>

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.

Statistics: Posted by The Mak — 18 Mar 2014, 19:15


]]>
2014-03-13T01:27:39+02:00 2014-03-13T01:27:39+02:00 /viewtopic.php?t=6985&p=68809#p68809 <![CDATA[Re: Middle Mouse Button set to Camera Pan, want Rotate Templ]]>
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:
   --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:
    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?

Statistics: Posted by The Mak — 13 Mar 2014, 01:27


]]>
2014-03-12T16:13:33+02:00 2014-03-12T16:13:33+02:00 /viewtopic.php?t=6985&p=68763#p68763 <![CDATA[Re: Middle Mouse Button set to Camera Pan, want Rotate Templ]]> Statistics: Posted by Anaryl — 12 Mar 2014, 16:13


]]>
2014-03-18T19:17:30+02:00 2014-03-11T21:45:26+02:00 /viewtopic.php?t=6985&p=68707#p68707 <![CDATA[Middle Mouse Button does not Rotate Templates [SOLVED]]]> Statistics: Posted by The Mak — 11 Mar 2014, 21:45


]]>