View Single Post
Old 03-15-11, 08:12 AM   #7
DrJones
Samurai Navy
 
Join Date: Jun 2009
Location: Germany, 50 Kilometers away from Kiel
Posts: 576
Downloads: 341
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Your implementation of teleportation is exactly the same way I made it work in SH5. Coincidence? I think not.

If that code had been placed in a .dll file by me where noone could have seen how I implemented it and you came to the same implementation that would be a different story. But since it's clearly visible in a .py file and you came to the same implementation I have to cry foul.

The game only makes 3 stations visible by code, UZOStation, ObservationPeriscopeStation, and AttackPeriscopeStation. How did you come up with the other additional stations (HydrophoneStation, DeckGunStation, and A01gunStation)? I know how I 'found' those stations and if you want me to think that you came up with the teleportation implementation on your own then you'll be able to explain to me (and everyone else) how you 'found' those stations. Then you'll need to explain how you knew how to code the following for those stations 'from x import y'. How did you determine x for those new stations? If you can tell me that information then I would be more inclined to think you came up with this implementation on your own. If you can't then it's quite obvious where you got the additional stations from.

I will be looking over your code for any other copyright infringements.

I request that you remove this mod from download until you implement a different way of teleportation. Currently you have taken my idea and my implementation of it.
OK this is the Original Code in the Original Python File of the defaulthud.py

PageDefaultHud_Orders_Buttons = []
def CreateOrdersButtons():
global PageDefaultHud_Orders_Buttons
index = 0
LastButton = None
while index < 5:
index = index + 1
button = PageDefaultHud_Clonable_SampleAbilityButton.Create ACloneAsAChildOfAndBringToFront( PageDefaultHud_Orders )
PageDefaultHud_Orders_Buttons.append( button )
if LastButton == None:
button.SetSnapParent( PageDefaultHud_Orders, MenuItemWrapper.LocationPresets.MiddleLeft, True, 28, False )
else:
button.SetSnapParent( LastButton, MenuItemWrapper.LocationPresets.MiddleRight, False, 5, False )
LastButton = button
PageDefaultHud_Orders.SnapChildZones()

def DestroyOrdersButtons():
global PageDefaultHud_Orders_Buttons
for button in PageDefaultHud_Orders_Buttons:
Menu.DeleteItemOnEndOfFrame( button )
PageDefaultHud_Orders_Buttons = []

def SetOrderButtonsClickedEvent( set ):
global PageDefaultHud_Orders_Buttons
if set:
PageDefaultHud_Orders_ToggleModeButton.Clicked += PageDefaultHud_Orders_ToggleModeButton_Clicked
PageDefaultHud_Orders.Resized += PageDefaultHud_Orders_Resized
PageDefaultHud_Orders.Resizability = MenuItemWrapper.ResizabilityTypes.NoAspectRatioCon straint
PageDefaultHud_Orders.LimitRenderToBoundingRectang le = True
else:
PageDefaultHud_Orders_ToggleModeButton.Clicked -= PageDefaultHud_Orders_ToggleModeButton_Clicked
PageDefaultHud_Orders.Resized -= PageDefaultHud_Orders_Resized
# if mi.IsKindOf( ButtonWrapper ) and mi[ "OldSH4Command" ] != None:
for button in PageDefaultHud_Orders_Buttons:
if set:
button.Clicked += HUDOrderButton_Clicked
else:
button.Clicked -= HUDOrderButton_Clicked
SetOrders2GroupWidth( False )

def HUDOrderButton_Clicked( sender ):
#Game.SubmarineCommands.ExecuteCommand( sender[ "OldSH4Command" ] )
return

Orders2SmallWidthValue = 30
def PageDefaultHud_Orders_ToggleModeButton_Clicked( sender ):
SetOrders2GroupWidth( IsOrders2GroupSmall() )

def IsOrders2GroupSmall():
return PageDefaultHud_Orders.Width < Orders2SmallWidthValue

def SetOrders2GroupWidth( big ):
if(big):
Menu.PlaySound( "Menu.HUD.Toggle_Open" )
else:
Menu.PlaySound( "Menu.HUD.Toggle_Close" )
grp = PageDefaultHud_Orders
DurationInSeconds = 0.1
NewSize = Math.Max( Orders2SmallWidthValue - 1, SetVisibleForOrdersButtons( big ) )
#ScriptManagerManaged.ShowPythonError( NewSize.ToString() )
grp.StopAnimationsOfType( MenuItemWrapper.AnimationTypes.Width )
grp.StartAnimation( MenuItemWrapper.AnimationTypes.Width, NewSize, DurationInSeconds )

# sets the visible buttons and returns the used width in pixels
def SetVisibleForOrdersButtons( v ):
global PageDefaultHud_Orders_Buttons
Width = 10.0
# if mi.IsKindOf( ButtonWrapper ) and mi["OldSH4Command"]:
for button in PageDefaultHud_Orders_Buttons:
button.Visible = v
if button.Visible:
Width = Width + button.Width + button.SnapFromAnchor.OffsetX
return Width

def PageDefaultHud_Orders_Resized( sender ):
PageDefaultHud_Orders.SnapChildZones()
topleft = PageDefaultHud_Orders_TopLeft.GetPoint( MenuItemWrapper.LocationPresets.BottomRight )
bottomright = PageDefaultHud_Orders_BottomRight.GetPoint( MenuItemWrapper.LocationPresets.TopLeft )
PageDefaultHud_Orders_Top.Resize( bottomright.X - topleft.X, PageDefaultHud_Orders_Top.Height, False )
PageDefaultHud_Orders_Bottom.Resize( bottomright.X - topleft.X, PageDefaultHud_Orders_Bottom.Height, False )
PageDefaultHud_Orders_Left.Resize( PageDefaultHud_Orders_Left.Width, topleft.Y - bottomright.Y, False )
PageDefaultHud_Orders_Right.Resize( PageDefaultHud_Orders_Right.Width, topleft.Y - bottomright.Y, False )
s = PageDefaultHud_Orders.Size
PageDefaultHud_Orders_Background.Resize( s.Width - 2.0 * PageDefaultHud_Orders_Background.SnapFromAnchor.Of fsetX,
s.Height - 2.0 * math.fabs( PageDefaultHud_Orders_Background.SnapFromAnchor.Of fsetY ), True )

################################################## ###################################

def SetStationButtonsClickedEvent( set ):
for group in PageDefaultHud_StationButtons.Controls:
for ctrl in group.Controls:
if ctrl.IsKindOf( ButtonWrapper ):
if set:
ctrl.Clicked += HUDStationButton_Clicked
else:
ctrl.Clicked -= HUDStationButton_Clicked

def HUDStationButton_Clicked( sender ):
command = sender["OldSH4Command"]
if command != None:
HUDActivateOldSH4Station( command )
else:
TextToLookFor = [
[ PageDefaultHud_StationButtons_5_Radar, "radar" ]
, [ PageDefaultHud_StationButtons_5_Hydrophone, "sonar" ]
, [ PageDefaultHud_StationButtons_5_Hydrophone, "hydrophone" ]
]
for ttlf in TextToLookFor:
if sender == ttlf[0]:
from UserInteractionStationsManager import UserInteractionStationsManager
for s in UserInteractionStationsManager.Stations:
if s.Name.ToLower().Contains( ttlf[1] ):
HUDActivateStation( s )
break


def HUDActivateStation( station ):
import UserInteractionStationsManager
UserInteractionStationsManager.UserInteractionStat ionsManager.ActivateStation( station, UserInteractionStationsManagerWrapper.RequestTelep ort.No )

And the the Stations i found in the folder data/scripts/stations

any question about that ??

the rest of the information i got from the class structure of the menu editor over the script editor

You are not the only one who has the ability to script and having the knowledge about how programms a working...

Thats all for now

Regards

DrJones

P.S.: The download will not be removed
DrJones is offline   Reply With Quote