From 6ec655cbce15e1cbf71cc7032aee512f0842c28c Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Thu, 1 Feb 2018 20:54:12 +0100 Subject: [PATCH] sandbox: add english translations and clean up scripts --- planet/Tutorials.ocf/Sandbox.ocs/DescDE.txt | 2 + planet/Tutorials.ocf/Sandbox.ocs/DescUS.txt | 2 + .../Sandbox.ocs/DevilsHand.ocd/Script.c | 30 +++--- .../Sandbox.ocs/GodsHand.ocd/Script.c | 29 +++--- planet/Tutorials.ocf/Sandbox.ocs/Map.c | 5 + .../Sandbox.ocs/Marker.ocd/Script.c | 21 ++-- .../Sandbox.ocs/Marker.ocd/StringTblDE.txt | 2 +- .../Sandbox.ocs/Marker.ocd/StringTblUS.txt | 2 +- planet/Tutorials.ocf/Sandbox.ocs/Scenario.txt | 2 +- planet/Tutorials.ocf/Sandbox.ocs/Script.c | 16 ++- .../Sound.ocg/{warp.ogg => Warp.ogg} | Bin .../Sandbox.ocs/SprayCan.ocd/Script.c | 6 +- .../Sandbox.ocs/System.ocg/Clonk_SandboxUI.c | 2 +- .../Sandbox.ocs/System.ocg/StringTblUS.txt | 93 ++++++++++++++++++ .../Sandbox.ocs/Teleporter.ocd/Script.c | 30 +++--- 15 files changed, 164 insertions(+), 78 deletions(-) rename planet/Tutorials.ocf/Sandbox.ocs/Sound.ocg/{warp.ogg => Warp.ogg} (100%) create mode 100644 planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblUS.txt diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DescDE.txt b/planet/Tutorials.ocf/Sandbox.ocs/DescDE.txt index 8c0979058..d24849b06 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/DescDE.txt +++ b/planet/Tutorials.ocf/Sandbox.ocs/DescDE.txt @@ -1,3 +1,5 @@ +Sandkasten + Eine Karte zum Unfug treiben, ohne wenn und aber. Hier kannst du dich nach Lust und Laune austoben und kannst hier alles ausprobieren, was du möchtest. Folgende Werkzeuge stehen dir hier zur Verfügung: diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DescUS.txt b/planet/Tutorials.ocf/Sandbox.ocs/DescUS.txt index 36806b2e6..202793507 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/DescUS.txt +++ b/planet/Tutorials.ocf/Sandbox.ocs/DescUS.txt @@ -1,3 +1,5 @@ +Sandbox + A scenario to play around with all the cool stuff. The following tools can be used: diff --git a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c index ae573ce43..41d34ae83 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/DevilsHand.ocd/Script.c @@ -1,34 +1,28 @@ - -/* - - Devils's Hand, a tool to remove objects. +/** + Devils's Hand + A tool to remove objects. - @author: K-Pone - + @author K-Pone */ local Name = "$Name$"; local Description = "$Description$"; -func Initialize() +public func ControlUse(object clonk, int x, int y) { - -} - -func ControlUse(object clonk, x, y) -{ - var dummy = clonk->CreateObject(Dummy, x, y); // Dummy is only needed to have a reference point for Find_Distance - var remobj = dummy->FindObject(Find_Distance(5), Find_NoContainer(), Find_Not(Find_ID(Clonk))); - dummy->RemoveObject(); - + var remobj = clonk->FindObject(Find_Distance(5, x, y), Find_NoContainer(), Find_Not(Find_ID(Clonk))); if (!remobj) { Sound("UI::Error"); return; } - remobj->RemoveObject(); - Sound("UI::Click", true, nil, clonk->GetOwner()); + return true; +} + +public func QueryRejectDeparture(object clonk) +{ + return true; } \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/GodsHand.ocd/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/GodsHand.ocd/Script.c index 7b599dc11..5854109e5 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/GodsHand.ocd/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/GodsHand.ocd/Script.c @@ -1,35 +1,32 @@ - -/* - - God's Hand, a tool to create objects. +/** + God's Hand + A tool to create objects. - @author: K-Pone - + @author K-Pone */ local Name = "$Name$"; local Description = "$Description$"; -func Initialize() -{ - -} - -func ControlUse(object clonk, x, y) +public func ControlUse(object clonk, int x, int y) { var objdef = clonk.ObjectSpawnDefinition; - - if (objdef == Marker) { var marker = clonk->PlaceNewMarker(); - if (marker) marker->SetPosition(clonk->GetX() + x, clonk->GetY() + y); + if (marker) + marker->SetPosition(clonk->GetX() + x, clonk->GetY() + y); } else { clonk->CreateObject(objdef, x, y); } - Sound("UI::Click", true, nil, clonk->GetOwner()); + return true; +} + +public func QueryRejectDeparture(object clonk) +{ + return true; } \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Map.c b/planet/Tutorials.ocf/Sandbox.ocs/Map.c index 3432e6b4d..44a27ba09 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Map.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/Map.c @@ -1,4 +1,9 @@ +/** + Sandbox + Map drawing for sandbox scenario. + @author K_Pone +*/ func InitializeMap(proplist map) { diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/Script.c index d7289916d..2cdb43f57 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/Script.c @@ -1,10 +1,7 @@ - -/* - +/** Marker - @author: K-Pone - + @author K-Pone */ local Name = "$Name$"; @@ -13,13 +10,13 @@ local Description = "$Description$"; local markerindex; local respawnmarker = false; -func Initialize() +public func Initialize() { this.Visibility = VIS_Owner | VIS_God; SetGraphics(nil, Dummy); } -func SetIcon(number) +public func SetIcon(number) { markerindex = number; SetGraphics(Format("%d", number), Icon_Number, 1, GFXOV_MODE_Base); @@ -27,24 +24,24 @@ func SetIcon(number) SetClrModulation(RGBa(255, 255, 255, 160) , 1); } -func GetIndex() +public func GetIndex() { return markerindex; } -func IsIndex(index) +public func IsIndex(index) { return index == markerindex; } -func IsRespawnMarker() { return respawnmarker; } +public func IsRespawnMarker() { return respawnmarker; } -global func GetMarkerForIndex(index, plr) +global func GetMarkerForIndex(int index, int plr) { return FindObject(Find_ID(Marker), Find_Owner(plr), Find_Func("IsIndex", index)); } -global func GetNextFreeMarkerIndex(plr) +global func GetNextFreeMarkerIndex(int plr) { for (var i = 0; i <= 9; i++) { diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblDE.txt b/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblDE.txt index d70f5a9c3..62be2bc54 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblDE.txt +++ b/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblDE.txt @@ -1,2 +1,2 @@ Name=Marker -Description=Ein einfacher Marker oder Wegpunkt \ No newline at end of file +Description=Ein einfacher Marker oder Wegpunkt. \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblUS.txt b/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblUS.txt index da0fe52a6..b61ac6921 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblUS.txt +++ b/planet/Tutorials.ocf/Sandbox.ocs/Marker.ocd/StringTblUS.txt @@ -1,2 +1,2 @@ Name=Marker -Description=A simple Marker or Waypoint \ No newline at end of file +Description=A simple marker or waypoint. \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Scenario.txt b/planet/Tutorials.ocf/Sandbox.ocs/Scenario.txt index 46878a008..547f45bd3 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Scenario.txt +++ b/planet/Tutorials.ocf/Sandbox.ocs/Scenario.txt @@ -1,5 +1,5 @@ [Head] -Title=Sandbox Reloaded +Title=Sandbox Icon=17 [Landscape] diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/Script.c index b90ac3707..3a1574436 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/Script.c @@ -1,20 +1,16 @@ - -/* - - Sandbox Reloaded - - @author: K-Pone - +/** + Sandbox + Author: K-Pone */ -func Initialize() +public func Initialize() { if (!MapGenSizeWidth) MapGenSizeWidth = 80; if (!MapGenSizeHeight) MapGenSizeHeight = 50; if (!MapGenPreset) MapGenPreset = "FlatLand"; } -func InitializePlayer(int plr) +public func InitializePlayer(int plr) { var crew = GetCrew(plr); crew->ShowSandboxUI(); @@ -29,7 +25,7 @@ func InitializePlayer(int plr) crew.MaxContentsCount = 8; } -func GiveAllKnowledge() +public func GiveAllKnowledge() { var i, id; while (id = GetDefinition(i++)) diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Sound.ocg/warp.ogg b/planet/Tutorials.ocf/Sandbox.ocs/Sound.ocg/Warp.ogg similarity index 100% rename from planet/Tutorials.ocf/Sandbox.ocs/Sound.ocg/warp.ogg rename to planet/Tutorials.ocf/Sandbox.ocs/Sound.ocg/Warp.ogg diff --git a/planet/Tutorials.ocf/Sandbox.ocs/SprayCan.ocd/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/SprayCan.ocd/Script.c index d8106af50..30ed055d3 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/SprayCan.ocd/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/SprayCan.ocd/Script.c @@ -1,4 +1,8 @@ -/* Spray can */ +/** + Spray can + + @author K-Pone, Sven2 +*/ local last_x, last_y, last_ldx, last_ldy; local paint_col; diff --git a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c index a7983578f..8c65364b7 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/Clonk_SandboxUI.c @@ -2126,6 +2126,6 @@ func RemoveMarker(marker) func GoToMarker(marker) { this->SetPosition(marker->GetX(), marker->GetY()); - this->Sound("warp"); + this->Sound("Warp"); this->Fireworks(); } \ No newline at end of file diff --git a/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblUS.txt b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblUS.txt new file mode 100644 index 000000000..ea4ba0383 --- /dev/null +++ b/planet/Tutorials.ocf/Sandbox.ocs/System.ocg/StringTblUS.txt @@ -0,0 +1,93 @@ +TooltipObjectspawn=Spawn objects +TooltipLandscapeBrush=Draw landscape +TooltipMarker=Marker +TooltipMapGen=Map generator +TooltipTweaks=Cheats and other cool stuff +GodsHandDisplayTT=Dieses Objekt wird mit der Hand Gottes platziert (zum Ändern \"Objekte erzeugen\" aufrufen und \"Hand Gottes\" als Ziel auswählen) + +OSCatProductionResources=Resources +OSCatFoodstuff=Nutrition +OSCatLiquids=Liquids +OSCatTools=Tools +OSCatWeapons=Weapons +OSCatExplosives=Explosives +OSCatVehicles=Vehicles +OSCatAnimals=Animals +OSCatPlants=Plants +OSCatGodTools=God's tools + +OSHintTarget=Tipp! Du kannst hiermit einstellen, wo du Objekte erzeugen möchtest. Stelle dies auf \"Hand Gottes\" um auszuwählen, welches Objekt du mit der Hand Gottes erzeugen möchtest. + +OSTargetClonk=Ziel: Clonk/Inventar +OSTargetGodsHand=Ziel: Hand Gottes +OSTargetClonkTT=Das Objekt wird (wenn möglich) im Inventar des Clonks erzeugt +OSTargetGodsHandTT=Das Objekt kann mit der Hand Gottes erzeugt werden + +MatEarth=Earth +MatEarthSpongy=Earth (spongy) +MatEarthRoot=Earth (root) +MatSand=Sand +MatSandDry=Dry sand +MatIce=Ice +MatIce2=Ice (different) +MatSnow=Snow +MatRock=Rock +MatRockSmooth=Rock (smooth) +MatGranite=Granite +MatOre=Ore +MatGold=Gold +MatCoal=Coal +MatFirestone=Firestone +MatRuby=Ruby +MatAmethyst=Amethyst +MatAshes=Ashes +MatBrick=Brick +MatBrickSoft=Brick (soft) +MatEverrock=Everrock +MatWater=Water +MatAcid=Acid +MatLava=Lava +MatDuroLava=Magma +MatOil=Oil +MatTunnel=Tunnel (background) +MatTunnelBrick=Brick tunnel (background) + +MatBgSky=Sky +MatBgTunnel=Tunnel +MatBgBricks=Brick + +MBMaterialFg=Material +MBMaterialBg=Background material +MBBrushSize=Brush size +MBBrushMode=Brush mode + +MBBrushModeBrush=Brush +MBBrushModeQuad=Square +MBBrushModeErase=Eraser + +MarkerNotSet=Marker not set +PlaceMarker=Set marker +RemoveMarker=Remove marker +GoToMarker=Teleport + +MapGenButtonGenerate=Generate map! +MapGenSizeWidth=map width +MapGenSizeHeight=map height +MapGenMapType=map type + +MapGenTPCustom=Modify +MapGenTPFlatLand=Flatland +MapGenTPSkylands=Skylands +MapGenTPCaves=Caves + +TweakInvincible=Invincibility (Gott-Modus) +OptActivate=Activate +OptDeactivate=Deactivate +TweakInvincible_Activated=%s is now invincible +TweakInvincible_Deactivated=%s is not invincible + +TweakSkinChoose=Choose skin +OptSkin1=Adventurere +OptSkin2=Steampunk +OptSkin3=Alchemist +OptSkin4=Farmer diff --git a/planet/Tutorials.ocf/Sandbox.ocs/Teleporter.ocd/Script.c b/planet/Tutorials.ocf/Sandbox.ocs/Teleporter.ocd/Script.c index 3b9f9394b..a6e9346c0 100644 --- a/planet/Tutorials.ocf/Sandbox.ocs/Teleporter.ocd/Script.c +++ b/planet/Tutorials.ocf/Sandbox.ocs/Teleporter.ocd/Script.c @@ -1,34 +1,30 @@ - -/* - +/** Teleporter - @Author: K-Pone - + @author K-Pone */ local Name = "$Name$"; local Description = "$Description$"; -func Initialize() -{ - -} -func ControlUse(object clonk, x, y) +public func ControlUse(object clonk, int x, int y) { - var gx, gy; - - gx = clonk->GetX() + x; - gy = clonk->GetY() + y; + var gx = clonk->GetX() + x; + var gy = clonk->GetY() + y; if (gx < 0 || gx >= LandscapeWidth() || gy < 0 || gy >= LandscapeHeight()) { clonk->Sound("UI::Error"); - return; + return true; } - clonk->SetPosition(gx, gy); clonk->Fireworks(); - clonk->Sound("warp"); + clonk->Sound("Warp"); + return true; +} + +public func QueryRejectDeparture(object clonk) +{ + return true; } \ No newline at end of file