[Windows Mobile Development and Hacking General] 12aon:
Ok problem: I'm trying to change the landscape and portrait phototab but tehy are somehow dependent on one another

here''s the original:

-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l 14;0;; 35a10783_manila.luac

trace("Album Landscape")
require("Common\\LayoutInfo")
_LayoutInfo = LayoutInfo()
Album_ScreenRotation = class(RotationTemplate)
local l_0_0 = Album_ScreenRotation
l_0_0.__init = function(l_1_0, l_1_1)
l_1_0._ResetLayoutCallback = l_1_1
trace("Album_ScreenRotation:__init later")
RotationTemplate.__init(l_1_0)
end

l_0_0 = Album_ScreenRotation
l_0_0.OnScreenRotation = function(l_2_0)
Camera2DBegin.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
Camera2DBegin.ViewLeft.value = 0
Camera2DBegin.ViewRight.value = screenWidth
Camera2DBegin.ViewTop.value = 0
Camera2DBegin.ViewButtom.value = -(screenHeight - 2 * SystemTitlebarHeight)
Listview3DCamera.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
Listview3DCamera.ViewLeft.value = 0
Listview3DCamera.ViewRight.value = screenWidth
Listview3DCamera.ViewTop.value = 0
Listview3DCamera.ViewButtom.value = screenHeight - 2 * SystemTitlebarHeight
if _application.Orientation == ScreenOrientation_Portrait then
trace("Album_ScreenRotation_Portrait")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415)
ControlPanel2D.Position.x = 0
ControlPanel2D.Position.y = 0
ArrowGroups.Position.y = -322
KeyUpSprit.Position.y = 60
KeyUpSprit.Size.height = 130
InitPortraitConstant()
else
if _application.Orientation == ScreenOrientation_Landscape then
trace("Album_ScreenRotation_Landscape")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224)
ControlPanel2D.Position.x = 307
ControlPanel2D.Position.y = SystemTitlebarHeight
ArrowGroups.Position.y = -272
KeyUpSprit.Position.y = 10
KeyUpSprit.Size.height = 80
RightBound = 674
PanoramaWidth = 344
PanoramaHeight = 120
PanoramaVWidth = 108
PanoramaVHeight = 176
PortraitWidth = 132
PortraitHeight = 176
LandscapeWidth = 200
LandscapeHeight = 150
WideLandscapeWidth = 250
WideLandscapeHeight = 150
ParaOff = 0
LOff = -5
WLOff = 0
POff = -7
VParaOff = -7
PhotoHitTarget.Position.x = 212
PhotoHitTarget.Position.y = -36
PhotoHitTarget.Size.width = 360
PhotoHitTarget.Size.height = 300

which I have changed into:

-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l 14;0;; 35a10783_manila.luac

trace("Album Landscape")
require("Common\\LayoutInfo")
_LayoutInfo = LayoutInfo()
Album_ScreenRotation = class(RotationTemplate)
local l_0_0 = Album_ScreenRotation
l_0_0.__init = function(l_1_0, l_1_1)
l_1_0._ResetLayoutCallback = l_1_1
trace("Album_ScreenRotation:__init later")
RotationTemplate.__init(l_1_0)
end

l_0_0 = Album_ScreenRotation
l_0_0.OnScreenRotation = function(l_2_0)[B]
Camera2DBegin.Viewport.value = RectF(0, 0, 640, 480 - 2 * 50)[/B]
Camera2DBegin.ViewLeft.value = 0
[B] Camera2DBegin.ViewRight.value = 640[/B]
Camera2DBegin.ViewTop.value = 0
[B] Camera2DBegin.ViewButtom.value = -(480 - 2 * 50)[/B]
[B] [COLOR="Red"]Listview3DCamera.Viewport.value = RectF(0, 0, 480, 640 - 2 * 50)[/COLOR][/B]
Listview3DCamera.ViewLeft.value = 0
[B][COLOR="Red"]Listview3DCamera.ViewRight.value = 480[/COLOR][/B]
Listview3DCamera.ViewTop.value = 0
[B] [COLOR="Red"] Listview3DCamera.ViewButtom.value = 640 - 2 * 50[/COLOR][/B]
if _application.Orientation == ScreenOrientation_Portrait then
trace("Album_ScreenRotation_Portrait")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415)
ControlPanel2D.Position.x = 0
ControlPanel2D.Position.y = 0
ArrowGroups.Position.y = -322
KeyUpSprit.Position.y = 60
KeyUpSprit.Size.height = 130
InitPortraitConstant()
else
if _application.Orientation == ScreenOrientation_Landscape then
trace("Album_ScreenRotation_Landscape")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224)
ControlPanel2D.Position.x = 307
ControlPanel2D.Position.y = SystemTitlebarHeight
ArrowGroups.Position.y = -272
KeyUpSprit.Position.y = 10
KeyUpSprit.Size.height = 80
[B] RightBound = 539[/B]
PanoramaWidth = 344
PanoramaHeight = 120
PanoramaVWidth = 108
PanoramaVHeight = 176
PortraitWidth = 132
PortraitHeight = 176
LandscapeWidth = 200
LandscapeHeight = 150
WideLandscapeWidth = 250
WideLandscapeHeight = 150
ParaOff = 0
LOff = -5
WLOff = 0
POff = -7
VParaOff = -7
PhotoHitTarget.Position.x = 212
PhotoHitTarget.Position.y = -36
PhotoHitTarget.Size.width = 360
PhotoHitTarget.Size.height = 300
end
end

Now the code in red is the only code that seems to make a difference but when I change to code it automatically changes portrait as well as landscape. The question is can this be separated or the there a factor somewhere that give the information on how these two rely on one another? 12